Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 6 |
| 7 from metrics import Metric | 7 from metrics import Metric |
| 8 from telemetry.core import bitmap | 8 from telemetry.core import bitmap |
| 9 from telemetry.value import scalar | 9 from telemetry.value import scalar |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 self._impl.Stop(tab) | 46 self._impl.Stop(tab) |
| 47 | 47 |
| 48 # Optional argument chart_name is not in base class Metric. | 48 # Optional argument chart_name is not in base class Metric. |
| 49 # pylint: disable=W0221 | 49 # pylint: disable=W0221 |
| 50 def AddResults(self, tab, results, chart_name=None): | 50 def AddResults(self, tab, results, chart_name=None): |
| 51 """Calculate the speed index and add it to the results.""" | 51 """Calculate the speed index and add it to the results.""" |
| 52 index = self._impl.CalculateSpeedIndex(tab) | 52 index = self._impl.CalculateSpeedIndex(tab) |
| 53 # Release the tab so that it can be disconnected. | 53 # Release the tab so that it can be disconnected. |
| 54 self._impl = None | 54 self._impl = None |
| 55 results.AddValue(scalar.ScalarValue( | 55 results.AddValue(scalar.ScalarValue( |
| 56 results.current_page, '%s.speed_index' % chart_name, 'ms', index)) | 56 results.current_page, '%s_speed_index' % chart_name, 'ms', index, |
|
qyearsley
2014/10/23 17:01:39
This change from %s.speed_index to %s_speed_index
shimazu
2014/10/27 02:33:12
Yes, I saw the result of run_benchmark as 'yourCha
| |
| 57 description='Speed Index. This focuses on a time when visible parts of ' | |
|
qyearsley
2014/10/23 17:01:39
a time -> time
shimazu
2014/10/27 02:33:12
Done.
| |
| 58 'page are displayed, and this shows the time when the ' | |
| 59 'first look is "almost" composed. If you want to get more ' | |
|
qyearsley
2014/10/23 17:01:39
I'm not sure if this description is accurate. Spee
shimazu
2014/10/27 02:33:11
I tried to add such explanation. I'm not sure how
qyearsley
2014/10/27 02:55:46
I personally think it might be a bit redundant, be
| |
| 60 'detail, please refer to http://goo.gl/Rw3d5d . Currently ' | |
|
qyearsley
2014/10/23 17:01:39
No need for the space between the URL and the dot.
shimazu
2014/10/27 02:33:12
Done.
| |
| 61 'there are two implementation: for Android and for ' | |
|
qyearsley
2014/10/23 17:01:39
implementation -> implementations
shimazu
2014/10/27 02:33:11
Done.
| |
| 62 'Desktop. Android version (using video capture) is good ' | |
| 63 'index to show the advantage of your patch, but Desktop ' | |
| 64 'one (using paint events) is not because of extra overhead ' | |
| 65 'to catch paint events.')) | |
|
qyearsley
2014/10/23 17:01:39
I wouldn't say the desktop version is "not good",
shimazu
2014/10/27 02:33:12
Done.
| |
| 57 | 66 |
| 58 def IsFinished(self, tab): | 67 def IsFinished(self, tab): |
| 59 """Decide whether the timeline recording should be stopped. | 68 """Decide whether the timeline recording should be stopped. |
| 60 | 69 |
| 61 When the timeline recording is stopped determines which paint events | 70 When the timeline recording is stopped determines which paint events |
| 62 are used in the speed index metric calculation. In general, the recording | 71 are used in the speed index metric calculation. In general, the recording |
| 63 should continue if there has just been some data received, because | 72 should continue if there has just been some data received, because |
| 64 this suggests that painting may continue. | 73 this suggests that painting may continue. |
| 65 | 74 |
| 66 A page may repeatedly request resources in an infinite loop; a timeout | 75 A page may repeatedly request resources in an infinite loop; a timeout |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 frame = paint_event.args['frameId'] | 307 frame = paint_event.args['frameId'] |
| 299 return (frame,) + GetBox(paint_event.args['data']['clip']) | 308 return (frame,) + GetBox(paint_event.args['data']['clip']) |
| 300 | 309 |
| 301 def _GroupEventByRectangle(self, paint_events): | 310 def _GroupEventByRectangle(self, paint_events): |
| 302 """Group all paint events according to the rectangle that they update.""" | 311 """Group all paint events according to the rectangle that they update.""" |
| 303 result = collections.defaultdict(list) | 312 result = collections.defaultdict(list) |
| 304 for event in paint_events: | 313 for event in paint_events: |
| 305 assert event.name == 'Paint' | 314 assert event.name == 'Paint' |
| 306 result[self._GetRectangle(event)].append(event) | 315 result[self._GetRectangle(event)].append(event) |
| 307 return result | 316 return result |
| OLD | NEW |