GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DBIx::Class::QueryLog::NotifyOnMax(3) User Contributed Perl Documentation DBIx::Class::QueryLog::NotifyOnMax(3)

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.

Overridden version of "new" in DBIx::Class::QueryLog, simply adds an optional "max_count" parameter which defaults to "1_000".

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.

  • 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.

2015-12-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.