nanobench: Add per-run time reporting.
This patch adds per-benchmark-iteration times to our JSON output. Given that we
already collect these statistics, giving them to the user would be nice.
No unit-test provided, since `rgrep -i json tests` yielded nothing. Happy to add
one if someone wants.
BUG=None.
TEST=nanobench now writes per-run timinings with the output JSON.
Change-Id: I910f1d97fd3e0ee69fc8e78e011e67b9c866f18d
Reviewed-on: https://skia-review.googlesource.com/5617
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ravi Mistry <rmistry@google.com>
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 5abecd6..9e641b9 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -1288,6 +1288,7 @@
benchStream.fillCurrentOptions(log.get());
target->fillOptions(log.get());
log->metric("min_ms", stats.min);
+ log->metrics("samples", samples);
#if SK_SUPPORT_GPU
if (gpuStatsDump) {
// dump to json, only SKPBench currently returns valid keys / values