diff options
author | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-19 18:24:49 +0000 |
---|---|---|
committer | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-19 18:24:49 +0000 |
commit | abd613aa8e245547b52349a758eb6d05793083c4 (patch) | |
tree | 755987582f5c7f20a154dc3f1ee888fd7c6aaece /tools | |
parent | 71b03cd55275571887cb87e7a766ad9b9b199d28 (diff) | |
download | chromium_src-abd613aa8e245547b52349a758eb6d05793083c4.zip chromium_src-abd613aa8e245547b52349a758eb6d05793083c4.tar.gz chromium_src-abd613aa8e245547b52349a758eb6d05793083c4.tar.bz2 |
Add a simple NavigateMeasurement to measure time taken in navigate_steps
This is useful for pages (such as chromestatus.com) where the 'load' event
is not a good signal for 'page ready', but where there's some other condition,
easily expressible in navigate_steps, of that readiness.
R=dtu@chromium.org
Review URL: https://codereview.chromium.org/108303010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/measurements/navigate.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/perf/measurements/navigate.py b/tools/perf/measurements/navigate.py new file mode 100644 index 0000000..7335510 --- /dev/null +++ b/tools/perf/measurements/navigate.py @@ -0,0 +1,23 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from telemetry.page import page_measurement + +class NavigateMeasurement(page_measurement.PageMeasurement): + """ Measures time between navigation start and the end of the navigate_steps + + For pages where the 'load' event isn't a good measurement point, this + measurement allows a page_set to have its loading sequence listed by + way of navigate_steps, with a navigation_time result measured + by performance.now(). + """ + def __init__(self): + super(NavigateMeasurement, self).__init__() + self._navigate_time = None + + def DidNavigateToPage(self, page, tab): + self._navigate_time = int(tab.EvaluateJavaScript('performance.now()')) + + def MeasurePage(self, page, tab, results): + results.Add('navigate_time', 'ms', self._navigate_time) |