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

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

Issue 255603003: telemtry: better error message for not enought frames cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « no previous file | tools/perf/metrics/rendering_stats_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/rendering_stats.py
diff --git a/tools/perf/metrics/rendering_stats.py b/tools/perf/metrics/rendering_stats.py
index ba987327ef79e17dddb550aa0bc82648ac88ac88..ba295c5707e076d316232eab8fa95261813ad81f 100644
--- a/tools/perf/metrics/rendering_stats.py
+++ b/tools/perf/metrics/rendering_stats.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
from operator import attrgetter
+from telemetry.page import page_measurement
# These are LatencyInfo component names indicating the various components
# that the input event has travelled through.
@@ -16,6 +17,19 @@ BEGIN_COMP_NAME = 'INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT'
END_COMP_NAME = 'INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT'
+class NotEnoughFramesError(page_measurement.MeasurementFailure):
+ def __init__(self, frame_count):
+ super(NotEnoughFramesError, self).__init__(
+ 'Only %i frame timestamps were collected ' % frame_count +
+ '(at least two are required).\n'
+ 'Issues that have caused this in the past:\n' +
+ '- Browser bugs that prevents the page from redrawing\n' +
+ '- Bugs in the synthetic gesture code\n' +
+ '- Page and benchmark out of sync (e.g. clicked element was renamed)\n' +
+ '- Pages that render extremely slow\n' +
+ '- Pages that can\'t be scrolled')
+
+
def GetScrollInputLatencyEvents(scroll_type, browser_process, timeline_range):
"""Get scroll events' LatencyInfo from the browser process's trace buffer
that are within the timeline_range.
@@ -160,6 +174,12 @@ class RenderingStats(object):
self.initImplThreadStatsFromTimeline(timeline_range)
self.initScrollLatencyStatsFromTimeline(browser_process, timeline_range)
+ # Check if we have collected at least 2 frames in every range. Otherwise we
+ # can't compute any meaningful metrics.
+ for segment in self.frame_timestamps:
+ if len(segment) < 2:
+ raise NotEnoughFramesError(len(segment))
+
def initScrollLatencyStatsFromTimeline(self, browser_process, timeline_range):
mouse_wheel_events = GetScrollInputLatencyEvents(
"MouseWheel", browser_process, timeline_range)
« no previous file with comments | « no previous file | tools/perf/metrics/rendering_stats_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698