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

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: 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 2a5b96e2eccbaf961d8104bd564a7f2d2bbd88f3..5d2ac90345ea6d8a5309890ca53d03ff6c927037 100644
--- a/tools/perf/metrics/smoothness.py
+++ b/tools/perf/metrics/smoothness.py
@@ -50,9 +50,10 @@ class SmoothnessMetric(Metric):
timeline_ranges = [ action.GetActiveRangeOnTimeline(timeline_model)
for action in self._actions ]
+ browser_process = timeline_model.GetProcess(tab.browser.browser_pid)
renderer_process = timeline_model.GetRendererProcessFromTab(tab)
self._stats = rendering_stats.RenderingStats(
- renderer_process, timeline_ranges)
+ renderer_process, browser_process, timeline_ranges)
if not self._stats.frame_times:
raise NotEnoughFramesError()
@@ -64,6 +65,33 @@ class SmoothnessMetric(Metric):
self._stats = stats
def AddResults(self, tab, results):
nduca 2014/01/13 18:49:32 needs unit tests
Yufeng Shen (Slow to review) 2014/01/14 00:05:47 I assume the unittests for this is a test that sta
Yufeng Shen (Slow to review) 2014/01/20 21:59:30 Test added.
+ 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',
+ 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)

Powered by Google App Engine
This is Rietveld 408576698