ProfilerOutputStats: replace single ':' with '.', too
authorOri Livneh <ori@wikimedia.org>
Thu, 21 May 2015 19:16:24 +0000 (12:16 -0700)
committerOri Livneh <ori@wikimedia.org>
Thu, 21 May 2015 19:16:24 +0000 (12:16 -0700)
This maps 'hook: ' and 'query: ' to a metric name segment, instead of just a
metric name prefix.

Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc

includes/profiler/output/ProfilerOutputStats.php

index 0d75191..d816a01 100644 (file)
@@ -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 );