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 sys | 5 import sys |
6 | 6 |
7 from metrics import Metric | 7 from metrics import Metric |
8 from telemetry.value import scalar | 8 from telemetry.value import scalar |
9 | 9 |
10 | 10 |
11 class IOMetric(Metric): | 11 class IOMetric(Metric): |
12 """IO-related metrics, obtained via telemetry.core.Browser.""" | 12 """IO-related metrics, obtained via telemetry.core.Browser.""" |
13 | 13 |
14 @classmethod | 14 @classmethod |
15 def CustomizeBrowserOptions(cls, options): | 15 def CustomizeBrowserOptions(cls, options): |
16 # TODO(tonyg): This is the host platform, so not totally correct. | 16 # TODO(tonyg): This is the host platform, so not totally correct. |
17 if sys.platform != 'darwin': | 17 if sys.platform not in ('darwin', 'win32'): |
18 # TODO(playmobil): Get rid of this on all platforms crbug.com/361049. | 18 # TODO(playmobil): Get rid of this on all platforms crbug.com/361049. |
19 options.AppendExtraBrowserArgs('--no-sandbox') | 19 options.AppendExtraBrowserArgs('--no-sandbox') |
20 | 20 |
21 def Start(self, page, tab): | 21 def Start(self, page, tab): |
22 raise NotImplementedError() | 22 raise NotImplementedError() |
23 | 23 |
24 def Stop(self, page, tab): | 24 def Stop(self, page, tab): |
25 raise NotImplementedError() | 25 raise NotImplementedError() |
26 | 26 |
27 def AddResults(self, tab, results): | 27 def AddResults(self, tab, results): |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 AddSummaryForOperation('WriteOperationCount', 'write_operations_', | 64 AddSummaryForOperation('WriteOperationCount', 'write_operations_', |
65 'count', 'Number of IO write operations.') | 65 'count', 'Number of IO write operations.') |
66 AddSummaryForOperation('ReadTransferCount', 'read_bytes_', 'kb', | 66 AddSummaryForOperation('ReadTransferCount', 'read_bytes_', 'kb', |
67 'Number of IO bytes read.') | 67 'Number of IO bytes read.') |
68 AddSummaryForOperation('WriteTransferCount', 'write_bytes_', 'kb', | 68 AddSummaryForOperation('WriteTransferCount', 'write_bytes_', 'kb', |
69 'Number of IO bytes written.') | 69 'Number of IO bytes written.') |
70 | 70 |
71 AddSummariesForProcessType('Browser', 'browser') | 71 AddSummariesForProcessType('Browser', 'browser') |
72 AddSummariesForProcessType('Renderer', 'renderer') | 72 AddSummariesForProcessType('Renderer', 'renderer') |
73 AddSummariesForProcessType('Gpu', 'gpu') | 73 AddSummariesForProcessType('Gpu', 'gpu') |
OLD | NEW |