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

Unified Diff: tools/perf/metrics/smoothness.py

Issue 132433004: Collecting LatencyInfo in telemetry (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: unittest added Created 6 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/metrics/rendering_stats_unittest.py ('k') | tools/telemetry/telemetry/core/timeline/model.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/smoothness.py
diff --git a/tools/perf/metrics/smoothness.py b/tools/perf/metrics/smoothness.py
index 6d304097223287dcf789eaa53e36b663db0aa79f..47dc5e21df3d06f7f791729f21959ee6f0b6dce0 100644
--- a/tools/perf/metrics/smoothness.py
+++ b/tools/perf/metrics/smoothness.py
@@ -64,8 +64,10 @@ class SmoothnessMetric(Metric):
for action in self._actions ]
renderer_process = timeline_model.GetRendererProcessFromTab(tab)
+ browser_main_thread = timeline_model.GetBrowserMainThread()
+
self._stats = rendering_stats.RenderingStats(
- renderer_process, timeline_ranges)
+ renderer_process, browser_main_thread, timeline_ranges)
if not self._stats.frame_times:
raise NotEnoughFramesError()
@@ -77,6 +79,33 @@ class SmoothnessMetric(Metric):
self._stats = stats
def AddResults(self, tab, results):
+ if self._stats.mouse_wheel_latency:
+ mean_mouse_wheel_latency = statistics.ArithmeticMean(
+ self._stats.mouse_wheel_latency, len(self._stats.mouse_wheel_latency))
+ results.Add('mean_mouse_wheel_latency', 'ms',
+ round(mean_mouse_wheel_latency, 3))
+ results.Add('mouse_wheel_latency_75%', 'ms',
+ statistics.Percentile(self._stats.mouse_wheel_latency, 75.0) )
+
+ if self._stats.gesture_scroll_latency:
+ mean_gesture_scroll_latency = statistics.ArithmeticMean(
+ self._stats.gesture_scroll_latency,
+ len(self._stats.gesture_scroll_latency))
+ results.Add('mean_gesture_scroll_latency', 'ms',
+ round(mean_gesture_scroll_latency, 3))
+ results.Add('gesture_scroll_latency_75%', 'ms',
Rick Byers 2014/01/21 13:57:17 Has there been any discussion of what the right me
Yufeng Shen (Slow to review) 2014/01/22 23:23:35 Done.
Rick Byers 2014/01/23 00:57:05 Thanks. How consistent does this tend to be from
+ statistics.Percentile(self._stats.gesture_scroll_latency,
+ 75.0) )
+
+ if self._stats.touch_scroll_latency:
+ mean_touch_scroll_latency = statistics.ArithmeticMean(
+ self._stats.touch_scroll_latency,
+ len(self._stats.touch_scroll_latency))
+ results.Add('mean_touch_scroll_latency', 'ms',
+ round(mean_touch_scroll_latency, 3))
+ results.Add('touch_scroll_latency_75%', 'ms',
+ statistics.Percentile(self._stats.touch_scroll_latency,
+ 75.0) )
# List of raw frame times.
results.Add('frame_times', 'ms', self._stats.frame_times)
« no previous file with comments | « tools/perf/metrics/rendering_stats_unittest.py ('k') | tools/telemetry/telemetry/core/timeline/model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698