| Index: tools/perf/perf_tools/memory_benchmark.py
|
| diff --git a/tools/perf/perf_tools/memory_benchmark.py b/tools/perf/perf_tools/memory_benchmark.py
|
| index 0a1ebee832d01b59c42d54bc8b00cd54e5a49c83..27405734b3ba28f3a0526a2c1ab236139d32bf91 100644
|
| --- a/tools/perf/perf_tools/memory_benchmark.py
|
| +++ b/tools/perf/perf_tools/memory_benchmark.py
|
| @@ -9,6 +9,9 @@ MEMORY_HISTOGRAMS = [
|
| {'name': 'V8.MemoryHeapSampleTotalUsed', 'units': 'kb'},
|
| {'name': 'Memory.RendererUsed', 'units': 'kb'}]
|
|
|
| +BROWSER_MEMORY_HISTOGRAMS = [
|
| + {'name': 'Memory.BrowserUsed', 'units': 'kb'}]
|
| +
|
| class MemoryBenchmark(multi_page_benchmark.MultiPageBenchmark):
|
| def __init__(self):
|
| super(MemoryBenchmark, self).__init__('stress_memory')
|
| @@ -29,10 +32,17 @@ class MemoryBenchmark(multi_page_benchmark.MultiPageBenchmark):
|
|
|
| def MeasurePage(self, page, tab, results):
|
| for histogram in MEMORY_HISTOGRAMS:
|
| - name = histogram['name']
|
| - data = tab.EvaluateJavaScript(
|
| - 'window.domAutomationController.getHistogram ? '
|
| - 'window.domAutomationController.getHistogram("%s") : ""' % name)
|
| - if data:
|
| - results.Add(name.replace('.', '_'), histogram['units'], data,
|
| - data_type='histogram')
|
| + self._GetHistogramFromDomAutomation(tab, 'getHistogram', histogram,
|
| + results)
|
| + for histogram in BROWSER_MEMORY_HISTOGRAMS:
|
| + self._GetHistogramFromDomAutomation(tab, 'getBrowserHistogram', histogram,
|
| + results)
|
| +
|
| + def _GetHistogramFromDomAutomation(self, tab, func, histogram, results):
|
| + name = histogram['name']
|
| + js = ('window.domAutomationController.%s ? '
|
| + 'window.domAutomationController.%s("%s") : ""' % (func, func, name))
|
| + data = tab.EvaluateJavaScript(js)
|
| + if data:
|
| + results.Add(name.replace('.', '_'), histogram['units'], data,
|
| + data_type='histogram')
|
|
|