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 from metrics import Metric | 5 from metrics import Metric |
| 6 from metrics import rendering_stats | 6 from metrics import rendering_stats |
| 7 from metrics import statistics | 7 from metrics import statistics |
| 8 from telemetry.page import page_measurement | 8 from telemetry.page import page_measurement |
| 9 | 9 |
| 10 TIMELINE_MARKER = 'Smoothness' | 10 TIMELINE_MARKER = 'Smoothness' |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 len(self._stats.frame_times)) | 72 len(self._stats.frame_times)) |
| 73 results.Add('mean_frame_time', 'ms', round(mean_frame_time, 3)) | 73 results.Add('mean_frame_time', 'ms', round(mean_frame_time, 3)) |
| 74 | 74 |
| 75 # Absolute discrepancy of frame time stamps. | 75 # Absolute discrepancy of frame time stamps. |
| 76 jank = statistics.FrameDiscrepancy(self._stats.frame_timestamps) | 76 jank = statistics.FrameDiscrepancy(self._stats.frame_timestamps) |
| 77 results.Add('jank', '', round(jank, 4)) | 77 results.Add('jank', '', round(jank, 4)) |
| 78 | 78 |
| 79 # Are we hitting 60 fps for 95 percent of all frames? | 79 # Are we hitting 60 fps for 95 percent of all frames? |
| 80 # We use 19ms as a somewhat looser threshold, instead of 1000.0/60.0. | 80 # We use 19ms as a somewhat looser threshold, instead of 1000.0/60.0. |
| 81 percentile_95 = statistics.Percentile(self._stats.frame_times, 95.0) | 81 percentile_95 = statistics.Percentile(self._stats.frame_times, 95.0) |
| 82 results.Add('mostly_smooth', '', 1.0 if percentile_95 < 19.0 else 0.0) | 82 results.Add('mostly_smooth', 'score', 1.0 if percentile_95 < 19.0 else 0.0) |
|
fmeawad
2014/01/03 19:39:47
Would '%' also work? is it a percentile?
ernstm
2014/01/04 01:08:47
It is a binary value (0 or 1), so score seemed the
| |
| 83 | 83 |
| 84 if tab.browser.platform.IsRawDisplayFrameRateSupported(): | 84 if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
| 85 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): | 85 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): |
| 86 if r.value is None: | 86 if r.value is None: |
| 87 raise MissingDisplayFrameRateError(r.name) | 87 raise MissingDisplayFrameRateError(r.name) |
| 88 results.Add(r.name, r.unit, r.value) | 88 results.Add(r.name, r.unit, r.value) |
| OLD | NEW |