Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

/var/sites/help-site.com/auto/tmp/CPAN/9677/Jifty-0.71129/lib/Jifty/Plugin/LeakTracker.pm

/var/sites/help-site.com/auto/tmp/CPAN/9677/Jifty-0.71129/lib/Jifty/Plugin/LeakTracker.pm


init

init installs the triggers needed around each HTTP request =cut

sub init { my $self = shift; return if $self->_pre_init;


    Jifty::Handler->add_trigger(

        before_request => sub { $self->before_request(@_) }

    );

    Jifty::Handler->add_trigger(

        after_request  => sub { $self->after_request(@_) }

    );

}

before_request

This trigger sets up Devel::Events to instrument bless and free so it can keep track of all the objects created and destroyed in this request

after_request

This extracts all the data gathered by Devel::Events and puts it into the global @Jifty::Plugin::LeakTracker::requests so the LeakTracker dispatcher and views can query it to make nice reports


NAME

Jifty::Plugin::LeakTracker


DESCRIPTION

Memory leak detection and reporting for your Jifty app


USAGE

Add the following to your site_config.yml


 framework:

   Plugins:

     - LeakTracker: {}

This makes the following URLs available:

View the top-level leak report (how much each request has leaked)


    http://your.app/leaks

View the top-level leak report, including zero-leak requests


    http://your.app/leaks/all

View an individual request's detailed leak report (which objects were leaked)


    http://your.app/leaks/3


WARNING

If you use this in production, be sure to block off 'leaks' from non-administrators. The full Data::Dumper output of the objects leaked is available, which may of course contain sensitive information.


SEE ALSO

the Jifty::Plugin::LeakTracker::View manpage, the Jifty::Plugin::LeakTracker::Dispatcher manpage


COPYRIGHT AND LICENSE

Copyright 2007 Best Practical Solutions

This is free software and may be modified and distributed under the same terms as Perl itself.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy