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

Side by Side Diff: tools/perf/metrics/smoothness.py

Issue 26031002: cc: Remove unused metrics from RenderingStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed raster_worker_pool_perftest.cc Created 7 years, 2 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 unified diff | Download patch
« no previous file with comments | « tools/perf/metrics/rendering_stats.py ('k') | tools/perf/metrics/smoothness_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 6
7 from metrics import statistics 7 from metrics import statistics
8 from telemetry.core import util 8 from telemetry.core import util
9 from telemetry.page import page_measurement 9 from telemetry.page import page_measurement
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 'window.chrome.loadTimes().firstPaintTime - ' + 88 'window.chrome.loadTimes().firstPaintTime - ' +
89 'window.chrome.loadTimes().startLoadTime') 89 'window.chrome.loadTimes().startLoadTime')
90 90
91 results.Add('first_paint', 'ms', round(first_paint_secs * 1000, 1)) 91 results.Add('first_paint', 'ms', round(first_paint_secs * 1000, 1))
92 92
93 93
94 def CalcResults(benchmark_stats, results): 94 def CalcResults(benchmark_stats, results):
95 s = benchmark_stats 95 s = benchmark_stats
96 96
97 frame_times = [] 97 frame_times = []
98 for i in xrange(1, len(s.screen_frame_timestamps)): 98 for i in xrange(1, len(s.frame_timestamps)):
99 frame_times.append( 99 frame_times.append(
100 round(s.screen_frame_timestamps[i] - s.screen_frame_timestamps[i-1], 2)) 100 round(s.frame_timestamps[i] - s.frame_timestamps[i-1], 2))
101 101
102 # List of raw frame times. 102 # List of raw frame times.
103 results.Add('frame_times', 'ms', frame_times) 103 results.Add('frame_times', 'ms', frame_times)
104 104
105 # Arithmetic mean of frame times.
105 mean_frame_time_ms = 1000 * statistics.ArithmeticMean( 106 mean_frame_time_ms = 1000 * statistics.ArithmeticMean(
106 s.total_time, s.screen_frame_count) 107 s.total_time, len(s.frame_timestamps))
107 # Arithmetic mean of frame times. Not the generalized mean.
108 results.Add('mean_frame_time', 'ms', round(mean_frame_time_ms, 3)) 108 results.Add('mean_frame_time', 'ms', round(mean_frame_time_ms, 3))
109 109
110 # Absolute discrepancy of frame time stamps. 110 # Absolute discrepancy of frame time stamps.
111 jank = statistics.FrameDiscrepancy(s.screen_frame_timestamps) 111 jank = statistics.FrameDiscrepancy(s.frame_timestamps)
112 results.Add('jank', '', round(jank, 4)) 112 results.Add('jank', '', round(jank, 4))
113 113
114 # Are we hitting 60 fps for 95 percent of all frames? (Boolean value) 114 # Are we hitting 60 fps for 95 percent of all frames? (Boolean value)
115 # We use 17ms as a slightly looser threshold, instead of 1000.0/60.0. 115 # We use 17ms as a slightly looser threshold, instead of 1000.0/60.0.
116 results.Add('mostly_smooth', '', 116 results.Add('mostly_smooth', '',
117 statistics.Percentile(frame_times, 95.0) < 17.0) 117 statistics.Percentile(frame_times, 95.0) < 17.0)
118 118
119 119
120 class MissingTimelineMarker(page_measurement.MeasurementFailure): 120 class MissingTimelineMarker(page_measurement.MeasurementFailure):
121 def __init__(self, name): 121 def __init__(self, name):
122 super(MissingTimelineMarker, self).__init__( 122 super(MissingTimelineMarker, self).__init__(
123 'Timeline marker not found: ' + name) 123 'Timeline marker not found: ' + name)
124 124
125 125
126 def FindTimelineMarker(timeline, name): 126 def FindTimelineMarker(timeline, name):
127 """Find the timeline event with the given name. 127 """Find the timeline event with the given name.
128 128
129 If there is not exactly one such timeline event, raise an error. 129 If there is not exactly one such timeline event, raise an error.
130 """ 130 """
131 events = [s for s in timeline.GetAllEventsOfName(name) 131 events = [s for s in timeline.GetAllEventsOfName(name)
132 if s.parent_slice == None] 132 if s.parent_slice == None]
133 if len(events) != 1: 133 if len(events) != 1:
134 raise MissingTimelineMarker(name) 134 raise MissingTimelineMarker(name)
135 return events[0] 135 return events[0]
136
OLDNEW
« no previous file with comments | « tools/perf/metrics/rendering_stats.py ('k') | tools/perf/metrics/smoothness_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698