Migrate MediaWiki.scribunto.traces.* to statslib

Bug: T359275
Change-Id: Idd234bbb34747b4557dcded73eace69131a2566a
This commit is contained in:
wfan 2024-05-04 22:34:03 -07:00
parent a7bf3cc073
commit fed1972733

View file

@ -279,11 +279,13 @@ class Hooks implements
static $stats;
if ( !$stats ) {
$stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
$stats = MediaWikiServices::getInstance()->getStatsFactory();
}
$metricKey = sprintf( 'scribunto.traces.%s__%s__%s', WikiMap::getCurrentWikiId(), $moduleName, $functionName );
$stats->timing( $metricKey, $timing );
$statAction = WikiMap::getCurrentWikiId() . '__' . $moduleName . '__' . $functionName;
$stats->getTiming( 'scribunto_traces_seconds' )
->setLabel( 'action', $statAction )
->copyToStatsdAt( 'scribunto.traces.' . $statAction )
->observe( $timing );
}
/**