| Devel-Events-Filter-Size documentation | view source | Contained in the Devel-Events-Filter-Size distribution. |
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.
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).
It defaults to true when fields is a scalar, and false in any other
situation.
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.
Only reference types will have their sizes computed.
Internal method. Used by 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.
Optionally uses total_size in Devel::Size, depending on the value of
no_total.
Optionally loads Devel::Size::Report and uses uses
report_size in Devel::Size::Report, depending on the value of no_report.
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.
| Devel-Events-Filter-Size documentation | view source | Contained in the Devel-Events-Filter-Size distribution. |