Skip to content

Commit 57273de

Browse files
committed
fix JSON output to include all hosts
JSON output only included results from a single host before
1 parent f454fb3 commit 57273de

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

output_results.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def output_results(invoke_list, test_params):
1717
max_elapsed_time = 0.0
1818
status = 'ok'
1919
rslt = {}
20-
rslt['per-thread'] = {}
20+
rslt['hosts'] = {}
21+
2122
for invk in invoke_list: # for each parallel SmallfileWorkload
2223

2324
# add up work that it did
@@ -32,12 +33,19 @@ def output_results(invoke_list, test_params):
3233
(invk.onhost, invk.tid, invk.elapsed_time,
3334
invk.filenum_final, invk.rq_final, status))
3435
per_thread_obj = {}
35-
per_thread_obj['onhost'] = invk.onhost
3636
per_thread_obj['elapsed'] = invk.elapsed_time,
3737
per_thread_obj['filenum-final'] = invk.filenum_final
3838
per_thread_obj['records'] = invk.rq_final
3939
per_thread_obj['status'] = status
40-
rslt['per-thread'][invk.tid] = per_thread_obj
40+
41+
# for JSON, show nesting of threads within hosts
42+
43+
try:
44+
per_host_results = rslt['hosts'][invk.onhost]
45+
except KeyError:
46+
per_host_results = { 'threads':{} }
47+
rslt['hosts'][invk.onhost] = per_host_results
48+
per_host_results['threads'][invk.tid] = per_thread_obj
4149

4250
# aggregate to get stats for whole run
4351

0 commit comments

Comments
 (0)