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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "apps/benchmark/run_args.h" 5 #include "apps/benchmark/run_args.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if (!CheckMeasurementFormat(parts[0], 5, parts.size())) 46 if (!CheckMeasurementFormat(parts[0], 5, parts.size()))
47 return false; 47 return false;
48 *result = Measurement(MeasurementType::TIME_BETWEEN, 48 *result = Measurement(MeasurementType::TIME_BETWEEN,
49 EventSpec(parts[2], parts[1]), 49 EventSpec(parts[2], parts[1]),
50 EventSpec(parts[4], parts[3])); 50 EventSpec(parts[4], parts[3]));
51 } else if (parts[0] == "avg_duration") { 51 } else if (parts[0] == "avg_duration") {
52 if (!CheckMeasurementFormat(parts[0], 3, parts.size())) 52 if (!CheckMeasurementFormat(parts[0], 3, parts.size()))
53 return false; 53 return false;
54 *result = Measurement(MeasurementType::AVG_DURATION, 54 *result = Measurement(MeasurementType::AVG_DURATION,
55 EventSpec(parts[2], parts[1])); 55 EventSpec(parts[2], parts[1]));
56 } else if (parts[0] == "percentile_duration") {
57 if (!CheckMeasurementFormat(parts[0], 4, parts.size()))
58 return false;
59 *result = Measurement(MeasurementType::PERCENTILE_DURATION,
60 EventSpec(parts[2], parts[1]));
61 if (!base::StringToDouble(parts[3], &result->param)) {
62 LOG(ERROR) << "Expected '" << parts[3]
63 << "'' to be a number in: " << measurement_spec;
64 return false;
65 }
66 if ((result->param < 0.0) || (result->param > 1.0)) {
67 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.
68 << "in " << measurement_spec;
69 }
56 } else { 70 } else {
57 LOG(ERROR) << "Could not recognize the measurement type: " << parts[0]; 71 LOG(ERROR) << "Could not recognize the measurement type: " << parts[0];
58 return false; 72 return false;
59 } 73 }
60 74
61 result->spec = measurement_spec; 75 result->spec = measurement_spec;
62 return true; 76 return true;
63 } 77 }
64 78
65 } // namespace 79 } // namespace
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (!GetMeasurement(measurement_spec, &measurement)) { 118 if (!GetMeasurement(measurement_spec, &measurement)) {
105 return false; 119 return false;
106 } 120 }
107 result->measurements.push_back(measurement); 121 result->measurements.push_back(measurement);
108 } 122 }
109 123
110 return true; 124 return true;
111 } 125 }
112 126
113 } // namespace benchmark 127 } // namespace benchmark
OLDNEW
« 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