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 | + |
2 | 8 | udpprofile (1.4) lucid-wikimedia; urgency=low |
3 | 9 | |
4 | 10 | * Aggregate stats separately to profiling |
Index: trunk/udpprofile/profiler-to-carbon |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | delay = 60 |
27 | 27 | |
28 | 28 | invalid = re.compile ( '[^\w\-]+' ) |
| 29 | +skips = [ re.compile ( '^Parser.braceSubstitution-title-' ) ] |
29 | 30 | prior={} |
30 | 31 | |
31 | 32 | class SocketSource (socket.socket): |
— | — | @@ -35,7 +36,8 @@ |
36 | 37 | def BuildStats(db, fullprofile): |
37 | 38 | stats = {} |
38 | 39 | events=fullprofile[db]["-"].items() |
39 | | - |
| 40 | + bad = 0 |
| 41 | + |
40 | 42 | for event in events: |
41 | 43 | if "close" in event[0]: continue |
42 | 44 | if "Profiling error" in event[0]: continue |
— | — | @@ -45,7 +47,19 @@ |
46 | 48 | if (db.startswith('stats')): |
47 | 49 | name = 'stats.'+invalid.sub('_', str(event[0])).rstrip('_') |
48 | 50 | 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 | + |
50 | 64 | stats[name] = {} |
51 | 65 | stats[name]['count'] = event[1]['count'] |
52 | 66 | # real = time in ms |