Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 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 from metrics import memory | 5 from metrics import memory |
| 6 from metrics import power | 6 from metrics import power |
| 7 from telemetry.page import page_test | 7 from telemetry.page import page_test |
| 8 | 8 |
| 9 class Memory(page_test.PageTest): | 9 class Memory(page_test.PageTest): |
| 10 def __init__(self): | 10 def __init__(self): |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 # Since this is a memory benchmark, we want to sample memory histograms at | 27 # Since this is a memory benchmark, we want to sample memory histograms at |
| 28 # a high frequency. | 28 # a high frequency. |
| 29 options.AppendExtraBrowserArgs('--memory-metrics') | 29 options.AppendExtraBrowserArgs('--memory-metrics') |
| 30 | 30 |
| 31 def ValidateAndMeasurePage(self, page, tab, results): | 31 def ValidateAndMeasurePage(self, page, tab, results): |
| 32 self._power_metric.Stop(page, tab) | 32 self._power_metric.Stop(page, tab) |
| 33 self._memory_metric.Stop(page, tab) | 33 self._memory_metric.Stop(page, tab) |
| 34 self._memory_metric.AddResults(tab, results) | 34 self._memory_metric.AddResults(tab, results) |
| 35 self._power_metric.AddResults(tab, results) | 35 self._power_metric.AddResults(tab, results) |
| 36 | 36 |
| 37 if tab.browser.is_profiler_active('tcmalloc-heap'): | 37 if tab.browser.platform.profiling_controller.is_profiler_active( |
|
tonyg
2014/09/04 17:10:19
This also seems like the wrong place for this. The
nednguyen
2014/09/04 17:31:46
Yeah, we leak the profiler API through the handles
| |
| 38 'tcmalloc-heap'): | |
| 38 # The tcmalloc_heap_profiler dumps files at regular | 39 # The tcmalloc_heap_profiler dumps files at regular |
| 39 # intervals (~20 secs). | 40 # intervals (~20 secs). |
| 40 # This is a minor optimization to ensure it'll dump the last file when | 41 # This is a minor optimization to ensure it'll dump the last file when |
| 41 # the test completes. | 42 # the test completes. |
| 42 tab.ExecuteJavaScript(""" | 43 tab.ExecuteJavaScript(""" |
| 43 if (chrome && chrome.memoryBenchmarking) { | 44 if (chrome && chrome.memoryBenchmarking) { |
| 44 chrome.memoryBenchmarking.heapProfilerDump('renderer', 'final'); | 45 chrome.memoryBenchmarking.heapProfilerDump('renderer', 'final'); |
| 45 chrome.memoryBenchmarking.heapProfilerDump('browser', 'final'); | 46 chrome.memoryBenchmarking.heapProfilerDump('browser', 'final'); |
| 46 } | 47 } |
| 47 """) | 48 """) |
| OLD | NEW |