params['prefix'] ) ) { $prefix = self::normalizeMetricKey( $this->params['prefix'] ); } else { $prefix = ''; } $contextStats = $this->collector->getContext()->getStats(); foreach ( $stats as $stat ) { $key = self::normalizeMetricKey( "{$prefix}.{$stat['name']}" ); // Convert fractional seconds to whole milliseconds $cpu = round( $stat['cpu'] * 1000 ); $real = round( $stat['real'] * 1000 ); $contextStats->increment( "{$key}.calls" ); $contextStats->timing( "{$key}.cpu", $cpu ); $contextStats->timing( "{$key}.real", $real ); } } }