| 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 sys | 5 import sys |
| 6 | 6 |
| 7 from metrics import histogram_util | 7 from metrics import histogram_util |
| 8 from metrics import Metric | 8 from metrics import Metric |
| 9 from telemetry.value import histogram | 9 from telemetry.value import histogram |
| 10 from telemetry.value import scalar | 10 from telemetry.value import scalar |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 'count', self._memory_stats['ProcessCount'], important=False, | 141 'count', self._memory_stats['ProcessCount'], important=False, |
| 142 description='Number of processes used by Chrome.')) | 142 description='Number of processes used by Chrome.')) |
| 143 | 143 |
| 144 | 144 |
| 145 def AddResultsForProcesses(results, memory_stats, chart_trace_name='final', | 145 def AddResultsForProcesses(results, memory_stats, chart_trace_name='final', |
| 146 metric_trace_name=None, | 146 metric_trace_name=None, |
| 147 exclude_metrics=None): | 147 exclude_metrics=None): |
| 148 """Adds memory stats for browser, renderer and gpu processes. | 148 """Adds memory stats for browser, renderer and gpu processes. |
| 149 | 149 |
| 150 Args: | 150 Args: |
| 151 results: A PageMeasurement results object. | 151 results: A telemetry.results.PageTestResults object. |
| 152 memory_stats: System memory stats collected. | 152 memory_stats: System memory stats collected. |
| 153 chart_trace_name: Trace to identify memory metrics. Default is 'final'. | 153 chart_trace_name: Trace to identify memory metrics. Default is 'final'. |
| 154 metric_trace_name: Trace to identify the metric results per test page. | 154 metric_trace_name: Trace to identify the metric results per test page. |
| 155 exclude_metrics: List of memory metrics to exclude from results, | 155 exclude_metrics: List of memory metrics to exclude from results, |
| 156 e.g. VM, WorkingSetSize, etc. | 156 e.g. VM, WorkingSetSize, etc. |
| 157 """ | 157 """ |
| 158 metric = 'resident_set_size' | 158 metric = 'resident_set_size' |
| 159 if sys.platform == 'win32': | 159 if sys.platform == 'win32': |
| 160 metric = 'working_set' | 160 metric = 'working_set' |
| 161 | 161 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 AddResult('VMPeak', 'vm_peak_size', | 223 AddResult('VMPeak', 'vm_peak_size', |
| 224 'The peak Virtual Memory Size (address space allocated) usage ' | 224 'The peak Virtual Memory Size (address space allocated) usage ' |
| 225 'achieved by the * process.') | 225 'achieved by the * process.') |
| 226 AddResult('WorkingSetSizePeak', '%s_peak_size' % metric, | 226 AddResult('WorkingSetSizePeak', '%s_peak_size' % metric, |
| 227 'Peak Working Set Size.') | 227 'Peak Working Set Size.') |
| 228 | 228 |
| 229 AddResultsForProcessTypes(['Browser'], 'browser') | 229 AddResultsForProcessTypes(['Browser'], 'browser') |
| 230 AddResultsForProcessTypes(['Renderer'], 'renderer') | 230 AddResultsForProcessTypes(['Renderer'], 'renderer') |
| 231 AddResultsForProcessTypes(['Gpu'], 'gpu') | 231 AddResultsForProcessTypes(['Gpu'], 'gpu') |
| 232 AddResultsForProcessTypes(['Browser', 'Renderer', 'Gpu'], 'total') | 232 AddResultsForProcessTypes(['Browser', 'Renderer', 'Gpu'], 'total') |
| OLD | NEW |