Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tools/gbench/Inputs/test1_run1.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,25 @@
"real_time": 1,
"cpu_time": 1,
"time_unit": "s"
},
{
"name": "BM_skipped",
"label": "a label",
"iterations": 1,
"real_time": 0,
"cpu_time": 0,
"time_unit": "s",
"skipped": true,
"skip_message": "Some message"
},
{
"name": "BM_error",
"iterations": 1,
"real_time": 0,
"cpu_time": 0,
"time_unit": "s",
"error_occurred": true,
"error_message": "Something happened"
}
]
}
19 changes: 19 additions & 0 deletions tools/gbench/Inputs/test1_run2.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,25 @@
"real_time": 1,
"cpu_time": 1,
"time_unit": "s"
},
{
"name": "BM_skipped",
"label": "a label",
"iterations": 1,
"real_time": 0,
"cpu_time": 0,
"time_unit": "s",
"skipped": true,
"skip_message": "Some message"
},
{
"name": "BM_error",
"iterations": 1,
"real_time": 0,
"cpu_time": 0,
"time_unit": "s",
"error_occurred": true,
"error_message": "Something happened"
}
]
}
18 changes: 16 additions & 2 deletions tools/gbench/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,23 @@ def partition_benchmarks(json1, json2):
lhs = [
x
for x in json1["benchmarks"]
if x["name"] == name and x["time_unit"] == time_unit
if x["name"] == name
and x["time_unit"] == time_unit
and not x.get("skipped", False)
and not x.get("error_occurred", False)
]
rhs = [
x
for x in json2["benchmarks"]
if x["name"] == name and x["time_unit"] == time_unit
if x["name"] == name
and x["time_unit"] == time_unit
and not x.get("skipped", False)
and not x.get("error_occurred", False)
]

if len(lhs) == 0 or len(rhs) == 0:
continue

partitions.append([lhs, rhs])
return partitions

Expand All @@ -191,6 +201,10 @@ def calculate_geomean(json):
for benchmark in json["benchmarks"]:
if "run_type" in benchmark and benchmark["run_type"] == "aggregate":
continue
if benchmark.get("skipped", False) or benchmark.get(
"error_occurred", False
):
continue
times.append(
[
get_timedelta_field_as_seconds(benchmark, "real_time"),
Expand Down
Loading