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

Side by Side Diff: tools/perf/measurements/memory_multi_tab.py

Issue 1654863003: Kill --memory-metrics and on-demand Memory.Browser/RenderUsed histograms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « tools/perf/measurements/memory.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Multi tab memory test. 5 """Multi tab memory test.
6 6
7 This test is a multi tab test, but we're interested in measurements for 7 This test is a multi tab test, but we're interested in measurements for
8 the entire test rather than each single page. 8 the entire test rather than each single page.
9 """ 9 """
10 10
11 from telemetry.page import page_test 11 from telemetry.page import page_test
12 12
13 from metrics import memory 13 from metrics import memory
14 14
15 15
16 class MemoryMultiTab(page_test.PageTest): 16 class MemoryMultiTab(page_test.PageTest):
17 17
18 def __init__(self): 18 def __init__(self):
19 super(MemoryMultiTab, self).__init__() 19 super(MemoryMultiTab, self).__init__()
20 self._memory_metric = None 20 self._memory_metric = None
21 # _first_tab is used to make memory measurements 21 # _first_tab is used to make memory measurements
22 self._first_tab = None 22 self._first_tab = None
23 23
24 def DidStartBrowser(self, browser): 24 def DidStartBrowser(self, browser):
25 self._memory_metric = memory.MemoryMetric(browser) 25 self._memory_metric = memory.MemoryMetric(browser)
26 26
27 def CustomizeBrowserOptions(self, options):
28 memory.MemoryMetric.CustomizeBrowserOptions(options)
29 # Since this is a memory benchmark, we want to sample memory histograms at
30 # a high frequency.
31 options.AppendExtraBrowserArgs('--memory-metrics')
32
33 def TabForPage(self, page, browser): 27 def TabForPage(self, page, browser):
34 return browser.tabs.New() 28 return browser.tabs.New()
35 29
36 def DidNavigateToPage(self, page, tab): 30 def DidNavigateToPage(self, page, tab):
37 # Start measurement on the first tab. 31 # Start measurement on the first tab.
38 if not self._first_tab: 32 if not self._first_tab:
39 self._memory_metric.Start(page, tab) 33 self._memory_metric.Start(page, tab)
40 self._first_tab = tab 34 self._first_tab = tab
41 35
42 def ValidateAndMeasurePage(self, page, tab, results): 36 def ValidateAndMeasurePage(self, page, tab, results):
43 # Finalize measurement on the last tab. 37 # Finalize measurement on the last tab.
44 if len(tab.browser.tabs) == len(page.story_set.stories): 38 if len(tab.browser.tabs) == len(page.story_set.stories):
45 self._memory_metric.Stop(page, self._first_tab) 39 self._memory_metric.Stop(page, self._first_tab)
46 self._memory_metric.AddResults(self._first_tab, results) 40 self._memory_metric.AddResults(self._first_tab, results)
OLDNEW
« no previous file with comments | « tools/perf/measurements/memory.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698