Migrate MediaWiki.syntaxhighlight_shell.*.rate to statslib

This patch migrates the `syntaxhighlight_shell` metric to the new Prometheus
format while copying the equivalent graphite counterpart to Graphite for
backwards compatibility with the existing Grafana dashboards.

Bug: T359270
Change-Id: I95bc2e749324092aae5db9135847c28aa16c64ea
This commit is contained in:
Andrea Denisse Gómez-Martínez 2024-07-01 18:11:25 -06:00
parent 70d0df0867
commit 0249ef7273

View file

@ -331,7 +331,10 @@ class Pygmentize {
* @param string $type Type of shellout
*/
private static function recordShellout( $type ) {
$statsd = MediaWikiServices::getInstance()->getStatsdDataFactory();
$statsd->increment( "syntaxhighlight_shell.$type" );
MediaWikiServices::getInstance()->getStatsFactory()
->getCounter( 'syntaxhighlight_shell_total' )
->setLabel( 'type', $type )
->copyToStatsdAt( "syntaxhighlight_shell.$type" )
->increment();
}
}