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

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: 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/README.md ('k') | apps/benchmark/measurements.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/benchmark/measurements.h
diff --git a/apps/benchmark/measurements.h b/apps/benchmark/measurements.h
index 3d17e71875f9e9c778951c654a7cacbfc641f33d..143ca8b1af2d84d18f8df9efc1e31b361e052b9e 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 {
@@ -34,6 +39,8 @@ struct Measurement {
// Second event targeted by the measurement, meaningful only for binary
// measurement types (TIME_BETWEEN).
EventSpec second_event;
+ // Optional parameter to the measurement.
+ double param;
// Optional string from which this measurement was parsed. Can be used for
// presentation purposes.
std::string spec;
@@ -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_;
« no previous file with comments | « apps/benchmark/README.md ('k') | apps/benchmark/measurements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698