ProfilerOutputStats: tweak stat key normalization
authorOri Livneh <ori@wikimedia.org>
Thu, 14 May 2015 21:49:51 +0000 (14:49 -0700)
committerOri Livneh <ori@wikimedia.org>
Thu, 14 May 2015 21:49:51 +0000 (14:49 -0700)
commitdfa5dabd159f9e423ffe22ee063196a7ca09787c
tree4a7c90628112c5a55769a7134a1bbb984e6952a0
parente6af67f40674911ece14a27b20e47c84d1774372
ProfilerOutputStats: tweak stat key normalization

When we convert a profiler entry to a statsd metric key, we replace
nonalphabetic characters with slashes. When part of the key is a file path with
a leading or trailing slash, this can result in keys that look like:
'MediaWiki._srv_mediawiki_foo_.bar', which is a bit ugly. This patch trims
leading and trailing underscores from each dot-separated key segment.

Change-Id: I71172b956f5a6120a75981a15dedf372d3893b88
includes/profiler/output/ProfilerOutputStats.php