##// END OF EJS Templates
catapipe: add support for COUNTER events...
Augie Fackler -
r42675:ff562d71 default
parent child Browse files
Show More
@@ -44,6 +44,7 b' import timeit'
44 44 _TYPEMAP = {
45 45 'START': 'B',
46 46 'END': 'E',
47 'COUNTER': 'C',
47 48 }
48 49
49 50 _threadmap = {}
@@ -78,6 +79,11 b' def main():'
78 79 verb, session, label = ev.split(' ', 2)
79 80 if session not in _threadmap:
80 81 _threadmap[session] = len(_threadmap)
82 if verb == 'COUNTER':
83 amount, label = label.split(' ', 1)
84 payload_args = {'value': int(amount)}
85 else:
86 payload_args = {}
81 87 pid = _threadmap[session]
82 88 ts_micros = (now - start) * 1000000
83 89 out.write(json.dumps(
@@ -88,7 +94,7 b' def main():'
88 94 "ts": ts_micros,
89 95 "pid": pid,
90 96 "tid": 1,
91 "args": {}
97 "args": payload_args,
92 98 }))
93 99 out.write(',\n')
94 100 finally:
General Comments 0
You need to be logged in to leave comments. Login now