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

Unified Diff: apps/benchmark/measurements.h

Issue 1394963002: Adds a couple more measures to the benchmarking app (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Format 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/measurements.h
diff --git a/apps/benchmark/measurements.h b/apps/benchmark/measurements.h
index 3d17e71875f9e9c778951c654a7cacbfc641f33d..dbd3240872010cebe120cbfd9f4eb351c9bc8c85 100644
--- a/apps/benchmark/measurements.h
+++ b/apps/benchmark/measurements.h
@@ -25,7 +25,13 @@ struct EventSpec {
~EventSpec();
};
-enum class MeasurementType { TIME_UNTIL, TIME_BETWEEN, AVG_DURATION };
+enum class MeasurementType {
+ TIME_UNTIL,
+ TIME_BETWEEN,
+ AVG_DURATION,
+ MEDIAN_DURATION,
+ DIST_DURATION,
ppi 2015/10/08 22:29:47 I'd call this PERCENTILE_DURATION.
zra 2015/10/09 14:51:15 Done.
+};
ppi 2015/10/08 22:29:47 Please also update the documentation in https://gi
zra 2015/10/09 14:51:15 Done.
// Represents a single measurement to be performed on the collected trace.
struct Measurement {
@@ -53,15 +59,19 @@ 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);
+ void Measure(const Measurement& measurement,
+ std::vector<double>* results) 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;
+ bool Percentiles(const EventSpec& event_spec,
+ const std::vector<double>& percentiles,
+ std::vector<double>* result) const;
std::vector<Event> events_;
base::TimeTicks time_origin_;

Powered by Google App Engine
This is Rietveld 408576698