OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 logging | 5 import logging |
6 import time | 6 import time |
7 | 7 |
8 from common import chrome_proxy_metrics | 8 from common import chrome_proxy_metrics |
9 from common import network_metrics | 9 from common import network_metrics |
10 from common.chrome_proxy_metrics import ChromeProxyMetricException | 10 from common.chrome_proxy_metrics import ChromeProxyMetricException |
11 from telemetry.page import page_test | 11 from telemetry.page import legacy_page_test |
12 from telemetry.value import scalar | 12 from telemetry.value import scalar |
13 | 13 |
14 | 14 |
15 class ChromeProxyMetric(network_metrics.NetworkMetric): | 15 class ChromeProxyMetric(network_metrics.NetworkMetric): |
16 """A Chrome proxy timeline metric.""" | 16 """A Chrome proxy timeline metric.""" |
17 | 17 |
18 def __init__(self): | 18 def __init__(self): |
19 super(ChromeProxyMetric, self).__init__() | 19 super(ChromeProxyMetric, self).__init__() |
20 self.compute_data_saving = True | 20 self.compute_data_saving = True |
21 | 21 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 request_duration = (float(response_start) - request_start) | 128 request_duration = (float(response_start) - request_start) |
129 results.AddValue(scalar.ScalarValue( | 129 results.AddValue(scalar.ScalarValue( |
130 results.current_page, 'request_duration', 'ms', request_duration, | 130 results.current_page, 'request_duration', 'ms', request_duration, |
131 important=False)) | 131 important=False)) |
132 | 132 |
133 response_duration = (float(response_end) - response_start) | 133 response_duration = (float(response_end) - response_start) |
134 results.AddValue(scalar.ScalarValue( | 134 results.AddValue(scalar.ScalarValue( |
135 results.current_page, 'response_duration', 'ms', response_duration, | 135 results.current_page, 'response_duration', 'ms', response_duration, |
136 important=False)) | 136 important=False)) |
OLD | NEW |