Chromium Code Reviews| Index: apps/benchmark/measurements.h |
| diff --git a/apps/benchmark/measurements.h b/apps/benchmark/measurements.h |
| index 3d17e71875f9e9c778951c654a7cacbfc641f33d..8e92dc213ef90c0ea83906dd9208682874c4f1c9 100644 |
| --- a/apps/benchmark/measurements.h |
| +++ b/apps/benchmark/measurements.h |
| @@ -25,7 +25,12 @@ struct EventSpec { |
| ~EventSpec(); |
| }; |
| -enum class MeasurementType { TIME_UNTIL, TIME_BETWEEN, AVG_DURATION }; |
| +enum class MeasurementType { |
| + TIME_UNTIL, |
| + TIME_BETWEEN, |
| + AVG_DURATION, |
| + PERCENTILE_DURATION, |
| +}; |
| // Represents a single measurement to be performed on the collected trace. |
| struct Measurement { |
| @@ -37,6 +42,8 @@ struct Measurement { |
| // Optional string from which this measurement was parsed. Can be used for |
| // presentation purposes. |
| std::string spec; |
| + // Optional parameter to the measurement. |
| + double param; |
|
ppi
2015/10/12 19:19:19
nit: move this before std::string spec; , as it lo
zra
2015/10/12 20:38:19
Done.
|
| Measurement(); |
| Measurement(MeasurementType type, EventSpec target_event); |
| @@ -53,15 +60,16 @@ class Measurements { |
| // Performs the given measurement. Returns the result in milliseconds or -1.0 |
| // if the measurement failed, e.g. because no events were matched. |
| - double Measure(const Measurement& measurement); |
| + double Measure(const Measurement& measurement) const; |
| private: |
| bool EarliestOccurence(const EventSpec& event_spec, |
| - base::TimeTicks* earliest); |
| - double TimeUntil(const EventSpec& event_spec); |
| + base::TimeTicks* earliest) const; |
| + double TimeUntil(const EventSpec& event_spec) const; |
| double TimeBetween(const EventSpec& first_event_spec, |
| - const EventSpec& second_event_spec); |
| - double AvgDuration(const EventSpec& event_spec); |
| + const EventSpec& second_event_spec) const; |
| + double AvgDuration(const EventSpec& event_spec) const; |
| + double Percentile(const EventSpec& event_spec, double percentile) const; |
| std::vector<Event> events_; |
| base::TimeTicks time_origin_; |