summaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 13:02:43 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 13:02:43 +0000
commitebdc2ce1fe09a0ea84cf58cb86a4c196a4c3f6a1 (patch)
tree625bc1c6e7d6926ed710d9e173ff1d47dd58f696 /tools/perf
parenta08e910ee78703fe287a03d23b60f14a3440b492 (diff)
downloadchromium_src-ebdc2ce1fe09a0ea84cf58cb86a4c196a4c3f6a1.zip
chromium_src-ebdc2ce1fe09a0ea84cf58cb86a4c196a4c3f6a1.tar.gz
chromium_src-ebdc2ce1fe09a0ea84cf58cb86a4c196a4c3f6a1.tar.bz2
Telemetry multi page testing FW: Add a proof-of-concept memory test.
We currently measure memory usage in page cycler tests, but we'd need more realistic and longer running tests to get better memory statistics. The test works against Web Page Replay data, and uses Telemetry to execute actions on pages. Actual tests still need to be added. BUG=158323 Review URL: https://codereview.chromium.org/11273081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/page_sets/top_25.json8
-rw-r--r--tools/perf/perf_tools/memory_benchmark.py26
2 files changed, 30 insertions, 4 deletions
diff --git a/tools/perf/page_sets/top_25.json b/tools/perf/page_sets/top_25.json
index 7ffa9f9..8ae04c3 100644
--- a/tools/perf/page_sets/top_25.json
+++ b/tools/perf/page_sets/top_25.json
@@ -61,18 +61,18 @@
"credentials": "facebook",
"scroll_is_infinite": true,
"stress_memory": {
- "action": "compound",
+ "action": "compound_interaction",
"actions": [
{
- "action": "click_to_navigate",
+ "action": "click_to_navigate_interaction",
"selector": "a[href=\"http://www.facebook.com/WomenforObama\"]"
},
{
- "action": "click_to_navigate",
+ "action": "click_to_navigate_interaction",
"selector": "a[href=\"http://www.facebook.com/WomenforObama/info\"]"
},
{
- "action": "click_to_navigate",
+ "action": "click_to_navigate_interaction",
"selector": "a[href=\"http://www.facebook.com/?ref=tn_tnmn\"]"
}
]
diff --git a/tools/perf/perf_tools/memory_benchmark.py b/tools/perf/perf_tools/memory_benchmark.py
new file mode 100644
index 0000000..c3e974b
--- /dev/null
+++ b/tools/perf/perf_tools/memory_benchmark.py
@@ -0,0 +1,26 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+from telemetry import multi_page_benchmark
+
+MEMORY_HISTOGRAMS = [
+ {'name': 'V8.MemoryExternalFragmentationTotal', 'units': 'percent'},
+ {'name': 'V8.MemoryHeapSampleTotalCommitted', 'units': 'kb'},
+ {'name': 'V8.MemoryHeapSampleTotalUsed', 'units': 'kb'}]
+
+class MemoryBenchmark(multi_page_benchmark.MultiPageBenchmark):
+ def __init__(self):
+ super(MemoryBenchmark, self).__init__('stress_memory')
+
+ def CustomizeBrowserOptions(self, options):
+ options.AppendExtraBrowserArg('--dom-automation')
+
+ def CanRunForPage(self, page):
+ return hasattr(page, 'stress_memory')
+
+ def MeasurePage(self, page, tab, results):
+ for histogram in MEMORY_HISTOGRAMS:
+ name = histogram['name']
+ data = tab.runtime.Evaluate(
+ 'window.domAutomationController.getHistogram("%s")' % name)
+ results.Add(name, histogram['units'], data, data_type='histogram')