Subject: | [RFE] move the code for outputting stats report to a separate method |
Date: | Wed, 17 Oct 2018 12:12:53 +0100 |
To: | bug-Catalyst-Runtime [...] rt.cpan.org |
From: | Robert Rothenberg <rrwo [...] cpan.org> |
The code for logging a statistics table should be in a separate method, in
case one wants to enable statistics but have them logged to a separate
monitoring system (e.g. statsd).
The code in finalize
Show quoted text
> if ($c->use_stats) {
> my $elapsed = $c->stats->elapsed;
> my $av = $elapsed == 0 ? '??' : sprintf '%.3f', 1 / $elapsed;
> $c->log->info(
> "Request took ${elapsed}s ($av/s)\n" . $c->stats->report . "\n" );
> }
Should be moved to a separate method, "log_stats_report".
See also RT https://rt.cpan.org/Public/Bug/Display.html?id=127375