40 public function log( array $stats ) {
41 $prefix = isset( $this->params[
'prefix'] ) ? $this->params[
'prefix'] :
'';
42 $contextStats = MediaWikiServices::getInstance()->getStatsdDataFactory();
44 foreach ( $stats as $stat ) {
45 $key =
"{$prefix}.{$stat['name']}";
48 $cpu = round( $stat[
'cpu'] * 1000 );
49 $real = round( $stat[
'real'] * 1000 );
51 $contextStats->increment(
"{$key}.calls" );
52 $contextStats->timing(
"{$key}.cpu", $cpu );
53 $contextStats->timing(
"{$key}.real", $real );