OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 collections import defaultdict | 5 from collections import defaultdict |
6 | 6 |
7 from telemetry.value import failure | 7 from telemetry.value import failure |
8 from telemetry.value import merge_values | 8 from telemetry.value import merge_values |
9 from telemetry.value import skip | 9 from telemetry.value import skip |
10 | 10 |
| 11 |
11 class Summary(object): | 12 class Summary(object): |
12 """Computes summary values from the per-page-run values produced by a test. | 13 """Computes summary values from the per-page-run values produced by a test. |
13 | 14 |
14 Some telemetry benchmark repeat a number of times in order to get a reliable | 15 Some telemetry benchmark repeat a number of times in order to get a reliable |
15 measurement. The test does not have to handle merging of these runs: | 16 measurement. The test does not have to handle merging of these runs: |
16 summarizer does it for you. | 17 summarizer does it for you. |
17 | 18 |
18 For instance, if two pages run, 3 and 1 time respectively: | 19 For instance, if two pages run, 3 and 1 time respectively: |
19 ScalarValue(page1, 'foo', units='ms', 1) | 20 ScalarValue(page1, 'foo', units='ms', 1) |
20 ScalarValue(page1, 'foo', units='ms', 1) | 21 ScalarValue(page1, 'foo', units='ms', 1) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 should_print = True | 152 should_print = True |
152 else: | 153 else: |
153 should_print = False | 154 should_print = False |
154 | 155 |
155 if not should_print: | 156 if not should_print: |
156 return | 157 return |
157 | 158 |
158 # Actually save the result. | 159 # Actually save the result. |
159 self._computed_per_page_values.append(value) | 160 self._computed_per_page_values.append(value) |
160 self._interleaved_computed_per_page_values_and_summaries.append(value) | 161 self._interleaved_computed_per_page_values_and_summaries.append(value) |
OLD | NEW |