NAME
Class::ReluctantORM::Monitor::JoinCount - Track JOINs in queries
SYNOPSIS
use aliased 'Class::ReluctantORM::Monitor::JoinCount';
my $mon = JoinCounter->new(highwater_count => N, fatal_threshold => X);
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
my $count = $mon->last_measured_value();
DESCRIPTION
Tracks the number of JOINs in the FROM clause in the last query that was attempted to be executed.
Note that number of joins does not match number of relationships in the 'with' clause. Some relationship, such as HasLazy, contribute 0 JOINs, while others contribute more than one (HasManyMany).
This is a Measuring Monitor.