Skip to content
Snippets Groups Projects
Commit d9bc2107 authored by Craig Tiller's avatar Craig Tiller
Browse files

Update microbenchmarking framework for new benchmark

parent 3f6bf731
No related branches found
No related tags found
No related merge requests found
...@@ -312,18 +312,18 @@ class TrickledCHTTP2 : public EndpointPairFixture { ...@@ -312,18 +312,18 @@ class TrickledCHTTP2 : public EndpointPairFixture {
void AddToLabel(std::ostream& out, benchmark::State& state) { void AddToLabel(std::ostream& out, benchmark::State& state) {
out << " writes/iter:" out << " writes/iter:"
<< ((double)stats_.num_writes / (double)state.iterations()) << ((double)stats_.num_writes / (double)state.iterations())
<< " cli-transport-stalls/iter:" << " cli_transport_stalls/iter:"
<< ((double) << ((double)
client_stats_.streams_stalled_due_to_transport_flow_control / client_stats_.streams_stalled_due_to_transport_flow_control /
(double)state.iterations()) (double)state.iterations())
<< " cli-stream-stalls/iter:" << " cli_stream_stalls/iter:"
<< ((double)client_stats_.streams_stalled_due_to_stream_flow_control / << ((double)client_stats_.streams_stalled_due_to_stream_flow_control /
(double)state.iterations()) (double)state.iterations())
<< " svr-transport-stalls/iter:" << " svr_transport_stalls/iter:"
<< ((double) << ((double)
server_stats_.streams_stalled_due_to_transport_flow_control / server_stats_.streams_stalled_due_to_transport_flow_control /
(double)state.iterations()) (double)state.iterations())
<< " svr-stream-stalls/iter:" << " svr_stream_stalls/iter:"
<< ((double)server_stats_.streams_stalled_due_to_stream_flow_control / << ((double)server_stats_.streams_stalled_due_to_stream_flow_control /
(double)state.iterations()); (double)state.iterations());
} }
......
...@@ -61,6 +61,11 @@ columns = [ ...@@ -61,6 +61,11 @@ columns = [
('allocs_per_iteration', 'float'), ('allocs_per_iteration', 'float'),
('locks_per_iteration', 'float'), ('locks_per_iteration', 'float'),
('writes_per_iteration', 'float'), ('writes_per_iteration', 'float'),
('bandwidth_kilobits', 'integer'),
('cli_transport_stalls_per_iteration', 'float'),
('cli_stream_stalls_per_iteration', 'float'),
('svr_transport_stalls_per_iteration', 'float'),
('svr_stream_stalls_per_iteration', 'float'),
] ]
if sys.argv[1] == '--schema': if sys.argv[1] == '--schema':
...@@ -92,7 +97,11 @@ bm_specs = { ...@@ -92,7 +97,11 @@ bm_specs = {
'BM_StreamingPingPongMsgs': { 'BM_StreamingPingPongMsgs': {
'tpl': ['fixture', 'client_mutator', 'server_mutator'], 'tpl': ['fixture', 'client_mutator', 'server_mutator'],
'dyn': ['request_size'], 'dyn': ['request_size'],
} },
'BM_PumpStreamServerToClient_Trickle': {
'tpl': [],
'dyn': ['request_size', 'bandwidth_kilobits'],
},
} }
def numericalize(s): def numericalize(s):
......
...@@ -149,9 +149,12 @@ def collect_summary(bm_name, args): ...@@ -149,9 +149,12 @@ def collect_summary(bm_name, args):
subprocess.check_call( subprocess.check_call(
['make', bm_name, ['make', bm_name,
'CONFIG=counters', '-j', '%d' % multiprocessing.cpu_count()]) 'CONFIG=counters', '-j', '%d' % multiprocessing.cpu_count()])
text(subprocess.check_output(['bins/counters/%s' % bm_name, cmd = ['bins/counters/%s' % bm_name,
'--benchmark_out=out.json', '--benchmark_out=out.json',
'--benchmark_out_format=json'])) '--benchmark_out_format=json']
if args.summary_time is not None:
cmd += ['--benchmark_min_time=%d' % args.summary_time]
text(subprocess.check_output(cmd))
if args.bigquery_upload: if args.bigquery_upload:
with open('out.csv', 'w') as f: with open('out.csv', 'w') as f:
f.write(subprocess.check_output(['tools/profiling/microbenchmarks/bm2bq.py', 'out.json'])) f.write(subprocess.check_output(['tools/profiling/microbenchmarks/bm2bq.py', 'out.json']))
...@@ -179,6 +182,10 @@ argp.add_argument('--bigquery_upload', ...@@ -179,6 +182,10 @@ argp.add_argument('--bigquery_upload',
action='store_const', action='store_const',
const=True, const=True,
help='Upload results from summary collection to bigquery') help='Upload results from summary collection to bigquery')
argp.add_argument('--summary_time',
default=None,
type=int,
help='Minimum time to run benchmarks for the summary collection')
args = argp.parse_args() args = argp.parse_args()
for bm_name in args.benchmarks: for bm_name in args.benchmarks:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment