Permalink
Browse files

Build results of 5201508 (on master)

  • Loading branch information...
2 parents 459eb63 + 5201508 commit 57c9e9174b4bbee1bec484f83f54abf30b6d4733 @yanick committed Dec 10, 2010
Showing with 88 additions and 22 deletions.
  1. +2 −1 Build.PL
  2. +3 −0 Changes
  3. +1 −0 MANIFEST
  4. +3 −2 META.json
  5. +3 −2 META.yml
  6. +8 −1 README
  7. +12 −11 SIGNATURE
  8. +28 −5 lib/Catalyst/Plugin/MemoryUsage.pm
  9. +8 −0 t/basic_app.t
  10. +20 −0 t/not-supported.t
View
@@ -25,12 +25,13 @@ my %module_build_args = (
'Yanick Champoux <yanick@babyl.dyndns.org>'
],
'dist_name' => 'Catalyst-Plugin-MemoryUsage',
- 'dist_version' => '0.0.2',
+ 'dist_version' => '0.1.0',
'license' => 'perl',
'module_name' => 'Catalyst::Plugin::MemoryUsage',
'recommends' => {},
'recursive_test_files' => 1,
'requires' => {
+ 'Devel::CheckOS' => '0',
'MRO::Compat' => '0',
'Memory::Usage' => '0',
'Moose::Role' => '0',
View
@@ -1,5 +1,8 @@
Revision history for Catalyst::Plugin::MemoryUsage
+0.1.0 2010-12-09 21:25:39 America/Montreal
+ * If the OS is not Linux, issue a warning and don't active the plugin.
+
0.0.2 2010-11-29 20:41:21 America/Montreal
* Flesh out the documentation a little bit.
* Add a test.
View
@@ -11,3 +11,4 @@ t/000-report-versions.t
t/basic_app.t
t/lib/TestApp.pm
t/lib/TestApp/Controller/Root.pm
+t/not-supported.t
View
@@ -26,6 +26,7 @@
},
"runtime" : {
"requires" : {
+ "Devel::CheckOS" : 0,
"MRO::Compat" : 0,
"Memory::Usage" : 0,
"Moose::Role" : 0,
@@ -48,7 +49,7 @@
"provides" : {
"Catalyst::Plugin::MemoryUsage" : {
"file" : "lib/Catalyst/Plugin/MemoryUsage.pm",
- "version" : "v0.0.2"
+ "version" : "v0.1.0"
}
},
"release_status" : "stable",
@@ -64,6 +65,6 @@
"web" : "http://github.com/yanick/Catalyst-Plugin-MemoryUsage/tree"
}
},
- "version" : "0.0.2"
+ "version" : "0.1.0"
}
View
@@ -24,8 +24,9 @@ name: Catalyst-Plugin-MemoryUsage
provides:
Catalyst::Plugin::MemoryUsage:
file: lib/Catalyst/Plugin/MemoryUsage.pm
- version: v0.0.2
+ version: v0.1.0
requires:
+ Devel::CheckOS: 0
MRO::Compat: 0
Memory::Usage: 0
Moose::Role: 0
@@ -34,4 +35,4 @@ resources:
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Plugin-MemoryUsage
homepage: http://search.cpan.org/dist/Catalyst-Plugin-MemoryUsage/
repository: git://github.com/yanick/Catalyst-Plugin-MemoryUsage.git
-version: 0.0.2
+version: 0.1.0
View
9 README
@@ -2,7 +2,7 @@ NAME
Catalyst::Plugin::MemoryUsage - Profile memory usage of requests
VERSION
- version 0.0.2
+ version 0.1.0
SYNOPSIS
In YourApp.pm:
@@ -65,6 +65,13 @@ METHODS
Discards the current "Memory::Usage" object, along with its recorded
data, and replaces it by a shiny new one.
+BUGS AND LIMITATIONS
+ "Memory::Usage", which is the module "Catalyst::Plugin::MemoryUsage"
+ relies on to get its statistics, only work for Linux-based platforms.
+ Consequently, for the time being "Catalyst::Plugin::MemoryUsage" will
+ not do anything on any other platform. This being said, patches are most
+ welcome. :-)
+
SEE ALSO
Memory::Usage
View
@@ -14,22 +14,23 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 0935e08f67f910760c727206242204fd213e8ff9 Build.PL
-SHA1 481565171ec6472c0ae3455e7066661dd53f560a Changes
+SHA1 d32aa24f29fa8dbf84810f8d1a1c5fee55778d14 Build.PL
+SHA1 9b539adbc2ead4565aeafa0988d2de8708379cfb Changes
SHA1 3ee0d276167c367325eebe1d5ec9877ade504d93 LICENSE
-SHA1 1348feac0c270faaf3dbfbb4a79a719ffdc54ac7 MANIFEST
-SHA1 a97a2aafa652ec51429f506679322d11b90c08e3 META.json
-SHA1 d1cc5e56e88d17774a58a5df536687bae6375287 META.yml
-SHA1 24d74938b3d45d6cc05739cd36fe5741b56807e8 README
-SHA1 df705cbb67bb370c5cf620db748c9fcbb0a84dad lib/Catalyst/Plugin/MemoryUsage.pm
+SHA1 30f6bacd016e8de3070c23c603077c3f71897c47 MANIFEST
+SHA1 c8f6394b53f12295e69e55569122dcac4315f75f META.json
+SHA1 f01b395ad413e2ac141775f460a623153cc5d16b META.yml
+SHA1 07c29d605e593a21c7919593ddef0ecee42cf8c2 README
+SHA1 139a98d65a9d536e3325ec72fe14590d11094e0c lib/Catalyst/Plugin/MemoryUsage.pm
SHA1 050aa113e828a52db3c86065c0c0ed50198b7ce8 t/000-report-versions.t
-SHA1 889130f3aa95afc8482dfe92777d4f5129f14820 t/basic_app.t
+SHA1 913ca9f639126e62d8e34fff1b98212417764e6b t/basic_app.t
SHA1 579bfe1fb8b92f492eba9a177695e6cc5a6ba3b7 t/lib/TestApp.pm
SHA1 2de5436c98b1ec7e9c43759b94ba0059c027736b t/lib/TestApp/Controller/Root.pm
+SHA1 a2d7b94d92c46ee6a6aca969f5524e71e42e7202 t/not-supported.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
-iEYEARECAAYFAkz0VkgACgkQ34Hwf+GwC4y9+wCfbN738Ic5rLogo5EJLZOLYR9f
-BeEAoOtE1PeDnlbfMBnuNoN8/v7D5439
-=iJo8
+iEYEARECAAYFAk0Bj6kACgkQ34Hwf+GwC4wcpwCfXhanl44l4PnPpGDd7gWRxOpx
+alQAoIqCrU8G8zQAvDgZvPzVmYH3t+x4
+=Z6zU
-----END PGP SIGNATURE-----
@@ -1,4 +1,7 @@
package Catalyst::Plugin::MemoryUsage;
+BEGIN {
+ $Catalyst::Plugin::MemoryUsage::VERSION = '0.1.0';
+}
#ABSTRACT: Profile memory usage of requests
use strict;
@@ -10,7 +13,14 @@ use MRO::Compat;
use Memory::Usage;
-our $VERSION = '0.0.1';
+use Devel::CheckOS;
+
+our $os_not_supported = Devel::CheckOS::os_isnt( 'Linux' );
+
+if ( $os_not_supported ) {
+ warn "OS not supported by Catalyst::Plugin::MemoryUsage\n",
+ "\tStats will not be collected\n";
+}
has memory_usage => (
@@ -25,20 +35,24 @@ sub reset_memory_usage {
$self->memory_usage( Memory::Usage->new );
}
+unless ( $os_not_supported ) {
+
after execute => sub {
my $c = shift;
- $c->memory_usage->record( "after ". join " : ", @_ );
+ return if $os_not_supported;
+
+ $c->memory_usage->record( "after " . join " : ", @_ );
};
around prepare => sub {
my $orig = shift;
my $self = shift;
- my $c = $self->$orig( @_ );
+ my $c = $self->$orig(@_);
$c->reset_memory_usage;
- $c->memory_usage->record( 'preparing for the request' );
+ $c->memory_usage->record('preparing for the request');
return $c;
};
@@ -49,6 +63,8 @@ before finalize => sub {
$c->log->debug( 'memory usage of request', $c->memory_usage->report );
};
+}
+
1;
@@ -63,7 +79,7 @@ Catalyst::Plugin::MemoryUsage - Profile memory usage of requests
=head1 VERSION
-version 0.0.2
+version 0.1.0
=head1 SYNOPSIS
@@ -131,6 +147,13 @@ method of that object:
Discards the current C<Memory::Usage> object, along with its recorded data,
and replaces it by a shiny new one.
+=head1 BUGS AND LIMITATIONS
+
+C<Memory::Usage>, which is the module C<Catalyst::Plugin::MemoryUsage> relies
+on to get its statistics, only work for Linux-based platforms. Consequently,
+for the time being C<Catalyst::Plugin::MemoryUsage> will not do anything
+on any other platform. This being said, patches are most welcome. :-)
+
=head1 SEE ALSO
L<Memory::Usage>
View
@@ -4,10 +4,18 @@ use strict;
use Test::More; # last test to print
use lib 't/lib';
+use Devel::CheckOS qw/ os_isnt /;
+
+if ( os_isnt( 'Linux' ) ) {
+ plan skip_all => "os $^O is not supported";
+ exit;
+}
use Test::WWW::Mechanize::Catalyst;
my $mech = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'TestApp');
+my $x = $MyLog::mylog; # to keep the warnings happy
+
$mech->get_ok('/index');
my ( $profile ) = grep { /memory usage/ } @{ $MyLog::mylog->{debug} };
View
@@ -0,0 +1,20 @@
+use strict;
+use warnings;
+
+use lib 't/lib';
+use Test::More; # last test to print
+
+use Devel::CheckOS qw/ os_is /;
+
+if ( os_is( 'Linux' ) ) {
+ plan skip_all => "os $^O is supported";
+ exit;
+}
+
+use Test::WWW::Mechanize::Catalyst;
+my $mech = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'TestApp');
+
+$mech->get_ok('/index');
+
+done_testing();
+

0 comments on commit 57c9e91

Please sign in to comment.