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

Unified Diff: tools/perf/measurements/gpu_times.py

Issue 854833003: Added GPU performance metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplified gpu_timeline using new SwapBuffer trace Created 5 years, 11 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 | « tools/perf/benchmarks/gpu_times.py ('k') | tools/perf/measurements/gpu_times_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « tools/perf/benchmarks/gpu_times.py ('k') | tools/perf/measurements/gpu_times_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698