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

Unified Diff: bench/ResultsWriter.cpp

Issue 329993008: Make SKP bench JSON ouput better (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pulling from master Created 6 years, 6 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 | « bench/ResultsWriter.h ('k') | tools/PictureBenchmark.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ResultsWriter.cpp
diff --git a/bench/ResultsWriter.cpp b/bench/ResultsWriter.cpp
index 08f11c190fbff926fd27f334dde10370b4cff665..0ab8cb19080a25343978b1ccfeba0b510667349a 100644
--- a/bench/ResultsWriter.cpp
+++ b/bench/ResultsWriter.cpp
@@ -8,6 +8,8 @@
*/
#include "ResultsWriter.h"
+#include "SkString.h"
+#include "SkTArray.h"
Json::Value* SkFindNamedNode(Json::Value* root, const char name[]) {
Json::Value* search_results = NULL;
@@ -28,3 +30,30 @@ Json::Value* SkFindNamedNode(Json::Value* root, const char name[]) {
}
}
+Json::Value SkMakeBuilderJSON(const SkString &builderName) {
+ static const int kNumKeys = 6;
+ static const char* kKeys[kNumKeys] = {
+ "role", "os", "model", "gpu", "arch", "configuration"};
+ Json::Value builderData;
+
+ if (!builderName.isEmpty()) {
+ SkTArray<SkString> splitBuilder;
+ SkStrSplit(builderName.c_str(), "-", &splitBuilder);
+ SkASSERT(splitBuilder.count() >= kNumKeys);
+ for (int i = 0; i < kNumKeys && i < splitBuilder.count(); ++i) {
+ builderData[kKeys[i]] = splitBuilder[i].c_str();
+ }
+ builderData["builderName"] = builderName.c_str();
+ if (kNumKeys < splitBuilder.count()) {
+ SkString extras;
+ for (int i = kNumKeys; i < splitBuilder.count(); ++i) {
+ extras.append(splitBuilder[i]);
+ if (i != splitBuilder.count() - 1) {
+ extras.append("-");
+ }
+ }
+ builderData["badParams"] = extras.c_str();
+ }
+ }
+ return builderData;
+}
« no previous file with comments | « bench/ResultsWriter.h ('k') | tools/PictureBenchmark.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698