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

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: use 95 percentil for input latency metric 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
Index: tools/perf/metrics/smoothness.py
diff --git a/tools/perf/metrics/smoothness.py b/tools/perf/metrics/smoothness.py
index 6d304097223287dcf789eaa53e36b663db0aa79f..9c1b47365dc20d3c7d222dfbb93764567c51cf22 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',
nduca 2014/01/23 18:34:45 why report mean and 95%ile? can you do an experim
Yufeng Shen (Slow to review) 2014/01/30 01:16:05 So I only keep the mean value in the new patch. I
+ round(mean_mouse_wheel_latency, 3))
+ results.Add('mouse_wheel_latency_95%', 'ms',
+ statistics.Percentile(self._stats.mouse_wheel_latency, 95.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_95%', 'ms',
+ statistics.Percentile(self._stats.gesture_scroll_latency,
+ 95.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_95%', 'ms',
+ statistics.Percentile(self._stats.touch_scroll_latency,
+ 95.0))
# List of raw frame times.
results.Add('frame_times', 'ms', self._stats.frame_times)

Powered by Google App Engine
This is Rietveld 408576698