Devel::Events - Extensible instrumentation framework.
use Devel::Events::Generator::Foo; use Devel::Events::Handler::Bar; use Devel::Events::Filter::Blort; my $h = Devel::Events::Generator->new( handler => Devel::Event::Filter->new( handler => Devel::Events::Handler::Bar->new(), ), );
Devel::Events is an event generation, filtering and analaysis framework for instrumenting and auditing perl code.
Devel::Events::Generator object fire events, which can be mangled by Devel::Event::Filter objects. Eventually any number of Devel::Event::Handler objects can receive a given event, and perform analysis based on it.
For example Devel::Event::Handler::ObjectTracker can be used to detect leaks.
There are two main types of components - generators and handlers.
Filters are special types of handlers that always delegate to another handler.
The multiplex handler may be used to delegate to any number of handlers.
Using these basic components complex chains of handlers can be built to properly analyze the events you are interested in.
Generate object_bless and object_destroy events by overriding CORE::GLOBAL::bless and tracking every object using Variable::Magic.
object_bless
object_destroy
CORE::GLOBAL::bless
Uses the perl debugger hook to generate enter_sub and leave_sub events.
enter_sub
leave_sub
Fires an executing_line event for every line using the perl debugger hook.
executing_line
Repeat events to multiple handlers.
Make a handler object out of a callback.
Log all events to an array.
Provides filtering and slicing methods to ease analysis.
Handles object_bless and object_destroy events (as generated by Devel::Events::Generator::Objects) to track the lifetime of objects. When objects lifetimes extend beyond the scope they're supposed to be destroyed in leaks can be detected.}
Add various stamp data (time, process ID, thread ID if threads are loaded) to events.
Stringify (by default using "StrVal" in overload, to avoid side effects) all event data to avoid leaking.
Add size reports to events using Devel::Size
Remove certain fields from events.
Runs warn "@event" before delegating to the sub handler. Useful for debugging handler chains.
warn "@event"
All events are passed as lists.
The default components will generate lists containing a single string which is the event name, and then a list of key/value pairs. Duplicate keys are allowed and their values will be preserved by the default filters, for example.
The idea is that hashifying is easy when desired, but that other structures can easily be supported as well.
Default values should be prepended to the list of key/value pairs so that when assigned to a hash the values that succeed them will get be the ones ending up in the hash.
Yuval Kogman <nothingmuch@woobling.org>
Copyright (c) 2007 Yuval Kogman. All rights reserved This program is free software; you can redistribute it and/or modify it under the terms of the MIT license or the same terms as Perl itself.
3 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
To install Devel::Events, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Events
CPAN shell
perl -MCPAN -e shell install Devel::Events
For more information on module installation, please visit the detailed CPAN module installation guide.