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

Side by Side Diff: tools/perf/page_sets/blink_memory_mobile.py

Issue 2350423003: [Tentaive patch for discussion] Add Purge+Suspend metrics as UMA.
Patch Set: Add v8 heap usage Created 4 years, 2 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
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 import logging 5 import logging
6 6
7 from telemetry.page import page as page_module 7 from telemetry.page import page as page_module
8 from telemetry.page import shared_page_state 8 from telemetry.page import shared_page_state
9 from telemetry import story 9 from telemetry import story
10 10
11 from page_sets.login_helpers import google_login 11 from page_sets.login_helpers import google_login
12 12
13 13
14 DUMP_WAIT_TIME = 3 14 DUMP_WAIT_TIME = 3
15 15
16 16
17 class BlinkMemoryMobilePage(page_module.Page): 17 class BlinkMemoryMobilePage(page_module.Page):
18 def __init__(self, url, page_set, name): 18 def __init__(self, url, page_set, name):
19 super(BlinkMemoryMobilePage, self).__init__( 19 super(BlinkMemoryMobilePage, self).__init__(
20 url=url, page_set=page_set, name=name, 20 url=url, page_set=page_set, name=name,
21 shared_page_state_class=shared_page_state.SharedMobilePageState, 21 shared_page_state_class=shared_page_state.SharedMobilePageState,
22 credentials_path='data/credentials.json') 22 credentials_path='data/credentials.json')
23 self.archive_data_file = 'data/blink_memory_mobile.json' 23 self.archive_data_file = 'data/blink_memory_mobile.json'
24 24
25 def _DumpMemory(self, action_runner, phase): 25 def _DumpMemory(self, action_runner, phase):
26 with action_runner.CreateInteraction(phase): 26 with action_runner.CreateInteraction(phase):
27 action_runner.Wait(DUMP_WAIT_TIME) 27 action_runner.Wait(DUMP_WAIT_TIME)
28 # Open blank tab (Move the page to background).
29 action_runner.tab.browser.tabs.New()
30 action_runner.Wait(5)
28 action_runner.ForceGarbageCollection() 31 action_runner.ForceGarbageCollection()
29 action_runner.SimulateMemoryPressureNotification('critical') 32 if not action_runner.tab.browser.DumpMemory():
33 logging.error('Unable to get a memory dump for %s.', self.name)
34 action_runner.Wait(20)
35 #action_runner.SimulateMemoryPressureNotification('critical')
30 action_runner.Wait(DUMP_WAIT_TIME) 36 action_runner.Wait(DUMP_WAIT_TIME)
31 if not action_runner.tab.browser.DumpMemory(): 37 if not action_runner.tab.browser.DumpMemory():
32 logging.error('Unable to get a memory dump for %s.', self.name) 38 logging.error('Unable to get a memory dump for %s.', self.name)
33 39
34 def RunPageInteractions(self, action_runner): 40 def RunPageInteractions(self, action_runner):
35 action_runner.ScrollPage() 41 action_runner.ScrollPage()
36 self._DumpMemory(action_runner, 'scrolled') 42 self._DumpMemory(action_runner, 'scrolled')
37 43
38 44
39 class TheVergePage(BlinkMemoryMobilePage): 45 class TheVergePage(BlinkMemoryMobilePage):
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 # Why: Key products. 133 # Why: Key products.
128 self.AddStory(GmailPage(page_set=self)) 134 self.AddStory(GmailPage(page_set=self))
129 self.AddStory(BlinkMemoryMobilePage( 135 self.AddStory(BlinkMemoryMobilePage(
130 'http://googlewebmastercentral.blogspot.com/2015/04/rolling-out-mobile-f riendly-update.html?m=1', 136 'http://googlewebmastercentral.blogspot.com/2015/04/rolling-out-mobile-f riendly-update.html?m=1',
131 page_set=self, 137 page_set=self,
132 name='Blogger')) 138 name='Blogger'))
133 self.AddStory(BlinkMemoryMobilePage( 139 self.AddStory(BlinkMemoryMobilePage(
134 'https://plus.google.com/app/basic/110031535020051778989/posts?source=ap ppromo', 140 'https://plus.google.com/app/basic/110031535020051778989/posts?source=ap ppromo',
135 page_set=self, 141 page_set=self,
136 name='GooglePlus')) 142 name='GooglePlus'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698