##// 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 _TYPEMAP = {
44 _TYPEMAP = {
45 'START': 'B',
45 'START': 'B',
46 'END': 'E',
46 'END': 'E',
47 'COUNTER': 'C',
47 }
48 }
48
49
49 _threadmap = {}
50 _threadmap = {}
@@ -78,6 +79,11 b' def main():'
78 verb, session, label = ev.split(' ', 2)
79 verb, session, label = ev.split(' ', 2)
79 if session not in _threadmap:
80 if session not in _threadmap:
80 _threadmap[session] = len(_threadmap)
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 pid = _threadmap[session]
87 pid = _threadmap[session]
82 ts_micros = (now - start) * 1000000
88 ts_micros = (now - start) * 1000000
83 out.write(json.dumps(
89 out.write(json.dumps(
@@ -88,7 +94,7 b' def main():'
88 "ts": ts_micros,
94 "ts": ts_micros,
89 "pid": pid,
95 "pid": pid,
90 "tid": 1,
96 "tid": 1,
91 "args": {}
97 "args": payload_args,
92 }))
98 }))
93 out.write(',\n')
99 out.write(',\n')
94 finally:
100 finally:
General Comments 0
You need to be logged in to leave comments. Login now