# HG changeset patch # User Augie Fackler # Date 2019-06-12 23:00:46 # Node ID ff562d711919feea82cd41d3eb85165bd4b57bfd # Parent adb636392b3f9a71f6cd8c69a5b66276df15cd8b catapipe: add support for COUNTER events Differential Revision: https://phab.mercurial-scm.org/D6524 diff --git a/contrib/catapipe.py b/contrib/catapipe.py --- a/contrib/catapipe.py +++ b/contrib/catapipe.py @@ -44,6 +44,7 @@ import timeit _TYPEMAP = { 'START': 'B', 'END': 'E', + 'COUNTER': 'C', } _threadmap = {} @@ -78,6 +79,11 @@ def main(): verb, session, label = ev.split(' ', 2) if session not in _threadmap: _threadmap[session] = len(_threadmap) + if verb == 'COUNTER': + amount, label = label.split(' ', 1) + payload_args = {'value': int(amount)} + else: + payload_args = {} pid = _threadmap[session] ts_micros = (now - start) * 1000000 out.write(json.dumps( @@ -88,7 +94,7 @@ def main(): "ts": ts_micros, "pid": pid, "tid": 1, - "args": {} + "args": payload_args, })) out.write(',\n') finally: