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

Unified Diff: apps/benchmark/run_args.cc

Issue 1394963002: Adds a couple more measures to the benchmarking app (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
Index: apps/benchmark/run_args.cc
diff --git a/apps/benchmark/run_args.cc b/apps/benchmark/run_args.cc
index 8921a96137596001f453a2fb6bead5c47180975f..e74003983f892092f0ff1808b918a12d634fa672 100644
--- a/apps/benchmark/run_args.cc
+++ b/apps/benchmark/run_args.cc
@@ -53,6 +53,16 @@ bool GetMeasurement(const std::string& measurement_spec, Measurement* result) {
return false;
*result = Measurement(MeasurementType::AVG_DURATION,
EventSpec(parts[2], parts[1]));
+ } else if (parts[0] == "percentile_duration") {
+ if (!CheckMeasurementFormat(parts[0], 4, parts.size()))
+ return false;
+ *result = Measurement(MeasurementType::PERCENTILE_DURATION,
+ EventSpec(parts[2], parts[1]));
+ if (!base::StringToDouble(parts[3], &result->param)) {
+ LOG(ERROR) << "Expected a number between 0 and 1: " << parts[3] << " in "
+ << measurement_spec;
+ return false;
+ }
} else {
LOG(ERROR) << "Could not recognize the measurement type: " << parts[0];
return false;

Powered by Google App Engine
This is Rietveld 408576698