| 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 import json | 5 import json |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import time | 8 import time |
| 9 | 9 |
| 10 from common import chrome_proxy_metrics | 10 from common import chrome_proxy_metrics |
| 11 from common import network_metrics | 11 from common import network_metrics |
| 12 from common.chrome_proxy_metrics import ChromeProxyMetricException | 12 from common.chrome_proxy_metrics import ChromeProxyMetricException |
| 13 from telemetry.page import page_test | 13 from telemetry.page import legacy_page_test |
| 14 from telemetry.value import scalar | 14 from telemetry.value import scalar |
| 15 from telemetry.value import histogram_util | 15 from telemetry.value import histogram_util |
| 16 from metrics import Metric | 16 from metrics import Metric |
| 17 | 17 |
| 18 class ChromeProxyMetric(network_metrics.NetworkMetric): | 18 class ChromeProxyMetric(network_metrics.NetworkMetric): |
| 19 """A Chrome proxy timeline metric.""" | 19 """A Chrome proxy timeline metric.""" |
| 20 | 20 |
| 21 def __init__(self): | 21 def __init__(self): |
| 22 super(ChromeProxyMetric, self).__init__() | 22 super(ChromeProxyMetric, self).__init__() |
| 23 self.compute_data_saving = True | 23 self.compute_data_saving = True |
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 except KeyError: | 1085 except KeyError: |
| 1086 raise ChromeProxyMetricException, 'No metrics found' | 1086 raise ChromeProxyMetricException, 'No metrics found' |
| 1087 | 1087 |
| 1088 # Returns whether |url| is a block-once test URL. Data Reduction Proxy has been | 1088 # Returns whether |url| is a block-once test URL. Data Reduction Proxy has been |
| 1089 # configured to always return block-once for these URLs. | 1089 # configured to always return block-once for these URLs. |
| 1090 def IsTestUrlForBlockOnce(url): | 1090 def IsTestUrlForBlockOnce(url): |
| 1091 return (url == 'http://check.googlezip.net/blocksingle/' or | 1091 return (url == 'http://check.googlezip.net/blocksingle/' or |
| 1092 url == ('http://chromeproxy-test.appspot.com/default?respBody=T0s=' | 1092 url == ('http://chromeproxy-test.appspot.com/default?respBody=T0s=' |
| 1093 '&respHeader=eyJBY2Nlc3MtQ29udHJvbC1BbGxvdy1PcmlnaW4iOlsiKiJ' | 1093 '&respHeader=eyJBY2Nlc3MtQ29udHJvbC1BbGxvdy1PcmlnaW4iOlsiKiJ' |
| 1094 'dfQ==&respStatus=200&flywheelAction=block-once')) | 1094 'dfQ==&respStatus=200&flywheelAction=block-once')) |
| OLD | NEW |