Class::ReluctantORM::Monitor::QueryCount - Ongoing count of queries
use aliased 'Class::ReluctantORM::Monitor::QueryCount'; my $mon = QueryCount->new(); Class::ReluctantORM->install_global_monitor($mon); Pirate->install_class_monitor($mon); # Do a query.... logging and highwater scorekeeping happens Pirate->fetch(...); # Read from the monitor - should increase by 1 or more with each DB operation my $count = $mon->last_measured_value(); # Reset counter to 0 $mon->reset();
Simply counts the number of times the database is queried. This value may not increase (due to caching by a Registry or Static, a query may not be needed to perform a fetch). Also, some drivers may have to perform two queries to perform an operation (Eg, insert-and-return-values).
This is a Measuring Monitor. Note that highwater tracking is supported, but rather meaningless.
To install Class::ReluctantORM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::ReluctantORM
CPAN shell
perl -MCPAN -e shell install Class::ReluctantORM
For more information on module installation, please visit the detailed CPAN module installation guide.