aboutsummaryrefslogtreecommitdiff
path: root/include/benchmark
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2018-08-28 18:11:36 +0300
committerGitHub <noreply@github.com>2018-08-28 18:11:36 +0300
commit8688c5c4cfa1527ceca2136b2a738d9712a01890 (patch)
treef1d199270e5af99a10f71acb37c14d47df89179f /include/benchmark
parent9a179cb93faf76bbbff8410849ecb2eb3cf65024 (diff)
downloadgoogle-benchmark-8688c5c4cfa1527ceca2136b2a738d9712a01890.tar.gz
Track 'type' of the run - is it an actual measurement, or an aggregate. (#658)
This is *only* exposed in the JSON. Not in CSV, which is deprecated. This *only* supposed to track these two states. An additional field could later track which aggregate this is, specifically (statistic name, rms, bigo, ...) The motivation is that we already have ReportAggregatesOnly, but it affects the entire reports, both the display, and the reporters (json files), which isn't ideal. It would be very useful to have a 'display aggregates only' option, both in the library's console reporter, and the python tooling, This will be especially needed for the 'store separate iterations'.
Diffstat (limited to 'include/benchmark')
-rw-r--r--include/benchmark/benchmark.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h
index 87b10d1..efbbd72 100644
--- a/include/benchmark/benchmark.h
+++ b/include/benchmark/benchmark.h
@@ -1276,8 +1276,11 @@ class BenchmarkReporter {
};
struct Run {
+ enum RunType { RT_Iteration, RT_Aggregate };
+
Run()
- : error_occurred(false),
+ : run_type(RT_Iteration),
+ error_occurred(false),
iterations(1),
time_unit(kNanosecond),
real_accumulated_time(0),
@@ -1296,6 +1299,7 @@ class BenchmarkReporter {
max_bytes_used(0) {}
std::string benchmark_name;
+ RunType run_type; // is this a measurement, or an aggregate?
std::string report_label; // Empty if not set by benchmark.
bool error_occurred;
std::string error_message;