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

Side by Side Diff: tools/perf/metrics/speedindex.py

Issue 1029263003: [telemetry] Sort imports in Telemetry and its dependents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure we're up to date. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « tools/perf/metrics/power.py ('k') | tools/perf/metrics/speedindex_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 import logging 6 import logging
7 7
8 from metrics import Metric
9 from telemetry.image_processing import image_util 8 from telemetry.image_processing import image_util
10 from telemetry.image_processing import rgba_color 9 from telemetry.image_processing import rgba_color
11 from telemetry.value import scalar 10 from telemetry.value import scalar
12 11
12 from metrics import Metric
13
13 14
14 class SpeedIndexMetric(Metric): 15 class SpeedIndexMetric(Metric):
15 """The speed index metric is one way of measuring page load speed. 16 """The speed index metric is one way of measuring page load speed.
16 17
17 It is meant to approximate user perception of page load speed, and it 18 It is meant to approximate user perception of page load speed, and it
18 is based on the amount of time that it takes to paint to the visual 19 is based on the amount of time that it takes to paint to the visual
19 portion of the screen. It includes paint events that occur after the 20 portion of the screen. It includes paint events that occur after the
20 onload event, and it doesn't include time loading things off-screen. 21 onload event, and it doesn't include time loading things off-screen.
21 22
22 This speed index metric is based on WebPageTest.org (WPT). 23 This speed index metric is based on WebPageTest.org (WPT).
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 else: 182 else:
182 return 0.0 183 return 0.0
183 return 1 - histogram.Distance(final_histogram) / total_distance 184 return 1 - histogram.Distance(final_histogram) / total_distance
184 185
185 self._time_completeness_list = [(time, FrameProgress(hist)) 186 self._time_completeness_list = [(time, FrameProgress(hist))
186 for time, hist in histograms] 187 for time, hist in histograms]
187 188
188 def GetTimeCompletenessList(self, tab): 189 def GetTimeCompletenessList(self, tab):
189 assert self._time_completeness_list, 'Must call Stop() first.' 190 assert self._time_completeness_list, 'Must call Stop() first.'
190 return self._time_completeness_list 191 return self._time_completeness_list
OLDNEW
« no previous file with comments | « tools/perf/metrics/power.py ('k') | tools/perf/metrics/speedindex_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698