Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: tools/perf/perf_tools/memory_benchmark.py

Issue 11975048: Native memory histograms for the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ios build fix Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/renderer_main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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')
« no previous file with comments | « content/renderer/renderer_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698