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 timeline_based_metric | 5 from metrics import timeline_based_metric |
6 from metrics import rendering_stats | 6 from metrics import rendering_stats |
7 from telemetry.page.perf_tests_helper import FlattenList | 7 from telemetry.page.perf_tests_helper import FlattenList |
8 from telemetry.util import statistics | 8 from telemetry.util import statistics |
9 | 9 |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 # Absolute discrepancy of frame time stamps. | 58 # Absolute discrepancy of frame time stamps. |
59 frame_discrepancy = statistics.TimestampsDiscrepancy( | 59 frame_discrepancy = statistics.TimestampsDiscrepancy( |
60 stats.frame_timestamps) | 60 stats.frame_timestamps) |
61 results.Add('jank', 'ms', round(frame_discrepancy, 4)) | 61 results.Add('jank', 'ms', round(frame_discrepancy, 4)) |
62 | 62 |
63 # Are we hitting 60 fps for 95 percent of all frames? | 63 # Are we hitting 60 fps for 95 percent of all frames? |
64 # We use 19ms as a somewhat looser threshold, instead of 1000.0/60.0. | 64 # We use 19ms as a somewhat looser threshold, instead of 1000.0/60.0. |
65 percentile_95 = statistics.Percentile(frame_times, 95.0) | 65 percentile_95 = statistics.Percentile(frame_times, 95.0) |
66 results.Add('mostly_smooth', 'score', 1.0 if percentile_95 < 19.0 else 0.0) | 66 results.Add('mostly_smooth', 'score', 1.0 if percentile_95 < 19.0 else 0.0) |
| 67 |
| 68 # Mean percentage of pixels approximated (missing tiles, low resolution |
| 69 # tiles, non-ideal resolution tiles) |
| 70 results.Add('mean_pixels_approximated', 'percent', |
| 71 round(statistics.ArithmeticMean( |
| 72 FlattenList(stats.approximated_pixel_percentages)), 3)) |
OLD | NEW |