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

Unified Diff: tools/telemetry/telemetry/web_perf/metrics/gpu_timeline.py

Issue 959983002: Add filter function to gpu_times. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « tools/perf/benchmarks/gpu_times.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/web_perf/metrics/gpu_timeline.py
diff --git a/tools/telemetry/telemetry/web_perf/metrics/gpu_timeline.py b/tools/telemetry/telemetry/web_perf/metrics/gpu_timeline.py
index 3b01110298fd8dc998fd92db4efdd733374a1353..acc4b8d4f657dbad07ba1066b2254e69b38312da 100644
--- a/tools/telemetry/telemetry/web_perf/metrics/gpu_timeline.py
+++ b/tools/telemetry/telemetry/web_perf/metrics/gpu_timeline.py
@@ -22,6 +22,16 @@ TRACKED_GL_CONTEXT_NAME = { 'RenderCompositor': 'render_compositor',
'Compositor': 'browser_compositor' }
+class GPUTimelineListOfValues(list_of_scalar_values.ListOfScalarValues):
+ def __init__(self, page, name, values):
+ super(GPUTimelineListOfValues, self).__init__(page, name, 'ms', values)
+
+
+class GPUTimelineValue(scalar.ScalarValue):
+ def __init__(self, page, name, value):
+ super(GPUTimelineValue, self).__init__(page, name, 'ms', value)
+
+
def _CalculateFrameTimes(events_per_frame, event_data_func):
"""Given a list of events per frame and a function to extract event time data,
returns a list of frame times."""
@@ -88,18 +98,19 @@ class GPUTimelineMetric(timeline_based_metric.TimelineBasedMetric):
frame_times_name = '%s_frame_times' % (name)
if durations:
- results.AddValue(list_of_scalar_values.ListOfScalarValues(
- results.current_page, frame_times_name, 'ms', durations))
-
- results.AddValue(scalar.ScalarValue(results.current_page,
- TimelineName(name, src, 'max'),
- 'ms', maximum))
- results.AddValue(scalar.ScalarValue(results.current_page,
- TimelineName(name, src, 'mean'),
- 'ms', avg))
- results.AddValue(scalar.ScalarValue(results.current_page,
- TimelineName(name, src, 'stddev'),
- 'ms', stddev))
+ results.AddValue(GPUTimelineListOfValues(results.current_page,
+ frame_times_name,
+ durations))
+
+ results.AddValue(GPUTimelineValue(results.current_page,
+ TimelineName(name, src, 'max'),
+ maximum))
+ results.AddValue(GPUTimelineValue(results.current_page,
+ TimelineName(name, src, 'mean'),
+ avg))
+ results.AddValue(GPUTimelineValue(results.current_page,
+ TimelineName(name, src, 'stddev'),
+ stddev))
def _CalculateGPUTimelineData(self, model):
"""Uses the model and calculates the times for various values for each
« no previous file with comments | « tools/perf/benchmarks/gpu_times.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698