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 import logging | 5 import logging |
6 import sys | 6 import sys |
7 | 7 |
8 from telemetry.value import histogram | 8 from telemetry.value import histogram |
9 from telemetry.value import histogram_util | 9 from telemetry.value import histogram_util |
10 from telemetry.value import scalar | 10 from telemetry.value import scalar |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 for h in _HISTOGRAMS: | 115 for h in _HISTOGRAMS: |
116 # Histogram data may not be available | 116 # Histogram data may not be available |
117 if h['name'] not in self._histogram_start: | 117 if h['name'] not in self._histogram_start: |
118 continue | 118 continue |
119 histogram_data = histogram_util.GetHistogram( | 119 histogram_data = histogram_util.GetHistogram( |
120 h['type'], h['name'], tab) | 120 h['type'], h['name'], tab) |
121 self._histogram_delta[h['name']] = histogram_util.SubtractHistogram( | 121 self._histogram_delta[h['name']] = histogram_util.SubtractHistogram( |
122 histogram_data, self._histogram_start[h['name']]) | 122 histogram_data, self._histogram_start[h['name']]) |
123 | 123 |
124 # Optional argument trace_name is not in base class Metric. | 124 # Optional argument trace_name is not in base class Metric. |
125 # pylint: disable=W0221 | 125 # pylint: disable=arguments-differ |
126 def AddResults(self, tab, results, trace_name=None): | 126 def AddResults(self, tab, results, trace_name=None): |
127 """Add results for this page to the results object.""" | 127 """Add results for this page to the results object.""" |
128 if not self._browser.supports_memory_metrics: | 128 if not self._browser.supports_memory_metrics: |
129 return | 129 return |
130 | 130 |
131 assert self._histogram_delta, 'Must call Stop() first' | 131 assert self._histogram_delta, 'Must call Stop() first' |
132 for h in _HISTOGRAMS: | 132 for h in _HISTOGRAMS: |
133 # Histogram data may not be available | 133 # Histogram data may not be available |
134 if h['name'] not in self._histogram_start: | 134 if h['name'] not in self._histogram_start: |
135 continue | 135 continue |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 AddResult('VMPeak', 'vm_peak_size', | 238 AddResult('VMPeak', 'vm_peak_size', |
239 'The peak Virtual Memory Size (address space allocated) usage ' | 239 'The peak Virtual Memory Size (address space allocated) usage ' |
240 'achieved by the * process.') | 240 'achieved by the * process.') |
241 AddResult('WorkingSetSizePeak', '%s_peak_size' % metric, | 241 AddResult('WorkingSetSizePeak', '%s_peak_size' % metric, |
242 'Peak Working Set Size.') | 242 'Peak Working Set Size.') |
243 | 243 |
244 AddResultsForProcessTypes(['Browser'], 'browser') | 244 AddResultsForProcessTypes(['Browser'], 'browser') |
245 AddResultsForProcessTypes(['Renderer'], 'renderer') | 245 AddResultsForProcessTypes(['Renderer'], 'renderer') |
246 AddResultsForProcessTypes(['Gpu'], 'gpu') | 246 AddResultsForProcessTypes(['Gpu'], 'gpu') |
247 AddResultsForProcessTypes(['Browser', 'Renderer', 'Gpu'], 'total') | 247 AddResultsForProcessTypes(['Browser', 'Renderer', 'Gpu'], 'total') |
OLD | NEW |