Skip to content

Commit

Permalink
Add comments, fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Feb 8, 2017
1 parent f74d172 commit 360c0d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/profiling/latency_profile/run_latency_profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ else
PYTHON=python2.7
fi

$PYTHON tools/profiling/microbenchmark/bm.py bm_fullstack
$PYTHON tools/run_tests/run_microbenchmark.py bm_fullstack
9 changes: 8 additions & 1 deletion tools/run_tests/run_microbenchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,21 @@ def link(txt, tgt):
'--source', '%s.trace' % fnize(line), '--fmt', 'simple',
'--out', 'reports/%s.txt' % fnize(line)], timeout_seconds=None))
cleanup.append(jobset.JobSpec(['rm', '%s.trace' % fnize(line)]))
# periodically flush out the list of jobs: profile_analysis jobs at least
# consume upwards of five gigabytes of ram in some cases, and so analysing
# hundreds of them at once is impractical -- but we want at least some
# concurrency or the work takes too long
if len(benchmarks) >= min(4, multiprocessing.cpu_count()):
# run up to half the cpu count: each benchmark can use up to two cores
# (one for the microbenchmark, one for the data flush)
jobset.run(benchmarks, maxjobs=multiprocessing.cpu_count()/2,
add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port})
jobset.run(profile_analysis, maxjobs=multiprocessing.cpu_count())
jobset.run(cleanup, maxjobs=multiprocessing.cpu_count())
benchmarks = []
profile_analysis = []
cleanup = []
# run the remaining benchmarks that weren't flushed
if len(benchmarks):
jobset.run(benchmarks, maxjobs=multiprocessing.cpu_count()/2,
add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port})
Expand Down Expand Up @@ -131,4 +138,4 @@ def link(txt, tgt):

index_html += "</body>\n</html>\n"
with open('reports/index.html', 'w') as f:
w.write(index_html)
f.write(index_html)

0 comments on commit 360c0d5

Please sign in to comment.