aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar jiangtaoli2016 <jiangtao@google.com>2017-04-25 16:04:25 -0700
committerGravatar jiangtaoli2016 <jiangtao@google.com>2017-04-25 16:04:25 -0700
commit7e41158311ea1ab658afddb26b9476a27c076ed4 (patch)
treed6be2aff87ea2e81090774d3c7d1116da412fc5b /tools
parent70406b70adddfaa013878c136c45f08cb0bd2832 (diff)
parentb864e7c41c6d0363e23093fb090625f260994962 (diff)
Merge branch 'master' into new_tsi
Diffstat (limited to 'tools')
-rwxr-xr-xtools/jenkins/run_performance.sh1
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff.py27
-rwxr-xr-xtools/run_tests/python_utils/port_server.py7
3 files changed, 20 insertions, 15 deletions
diff --git a/tools/jenkins/run_performance.sh b/tools/jenkins/run_performance.sh
index 544e31dcbd..f530fb46b8 100755
--- a/tools/jenkins/run_performance.sh
+++ b/tools/jenkins/run_performance.sh
@@ -37,4 +37,5 @@ BENCHMARKS_TO_RUN="bm_fullstack_unary_ping_pong bm_fullstack_streaming_ping_pong
# Enter the gRPC repo root
cd $(dirname $0)/../..
+tools/run_tests/start_port_server.py
tools/profiling/microbenchmarks/bm_diff.py -d origin/$ghprbTargetBranch -b $BENCHMARKS_TO_RUN
diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py
index 6ee4cbfc7b..3c15478774 100755
--- a/tools/profiling/microbenchmarks/bm_diff.py
+++ b/tools/profiling/microbenchmarks/bm_diff.py
@@ -204,7 +204,10 @@ def eintr_be_gone(fn):
def read_json(filename):
- with open(filename) as f: return json.loads(f.read())
+ try:
+ with open(filename) as f: return json.loads(f.read())
+ except ValueError, e:
+ return None
def finalize():
@@ -217,16 +220,18 @@ def finalize():
js_old_ctr = read_json('%s.counters.old.%d.json' % (bm, loop))
js_old_opt = read_json('%s.opt.old.%d.json' % (bm, loop))
- for row in bm_json.expand_json(js_new_ctr, js_new_opt):
- print row
- name = row['cpp_name']
- if name.endswith('_mean') or name.endswith('_stddev'): continue
- benchmarks[name].add_sample(row, True)
- for row in bm_json.expand_json(js_old_ctr, js_old_opt):
- print row
- name = row['cpp_name']
- if name.endswith('_mean') or name.endswith('_stddev'): continue
- benchmarks[name].add_sample(row, False)
+ if js_new_ctr:
+ for row in bm_json.expand_json(js_new_ctr, js_new_opt):
+ print row
+ name = row['cpp_name']
+ if name.endswith('_mean') or name.endswith('_stddev'): continue
+ benchmarks[name].add_sample(row, True)
+ if js_old_ctr:
+ for row in bm_json.expand_json(js_old_ctr, js_old_opt):
+ print row
+ name = row['cpp_name']
+ if name.endswith('_mean') or name.endswith('_stddev'): continue
+ benchmarks[name].add_sample(row, False)
really_interesting = set()
for name, bm in benchmarks.items():
diff --git a/tools/run_tests/python_utils/port_server.py b/tools/run_tests/python_utils/port_server.py
index 522cbed9e1..e96ee0b08c 100755
--- a/tools/run_tests/python_utils/port_server.py
+++ b/tools/run_tests/python_utils/port_server.py
@@ -46,7 +46,7 @@ import threading
# increment this number whenever making a change to ensure that
# the changes are picked up by running CI servers
# note that all changes must be backwards compatible
-_MY_VERSION = 11
+_MY_VERSION = 14
if len(sys.argv) == 2 and sys.argv[1] == 'dump_version':
@@ -166,12 +166,11 @@ class Handler(BaseHTTPRequestHandler):
elif self.path == '/quitquitquit':
self.send_response(200)
self.end_headers()
- sys.exit(0)
+ self.server.shutdown()
class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
"""Handle requests in a separate thread"""
-httpd = ThreadedHTTPServer(('', args.port), Handler)
-httpd.serve_forever()
+ThreadedHTTPServer(('', args.port), Handler).serve_forever()