Devel::Events::Filter::Size - Add Devel::Size info to event data.
my $f = Devel::Events::Filter::Size->new( handler => $h, fields => [qw/foo bar gorch/], # calculate the size of these fields ); # OR my $f = Devel::Events::Filter::Size->new( handler => $h, fields => "object", # just one field );
This class uses Devel::Size and optionally Devel::Size::Report to provide size information for data found inside events.
Typical usage would be to apply it to the object field in conjunction with Devel::Events::Objects.
object
The fields whose size to check.
Can be a single string, or an array reference.
When undefined all fields will be computed.
This parameter controls the placement of the results (top level, or under the sizes field).
sizes
It defaults to true when fields is a scalar, and false in any other situation.
fields
When true, "total_size" in Devel::Size will not be used.
Defaults to false.
When true, Devel::Size::Report will not be used.
Defaults to true.
When is_one_field returns a true value, this method will add a size, and optionally a total_size and size_report field to the event. Otherwise it will add several of these to the sizes field, keyed by the refaddr of the value.
is_one_field
size
total_size
size_report
refaddr
Only reference types will have their sizes computed.
Internal method. Used by filter_event
filter_event
Returns the fields whose sizes need computing. This is either all fields if fields is undef, or the specified fields.
Returns only one field. Used when is_one_field is true.
Return an entry with the size, total_size and size_report results.
See "size" in Devel::Size
Optionally uses "total_size" in Devel::Size, depending on the value of no_total.
no_total
Optionally loads Devel::Size::Report and uses uses "report_size" in Devel::Size::Report, depending on the value of no_report.
no_report
Devel::Events, Devel::Size, Devel::Events::Filter
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.
To install Devel::Events::Filter::Size, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Events::Filter::Size
CPAN shell
perl -MCPAN -e shell install Devel::Events::Filter::Size
For more information on module installation, please visit the detailed CPAN module installation guide.