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

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
« no previous file with comments | « apps/benchmark/measurements_unittest.cc ('k') | examples/dart/mojo_rtt_benchmark/lib/main.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/benchmark/run_args.cc
diff --git a/apps/benchmark/run_args.cc b/apps/benchmark/run_args.cc
index 8921a96137596001f453a2fb6bead5c47180975f..9f6dd8d52b8fb998a9ad2ab6811de0eff3664416 100644
--- a/apps/benchmark/run_args.cc
+++ b/apps/benchmark/run_args.cc
@@ -53,6 +53,20 @@ 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 '" << parts[3]
+ << "'' to be a number in: " << measurement_spec;
+ return false;
+ }
+ if ((result->param < 0.0) || (result->param > 1.0)) {
+ LOG(ERROR) << "Expected '" << result->param << "' to be >0.0 and <=1.0 "
ppi 2015/10/13 03:55:00 s/>0.0/>=0.0s
zra 2015/10/13 05:09:26 Done.
+ << "in " << measurement_spec;
+ }
} else {
LOG(ERROR) << "Could not recognize the measurement type: " << parts[0];
return false;
« no previous file with comments | « apps/benchmark/measurements_unittest.cc ('k') | examples/dart/mojo_rtt_benchmark/lib/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698