OLD | NEW |
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 23 matching lines...) Expand all Loading... |
34 if (parts.size() < 1) { | 34 if (parts.size() < 1) { |
35 LOG(ERROR) << "Could not parse the measurement description: " | 35 LOG(ERROR) << "Could not parse the measurement description: " |
36 << measurement_spec; | 36 << measurement_spec; |
37 return false; | 37 return false; |
38 } | 38 } |
39 | 39 |
40 if (parts[0] == "time_until") { | 40 if (parts[0] == "time_until") { |
41 if (!CheckMeasurementFormat(parts[0], 3, parts.size())) | 41 if (!CheckMeasurementFormat(parts[0], 3, parts.size())) |
42 return false; | 42 return false; |
43 *result = | 43 *result = |
44 Measurement(MeasurementType::TIME_UNTIL, EventSpec(parts[1], parts[2])); | 44 Measurement(MeasurementType::TIME_UNTIL, EventSpec(parts[2], parts[1])); |
45 } else if (parts[0] == "time_between") { | 45 } else if (parts[0] == "time_between") { |
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[1], parts[2]), | 49 EventSpec(parts[2], parts[1]), |
50 EventSpec(parts[3], parts[4])); | 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[1], parts[2])); | 55 EventSpec(parts[2], parts[1])); |
56 } else { | 56 } else { |
57 LOG(ERROR) << "Could not recognize the measurement type: " << parts[0]; | 57 LOG(ERROR) << "Could not recognize the measurement type: " << parts[0]; |
58 return false; | 58 return false; |
59 } | 59 } |
60 | 60 |
61 result->spec = measurement_spec; | 61 result->spec = measurement_spec; |
62 return true; | 62 return true; |
63 } | 63 } |
64 | 64 |
65 } // namespace | 65 } // namespace |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 if (!GetMeasurement(measurement_spec, &measurement)) { | 104 if (!GetMeasurement(measurement_spec, &measurement)) { |
105 return false; | 105 return false; |
106 } | 106 } |
107 result->measurements.push_back(measurement); | 107 result->measurements.push_back(measurement); |
108 } | 108 } |
109 | 109 |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
113 } // namespace benchmark | 113 } // namespace benchmark |
OLD | NEW |