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

Unified Diff: telemetry/telemetry/web_perf/timeline_based_measurement.py

Issue 2110683010: Allow benchmarks to specify running multiple metrics. (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: fix discover test Created 4 years, 5 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 | « no previous file | tracing/bin/run_metric » ('j') | tracing/tracing/metrics/discover_unittest.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/web_perf/timeline_based_measurement.py
diff --git a/telemetry/telemetry/web_perf/timeline_based_measurement.py b/telemetry/telemetry/web_perf/timeline_based_measurement.py
index 78103823d1c2511fbb3ca7af5acf280951a4e82b..e386427016ab10cc5cd68256f3e7c6193e967f9f 100644
--- a/telemetry/telemetry/web_perf/timeline_based_measurement.py
+++ b/telemetry/telemetry/web_perf/timeline_based_measurement.py
@@ -190,7 +190,7 @@ class Options(object):
"object or valid overhead level string. Given overhead "
"level: %s" % overhead_level)
- self._timeline_based_metric = None
+ self._timeline_based_metrics = None
self._legacy_timeline_based_metrics = []
@@ -208,20 +208,16 @@ class Options(object):
return self._config
def SetTimelineBasedMetric(self, metric):
charliea (OOO until 10-5) 2016/07/06 19:52:41 nit: are you going to delete this now that you're
alexandermont 2016/07/06 20:06:55 Done
- """Sets the new-style (TBMv2) metric to run.
+ self.SetTimelineBasedMetrics([metric])
- Metrics are assumed to live in //tracing/tracing/metrics, so the path
- should be relative to that. For example, to specify sample_metric.html,
- you would pass 'sample_metric.html'.
+ def SetTimelineBasedMetrics(self, metrics):
charliea (OOO until 10-5) 2016/07/06 19:52:41 Gah - sorry, this is totally my fault. I'd leave t
alexandermont 2016/07/06 20:06:55 Done
+ assert isinstance(metrics, list)
+ for metric in metrics:
+ assert isinstance(metric, basestring)
+ self._timeline_based_metrics = metrics
- Args:
- metric: A string metric path under //tracing/tracing/metrics.
- """
- assert isinstance(metric, basestring)
- self._timeline_based_metric = metric
-
- def GetTimelineBasedMetric(self):
- return self._timeline_based_metric
+ def GetTimelineBasedMetrics(self):
+ return self._timeline_based_metrics
def SetLegacyTimelineBasedMetrics(self, metrics):
assert isinstance(metrics, collections.Iterable)
@@ -279,8 +275,8 @@ class TimelineBasedMeasurement(story_test.StoryTest):
trace_value = trace.TraceValue(results.current_page, trace_result)
results.AddValue(trace_value)
- if self._tbm_options.GetTimelineBasedMetric():
- self._ComputeTimelineBasedMetric(results, trace_value)
+ if self._tbm_options.GetTimelineBasedMetrics():
+ self._ComputeTimelineBasedMetrics(results, trace_value)
# Legacy metrics can be computed, but only if explicitly specified.
if self._tbm_options.GetLegacyTimelineBasedMetrics():
self._ComputeLegacyTimelineBasedMetrics(results, trace_result)
@@ -299,14 +295,14 @@ class TimelineBasedMeasurement(story_test.StoryTest):
if platform.tracing_controller.is_tracing_running:
platform.tracing_controller.StopTracing()
- def _ComputeTimelineBasedMetric(self, results, trace_value):
- metric = self._tbm_options.GetTimelineBasedMetric()
+ def _ComputeTimelineBasedMetrics(self, results, trace_value):
+ metrics = self._tbm_options.GetTimelineBasedMetrics()
extra_import_options = {
'trackDetailedModelStats': True
}
mre_result = metric_runner.RunMetric(
- trace_value.filename, metric, extra_import_options)
+ trace_value.filename, metrics, extra_import_options)
page = results.current_page
failure_dicts = mre_result.failures
« no previous file with comments | « no previous file | tracing/bin/run_metric » ('j') | tracing/tracing/metrics/discover_unittest.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698