aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/ResultsWriter.h
diff options
context:
space:
mode:
Diffstat (limited to 'bench/ResultsWriter.h')
-rw-r--r--bench/ResultsWriter.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/bench/ResultsWriter.h b/bench/ResultsWriter.h
index dc50ace560..1d6dc3eef1 100644
--- a/bench/ResultsWriter.h
+++ b/bench/ResultsWriter.h
@@ -47,6 +47,9 @@ public:
// Record a single test metric.
virtual void metric(const char name[], double ms) {}
+ // Record a list of test metrics.
+ virtual void metrics(const char name[], const SkTArray<double>& array) {}
+
// Flush to storage now please.
virtual void flush() {}
};
@@ -114,6 +117,16 @@ public:
SkASSERT(fConfig);
(*fConfig)[name] = ms;
}
+ void metrics(const char name[], const SkTArray<double>& array) override {
+ SkASSERT(fConfig);
+ Json::Value value = Json::Value(Json::arrayValue);
+ value.resize(array.count());
+ for (int i = 0; i < array.count(); i++) {
+ // Don't care about nan-ness.
+ value[i] = array[i];
+ }
+ (*fConfig)[name] = std::move(value);
+ }
// Flush to storage now please.
void flush() override {