Index: tools/perf/measurements/gpu_times.py |
diff --git a/tools/perf/measurements/gpu_times.py b/tools/perf/measurements/gpu_times.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e7d2bb1b64bc2f38f58d9a882c34fd74e84e490 |
--- /dev/null |
+++ b/tools/perf/measurements/gpu_times.py |
@@ -0,0 +1,35 @@ |
+# Copyright 2015 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+from measurements import timeline_controller |
+from metrics import gpu_timeline |
+from telemetry.core.platform import tracing_category_filter |
+from telemetry.page import page_test |
+from telemetry.web_perf.metrics import layout |
+ |
+TOPLEVEL_GL_CATEGORY = 'gpu_toplevel' |
+TOPLEVEL_CATEGORIES = ['disabled-by-default-gpu.device', |
+ 'disabled-by-default-gpu.service'] |
+ |
+ |
+class GPUTimes(page_test.PageTest): |
nednguyen
2015/01/23 02:45:27
Why not adding this metrics to timeline_based_meas
|
+ def __init__(self, action_name_to_run='RunPageInteractions'): |
+ super(GPUTimes, self).__init__(action_name_to_run=action_name_to_run) |
+ self._timeline_controller = None |
+ |
+ def WillNavigateToPage(self, page, tab): |
+ self._timeline_controller = timeline_controller.TimelineController() |
+ self._timeline_controller.trace_categories = ','.join(TOPLEVEL_CATEGORIES) |
+ self._timeline_controller.SetUp(page, tab) |
+ |
+ def WillRunActions(self, page, tab): |
+ self._timeline_controller.Start(tab) |
+ |
+ def ValidateAndMeasurePage(self, page, tab, results): |
+ self._timeline_controller.Stop(tab, results) |
+ metric = gpu_timeline.GPUTimelineMetric() |
+ metric.AddResults(self._timeline_controller.model, None, |
+ self._timeline_controller.smooth_records, results) |
+ |
+ def CleanUpAfterPage(self, _, tab): |
+ self._timeline_controller.CleanUp(tab) |