From: Ori Livneh Date: Thu, 21 May 2015 19:16:24 +0000 (-0700) Subject: ProfilerOutputStats: replace single ':' with '.', too X-Git-Tag: 1.31.0-rc.0~11333 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=e0ef4f556c4e2f836275e097e0c59a0a09bc7042;p=lhc%2Fweb%2Fwiklou.git ProfilerOutputStats: replace single ':' with '.', too This maps 'hook: ' and 'query: ' to a metric name segment, instead of just a metric name prefix. Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc --- diff --git a/includes/profiler/output/ProfilerOutputStats.php b/includes/profiler/output/ProfilerOutputStats.php index 0d7519170e..d816a01fe1 100644 --- a/includes/profiler/output/ProfilerOutputStats.php +++ b/includes/profiler/output/ProfilerOutputStats.php @@ -42,7 +42,7 @@ class ProfilerOutputStats extends ProfilerOutput { * @since 1.26 */ private static function normalizeMetricKey( $key ) { - $key = str_replace( '::', '.', $key ); + $key = preg_replace( '/[:.]+/', '.', $key ); $key = preg_replace( '/[^a-z.]+/i', '_', $key ); $key = trim( $key, '_.' ); return str_replace( array( '._', '_.' ), '.', $key );