Subject: | [RFE] move the code for outputting stats report to a separate method |
Date: | Tue, 16 Oct 2018 12:44:12 +0100 |
To: | bug-Catalyst [...] rt.cpan.org |
From: | Robert Rothenberg <rrwo [...] cpan.org> |
The following code should be moved outside from finalize into another method
such as "log_stats_report"
| 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"| |);|
|||}
The reason is so that stats can be enabled but "logged" to a separate
monitoring system, e.g. StatsD.
|