From 541b87e0155ea7de3b0f0123bdb28941fad32c8a Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 1 Mar 2017 08:42:52 -0800 Subject: Report non-counter cpu times to bigquery to get more accurate dashboards --- tools/profiling/microbenchmarks/bm2bq.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools/profiling/microbenchmarks/bm2bq.py') diff --git a/tools/profiling/microbenchmarks/bm2bq.py b/tools/profiling/microbenchmarks/bm2bq.py index 280f217e69..76ed0fef0d 100755 --- a/tools/profiling/microbenchmarks/bm2bq.py +++ b/tools/profiling/microbenchmarks/bm2bq.py @@ -80,6 +80,12 @@ if sys.argv[1] == '--schema': with open(sys.argv[1]) as f: js = json.loads(f.read()) +if len(sys.argv) > 2: + with open(sys.argv[2]) as f: + js2 = json.loads(f.read()) +else: + js2 = None + writer = csv.DictWriter(sys.stdout, [c for c,t in columns]) bm_specs = { @@ -215,4 +221,10 @@ for bm in js['benchmarks']: row.update(labels) if 'label' in row: del row['label'] + if js2: + for bm2 in js2['benchmarks']: + if bm['name'] == bm2['name']: + row['cpu_time'] = bm2['cpu_time'] + row['real_time'] = bm2['real_time'] + row['iterations'] = bm2['iterations'] writer.writerow(row) -- cgit v1.2.3