r111694 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111693‎ | r111694 | r111695 >
Date:22:24, 16 February 2012
Author:asher
Status:ok (Comments)
Tags:
Comment:
fix profiler-to-carbon - 1.19 is sending profile events with article title names
Modified paths:
  • /trunk/udpprofile/debian/changelog (modified) (history)
  • /trunk/udpprofile/profiler-to-carbon (modified) (history)

Diff [purge]

Index: trunk/udpprofile/debian/changelog
@@ -1,3 +1,9 @@
 2+udpprofile (1.5) lucid-wikimedia; urgency=low
 3+
 4+ * profiler-to-carbon skips non-ascii event keys
 5+
 6+ -- Asher Feldman <afeldman@wikimedia.org> Thu, 16 Feb 2012 22:23:00 +0000
 7+
28 udpprofile (1.4) lucid-wikimedia; urgency=low
39
410 * Aggregate stats separately to profiling
Index: trunk/udpprofile/profiler-to-carbon
@@ -25,6 +25,7 @@
2626 delay = 60
2727
2828 invalid = re.compile ( '[^\w\-]+' )
 29+skips = [ re.compile ( '^Parser.braceSubstitution-title-' ) ]
2930 prior={}
3031
3132 class SocketSource (socket.socket):
@@ -35,7 +36,8 @@
3637 def BuildStats(db, fullprofile):
3738 stats = {}
3839 events=fullprofile[db]["-"].items()
39 -
 40+ bad = 0
 41+
4042 for event in events:
4143 if "close" in event[0]: continue
4244 if "Profiling error" in event[0]: continue
@@ -45,7 +47,19 @@
4648 if (db.startswith('stats')):
4749 name = 'stats.'+invalid.sub('_', str(event[0])).rstrip('_')
4850 else:
49 - name = invalid.sub('_', str(event[0])).rstrip('_').replace('_', '.', 2)
 51+ try:
 52+ name = invalid.sub('_', str(event[0])).rstrip('_').replace('_', '.', 2)
 53+ except:
 54+ logging.debug("skipping on failed unicode conversion: %s", event[0])
 55+ continue
 56+ for skip in skips:
 57+ if skip.match(name):
 58+ bad = 1
 59+ break
 60+ if bad == 1:
 61+ bad = 0
 62+ continue
 63+
5064 stats[name] = {}
5165 stats[name]['count'] = event[1]['count']
5266 # real = time in ms

Comments

#Comment by Aaron Schulz (talk | contribs)   18:51, 23 February 2012

Per-template profiling was disabled on site again.

Status & tagging log