mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-15 03:34:44 +00:00
Merge "Apply bucketing to query sizes stats"
This commit is contained in:
commit
5b011b7829
|
@ -332,7 +332,9 @@ class TemplateDataHooks {
|
|||
$logger = LoggerFactory::getInstance( 'TemplateData' );
|
||||
$size = count( $titles );
|
||||
|
||||
$stats->updateCount( 'templatedata.query.size.' . $size, 1 );
|
||||
// magnitude buckets: 1 -> 0, 8 -> 1, 12 -> 2, 78 -> 2, 120 -> 3, ...
|
||||
$magnitude = $size ? ceil( log10( $size ) ) : 0;
|
||||
$stats->updateCount( 'templatedata.query.magnitude.' . $magnitude, 1 );
|
||||
|
||||
if ( $size < 2 ) {
|
||||
$logger->debug( 'Single title query', [
|
||||
|
|
Loading…
Reference in a new issue