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

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

Issue 2656493002: Register metric Histogram names. (Closed)
Patch Set: rebase Created 3 years, 10 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 | « telemetry/telemetry/internal/story_runner.py ('k') | tracing/tracing/metrics/all_histogram_names.py » ('j') | no next file with comments »
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 961ed9120e26de4bd13871c5ed8522fe83e4c61a..921162072e012e06e22baafe25064a2a83940fb8 100644
--- a/telemetry/telemetry/web_perf/timeline_based_measurement.py
+++ b/telemetry/telemetry/web_perf/timeline_based_measurement.py
@@ -284,6 +284,9 @@ class TimelineBasedMeasurement(story_test.StoryTest):
chrome_config.category_filter.AddIncludedCategory('blink.console')
platform.tracing_controller.StartTracing(self._tbm_options.config)
+ def GetTimelineBasedMetrics(self):
+ return self._tbm_options.GetTimelineBasedMetrics()
+
def Measure(self, platform, results):
"""Collect all possible metrics and added them to results."""
platform.tracing_controller.telemetry_info = results.telemetry_info
@@ -291,11 +294,13 @@ class TimelineBasedMeasurement(story_test.StoryTest):
trace_value = trace.TraceValue(results.current_page, trace_result)
results.AddValue(trace_value)
- try:
- if self._tbm_options.GetTimelineBasedMetrics():
- assert not self._tbm_options.GetLegacyTimelineBasedMetrics(), (
- 'Specifying both TBMv1 and TBMv2 metrics is not allowed.')
- self._ComputeTimelineBasedMetrics(results, trace_value)
+ if self.GetTimelineBasedMetrics():
+ self._ComputeTimelineBasedMetrics(results, trace_value)
+ # Legacy metrics can be computed, but only if explicitly specified.
+ if self._tbm_options.GetLegacyTimelineBasedMetrics():
+ # Since this imports the trace model in python, it will also clean up
+ # the trace handles for us.
+ self._ComputeLegacyTimelineBasedMetrics(results, trace_result)
else:
# Run all TBMv1 metrics if no other metric is specified
# (legacy behavior)
@@ -315,7 +320,7 @@ class TimelineBasedMeasurement(story_test.StoryTest):
platform.tracing_controller.StopTracing()
def _ComputeTimelineBasedMetrics(self, results, trace_value):
- metrics = self._tbm_options.GetTimelineBasedMetrics()
+ metrics = self.GetTimelineBasedMetrics()
extra_import_options = {
'trackDetailedModelStats': True
}
« no previous file with comments | « telemetry/telemetry/internal/story_runner.py ('k') | tracing/tracing/metrics/all_histogram_names.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698