[jifty-devel] Re: [Jifty-commit] r4134 - in jifty/trunk: lib/Jifty/Plugin lib/Jifty/Plugin/LeakDetector

Jesse Vincent jesse at bestpractical.com
Tue Sep 18 16:29:01 EDT 2007


Shawn,

Can you make the optional LeakDetector dependencies part of a  
separable feature?

Best,
Jesse

On Sep 18, 2007, at 4:27 PM, jifty-commit at lists.jifty.org wrote:

> Author: sartak
> Date: Tue Sep 18 16:27:33 2007
> New Revision: 4134
>
> Modified:
>    jifty/trunk/   (props changed)
>    jifty/trunk/Makefile.PL
>    jifty/trunk/lib/Jifty/Plugin/LeakDetector.pm
>    jifty/trunk/lib/Jifty/Plugin/LeakDetector/Dispatcher.pm
>    jifty/trunk/lib/Jifty/Plugin/LeakDetector/View.pm
>
> Log:
>  r42796 at onn:  sartak | 2007-09-18 16:27:18 -0400
>  Some cleanups in LeakDetector
>
>
> Modified: jifty/trunk/Makefile.PL
> ====================================================================== 
> ========
> --- jifty/trunk/Makefile.PL	(original)
> +++ jifty/trunk/Makefile.PL	Tue Sep 18 16:27:33 2007
> @@ -107,7 +107,8 @@
>          recommends('Test::HTML::Lint'),
>          recommends('Test::MockModule' => '0.05'),
>          recommends('Test::MockObject' => '1.07'),
> -        recommends('Module::Refresh' => '0.09')
> +        recommends('Module::Refresh' => '0.09'),
> +        recommends('Devel::Events' => '0.02'),
>      ],
>      'Development of the jifty framework' => [
>          -default => 0,
>
> Modified: jifty/trunk/lib/Jifty/Plugin/LeakDetector.pm
> ====================================================================== 
> ========
> --- jifty/trunk/lib/Jifty/Plugin/LeakDetector.pm	(original)
> +++ jifty/trunk/lib/Jifty/Plugin/LeakDetector.pm	Tue Sep 18  
> 16:27:33 2007
> @@ -54,6 +54,7 @@
>      my $size = total_size([ keys %$leaked ]) - $empty_array;
>
>      push @requests, {
> +        id => 1 + @requests,
>          url => $cgi->url(-absolute=>1,-path_info=>1),
>          size => $size,
>          objects => Dumper($leaked),
> @@ -83,10 +84,6 @@
>
>  This makes the following URLs available:
>
> -View any URL of your app and catch any leaked objects
> -
> -    http://your.app/leak/user/12
> -
>  View the top-level leak report (how much each request has leaked)
>
>      http://your.app/leaks
>
> Modified: jifty/trunk/lib/Jifty/Plugin/LeakDetector/Dispatcher.pm
> ====================================================================== 
> ========
> --- jifty/trunk/lib/Jifty/Plugin/LeakDetector/Dispatcher.pm	(original)
> +++ jifty/trunk/lib/Jifty/Plugin/LeakDetector/Dispatcher.pm	Tue Sep  
> 18 16:27:33 2007
> @@ -11,10 +11,10 @@
>
>  # http://your.app/leaks/xxx -- display leak report for request ID xxx
>  on 'leaks/#' => run {
> -    my $leak = $Jifty::Plugin::LeakDetector::requests[$1]
> +    abort(404) if $1 < 1;
> +    my $leak = $Jifty::Plugin::LeakDetector::requests[$1 - 1]
>          or abort(404);
>      set leak => $leak;
> -    set leakid => $1;
>      show "leaks/one";
>  };
>
>
> Modified: jifty/trunk/lib/Jifty/Plugin/LeakDetector/View.pm
> ====================================================================== 
> ========
> --- jifty/trunk/lib/Jifty/Plugin/LeakDetector/View.pm	(original)
> +++ jifty/trunk/lib/Jifty/Plugin/LeakDetector/View.pm	Tue Sep 18  
> 16:27:33 2007
> @@ -30,17 +30,17 @@
>                      th { "URL" }
>                  };
>
> -                my $id = 0;
>                  for (@Jifty::Plugin::LeakDetector::requests)
>                  {
>                      row {
> -                        cell { a { attr { href => "leaks/$id" }  
> $id } }
> +                        cell { a { attr { href => "leaks/$_->{id}" }
> +                                   $_->{id} } }
> +
>                          cell { $_->{leaks} }
>                          cell { $_->{size} }
>                          cell { $_->{time} }
>                          cell { $_->{url} }
>                      };
> -                    ++$id;
>                  }
>              }
>          }
> @@ -49,16 +49,15 @@
>
>  template 'leaks/one' => sub {
>      my $leak = get 'leak';
> -    my $id = get 'leakid';
>
>      html {
>          body {
> -            h1 { "Leaks from Request $id" }
> +            h1 { "Leaks from Request $leak->{id}" }
>              ul {
>                  li { "URL: $leak->{url}" }
>                  li { "Time: $leak->{time}" }
>                  li { "Objects leaked: $leak->{leaks}" }
> -                li { "Total memory leaked: $leak->{size}" }
> +                li { "Total memory leaked: $leak->{size} bytes" }
>              }
>              p { a { attr { href => "/leaks" } "Table of Contents" } }
>              hr {}
> _______________________________________________
> Jifty-commit mailing list
> Jifty-commit at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070918/27bd4f05/PGP.pgp


More information about the jifty-devel mailing list