/** * Send stats to statsd * * @param Database $lintDb */ protected function updateStats( Database $lintDb ) { global $wgLinterStatsdSampleFactor; if ( $wgLinterStatsdSampleFactor === false ) { // Not enabled at all return; } elseif ( mt_rand( 1, $wgLinterStatsdSampleFactor ) != 1 ) { return; } $totals = $lintDb->getTotals(); $stats = MediaWikiServices::getInstance()->getStatsdDataFactory(); foreach ( $totals as $name => $count ) { $stats->gauge( "linter.category.$name", $count ); } $stats->gauge( "linter.totals", array_sum( $totals ) ); }
What's a good value for $wgLinterStatsdSampleFactor? That code path is going to be called about once per edit.
Then, how can we get the data out of statsd? I know there's a JSON API we can call, and then probably some integration with the Graph extension to display it on Special:LintErrors or something.