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

Unified Diff: apps/benchmark/measurements.h

Issue 1380023005: benchmark.mojo: add time_between measurement type. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 3 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 a89665ed742b3b2ad0d2cce2f960e60da898d94b..3d17e71875f9e9c778951c654a7cacbfc641f33d 100644
--- a/apps/benchmark/measurements.h
+++ b/apps/benchmark/measurements.h
@@ -25,20 +25,24 @@ struct EventSpec {
~EventSpec();
};
-enum class MeasurementType { TIME_UNTIL, AVG_DURATION };
+enum class MeasurementType { TIME_UNTIL, TIME_BETWEEN, AVG_DURATION };
// Represents a single measurement to be performed on the collected trace.
struct Measurement {
MeasurementType type;
EventSpec target_event;
+ // Second event targeted by the measurement, meaningful only for binary
+ // measurement types (TIME_BETWEEN).
+ EventSpec second_event;
// Optional string from which this measurement was parsed. Can be used for
// presentation purposes.
std::string spec;
Measurement();
+ Measurement(MeasurementType type, EventSpec target_event);
Measurement(MeasurementType type,
- std::string target_name,
- std::string target_categories);
+ EventSpec target_event,
+ EventSpec second_event);
~Measurement();
};
@@ -52,7 +56,11 @@ class Measurements {
double Measure(const Measurement& measurement);
private:
+ bool EarliestOccurence(const EventSpec& event_spec,
+ base::TimeTicks* earliest);
double TimeUntil(const EventSpec& event_spec);
+ double TimeBetween(const EventSpec& first_event_spec,
+ const EventSpec& second_event_spec);
double AvgDuration(const EventSpec& event_spec);
std::vector<Event> events_;
« 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