Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Unified Diff: bench/ResultsWriter.h

Issue 653083003: nanobench: flush after recording every Nth data point. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: --flushEvery Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bench/nanobench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ResultsWriter.h
diff --git a/bench/ResultsWriter.h b/bench/ResultsWriter.h
index f17bce3d930dbd9de8111d937cafb4f4ab003fd0..b8d97075a10bd150102007ede8e5f3febd403e14 100644
--- a/bench/ResultsWriter.h
+++ b/bench/ResultsWriter.h
@@ -45,6 +45,9 @@ public:
// Record a single test metric.
virtual void timer(const char name[], double ms) {}
+
+ // Flush to storage now please.
+ virtual void flush() {}
};
/**
@@ -79,9 +82,7 @@ public:
, fConfig(NULL) {}
~NanoJSONResultsWriter() {
- SkFILEWStream stream(fFilename.c_str());
- stream.writeText(Json::StyledWriter().write(fRoot).c_str());
- stream.flush();
+ this->flush();
}
// Added under "key".
@@ -113,6 +114,13 @@ public:
(*fConfig)[name] = ms;
}
+ // Flush to storage now please.
+ virtual void flush() {
+ SkFILEWStream stream(fFilename.c_str());
+ stream.writeText(Json::StyledWriter().write(fRoot).c_str());
+ stream.flush();
+ }
+
private:
SkString fFilename;
Json::Value fRoot;
« no previous file with comments | « no previous file | bench/nanobench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698