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

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 style 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/bin/run_metric » ('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..fb3847fe2d406111deca47f42ba35ef25b3bcaff 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,7 +208,10 @@ class Options(object):
return self._config
def SetTimelineBasedMetric(self, metric):
- """Sets the new-style (TBMv2) metric to run.
+ self.SetTimelineBasedMetrics([metric])
charliea (OOO until 10-5) 2016/07/06 17:41:05 nit: Why is there a comment for SetTimelineBasedMe
+
+ def SetTimelineBasedMetrics(self, metrics):
+ """Sets the new-style (TBMv2) metrics to run.
Metrics are assumed to live in //tracing/tracing/metrics, so the path
should be relative to that. For example, to specify sample_metric.html,
@@ -217,11 +220,13 @@ class Options(object):
Args:
metric: A string metric path under //tracing/tracing/metrics.
"""
- assert isinstance(metric, basestring)
- self._timeline_based_metric = metric
+ assert isinstance(metrics, list)
+ for metric in metrics:
+ assert isinstance(metric, basestring)
+ self._timeline_based_metrics = metrics
- 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 +284,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 +304,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/bin/run_metric » ('J')

Powered by Google App Engine
This is Rietveld 408576698