summaryrefslogtreecommitdiff
path: root/grpc/tools/profiling/microbenchmarks/bm_json.py
diff options
context:
space:
mode:
Diffstat (limited to 'grpc/tools/profiling/microbenchmarks/bm_json.py')
-rw-r--r--grpc/tools/profiling/microbenchmarks/bm_json.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/grpc/tools/profiling/microbenchmarks/bm_json.py b/grpc/tools/profiling/microbenchmarks/bm_json.py
index 2f5eb708..0f5aab52 100644
--- a/grpc/tools/profiling/microbenchmarks/bm_json.py
+++ b/grpc/tools/profiling/microbenchmarks/bm_json.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -120,7 +121,8 @@ _BM_SPECS = {
def numericalize(s):
"""Convert abbreviations like '100M' or '10k' to a number."""
- if not s: return ''
+ if not s:
+ return ''
if s[-1] == 'k':
return float(s[:-1]) * 1024
if s[-1] == 'M':
@@ -177,8 +179,10 @@ def parse_name(name):
def expand_json(js, js2=None):
- if not js and not js2: raise StopIteration()
- if not js: js = js2
+ if not js and not js2:
+ raise StopIteration()
+ if not js:
+ js = js2
for bm in js['benchmarks']:
if bm['name'].endswith('_stddev') or bm['name'].endswith('_mean'):
continue