DBIx::Class::QueryLog::NotifyOnMax
version 1.005001
my $schema = ... # Get your schema! my $ql = DBIx::Class::QueryLog::NotifyOnMax->new( max_count => 100, ); $schema->storage->debugobj($ql); $schema->storage->debug(1); ... # get warning when you do more than 100 queries
More than once I've run into memory leaks that are caused by the user using DBIx::Class::QueryLog and forgetting to call "reset" in DBIx::Class::QueryLog. This subclass of DBIx::Class::QueryLog simply warns after 1_000 queries have gone through it. If you want to do something more complex, subclasses which override the "notify" method are a good idea.
DBIx::Class::QueryLog
1_000
Overridden version of "new" in DBIx::Class::QueryLog, simply adds an optional max_count parameter which defaults to 1_000.
max_count
This is the method that runs when the max_count has been exceeded. Takes no parameters. Make sure to call $self->notified(1) if you want the event to only take place once after the threshold has been exceeded.
$self->notified(1)
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
Cory G Watson <gphat at cpan.org>
This software is copyright (c) 2015 by Cory G Watson <gphat at cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install DBIx::Class::QueryLog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::QueryLog
CPAN shell
perl -MCPAN -e shell install DBIx::Class::QueryLog
For more information on module installation, please visit the detailed CPAN module installation guide.