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

Side by Side Diff: tools/perf/perf_tools/memory_benchmark.py

Issue 11273081: Adding a test for measuring memory usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (tonyg, nduca) Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/perf/page_sets/top_25.json ('k') | tools/telemetry/telemetry/all_page_interactions.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 from telemetry import multi_page_benchmark
5
6 MEMORY_HISTOGRAMS = [
7 {'name': 'V8.MemoryExternalFragmentationTotal', 'units': 'percent'},
8 {'name': 'V8.MemoryHeapSampleTotalCommitted', 'units': 'kb'},
9 {'name': 'V8.MemoryHeapSampleTotalUsed', 'units': 'kb'}]
10
11 class MemoryBenchmark(multi_page_benchmark.MultiPageBenchmark):
12 def __init__(self):
13 super(MemoryBenchmark, self).__init__('stress_memory')
14
15 def CustomizeBrowserOptions(self, options):
16 options.AppendExtraBrowserArg('--dom-automation')
17
18 def CanRunForPage(self, page):
19 return hasattr(page, 'stress_memory')
20
21 def MeasurePage(self, page, tab, results):
22 for histogram in MEMORY_HISTOGRAMS:
23 name = histogram['name']
24 data = tab.runtime.Evaluate(
25 'window.domAutomationController.getHistogram("%s")' % name)
26 results.Add(name, histogram['units'], data, data_type='histogram')
OLDNEW
« no previous file with comments | « tools/perf/page_sets/top_25.json ('k') | tools/telemetry/telemetry/all_page_interactions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698