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

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

Issue 350763005: [Telemetry] Power metric: subtract quiescent power draw from result (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 # Copyright 2012 The Chromium Authors. All rights reserved. 1 # Copyright 2012 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 from metrics import memory 5 from metrics import memory
6 from metrics import power 6 from metrics import power
7 from telemetry.page import page_measurement 7 from telemetry.page import page_measurement
8 8
9 class Memory(page_measurement.PageMeasurement): 9 class Memory(page_measurement.PageMeasurement):
10 def __init__(self): 10 def __init__(self):
11 super(Memory, self).__init__('RunStressMemory') 11 super(Memory, self).__init__('RunStressMemory')
12 self._memory_metric = None 12 self._memory_metric = None
13 self._power_metric = power.PowerMetric() 13 self._power_metric = None
14
15 def WillStartBrowser(self, browser):
16 self._power_metric = power.PowerMetric(browser)
14 17
15 def DidStartBrowser(self, browser): 18 def DidStartBrowser(self, browser):
16 self._memory_metric = memory.MemoryMetric(browser) 19 self._memory_metric = memory.MemoryMetric(browser)
17 20
18 def DidNavigateToPage(self, page, tab): 21 def DidNavigateToPage(self, page, tab):
19 self._memory_metric.Start(page, tab) 22 self._memory_metric.Start(page, tab)
20 self._power_metric.Start(page, tab) 23 self._power_metric.Start(page, tab)
21 24
22 def CustomizeBrowserOptions(self, options): 25 def CustomizeBrowserOptions(self, options):
23 memory.MemoryMetric.CustomizeBrowserOptions(options) 26 memory.MemoryMetric.CustomizeBrowserOptions(options)
(...skipping 11 matching lines...) Expand all
35 # The tcmalloc_heap_profiler dumps files at regular 38 # The tcmalloc_heap_profiler dumps files at regular
36 # intervals (~20 secs). 39 # intervals (~20 secs).
37 # This is a minor optimization to ensure it'll dump the last file when 40 # This is a minor optimization to ensure it'll dump the last file when
38 # the test completes. 41 # the test completes.
39 tab.ExecuteJavaScript(""" 42 tab.ExecuteJavaScript("""
40 if (chrome && chrome.memoryBenchmarking) { 43 if (chrome && chrome.memoryBenchmarking) {
41 chrome.memoryBenchmarking.heapProfilerDump('renderer', 'final'); 44 chrome.memoryBenchmarking.heapProfilerDump('renderer', 'final');
42 chrome.memoryBenchmarking.heapProfilerDump('browser', 'final'); 45 chrome.memoryBenchmarking.heapProfilerDump('browser', 'final');
43 } 46 }
44 """) 47 """)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698