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

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

Issue 1931533002: Port memory.long_running_idle_gmail benchmarks to TBMv2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and remove deprecated method Created 4 years, 7 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/benchmarks/memory_infra.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 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 from telemetry import story 5 from telemetry import story
6 6
7 from page_sets import google_pages 7 from page_sets import google_pages
8 8
9 STARTUP_TIME_IN_SECONDS = 2
10 IDLE_TIME_IN_SECONDS = 100 9 IDLE_TIME_IN_SECONDS = 100
10 SAMPLING_INTERVAL_IN_SECONDS = 1
11 STEPS = IDLE_TIME_IN_SECONDS / SAMPLING_INTERVAL_IN_SECONDS
12
13 def _IdleAction(action_runner):
14 action_runner.tab.browser.DumpMemory()
15 for _ in xrange(STEPS):
16 action_runner.Wait(SAMPLING_INTERVAL_IN_SECONDS)
17 action_runner.tab.browser.DumpMemory()
11 18
12 def _CreateIdlePageClass(base_page_cls): 19 def _CreateIdlePageClass(base_page_cls):
13 class DerivedIdlePage(base_page_cls): # pylint: disable=no-init 20 class DerivedIdlePage(base_page_cls): # pylint: disable=no-init
14 def RunPageInteractions(self, action_runner): 21 def RunPageInteractions(self, action_runner):
15 action_runner.Wait(STARTUP_TIME_IN_SECONDS) 22 _IdleAction(action_runner)
16 with action_runner.CreateInteraction('Begin'):
17 action_runner.tab.browser.DumpMemory()
18 with action_runner.CreateInteraction('Idle'):
19 action_runner.Wait(IDLE_TIME_IN_SECONDS)
20 with action_runner.CreateInteraction('End'):
21 action_runner.tab.browser.DumpMemory()
22 return DerivedIdlePage 23 return DerivedIdlePage
23 24
24 25
25 def _CreateIdleBackgroundPageClass(base_page_cls): 26 def _CreateIdleBackgroundPageClass(base_page_cls):
26 class DerivedIdlePage(base_page_cls): # pylint: disable=no-init 27 class DerivedIdlePage(base_page_cls): # pylint: disable=no-init
27 def RunPageInteractions(self, action_runner): 28 def RunPageInteractions(self, action_runner):
28 action_runner.tab.browser.tabs.New() 29 action_runner.tab.browser.tabs.New()
29 action_runner.Wait(IDLE_TIME_IN_SECONDS) 30 _IdleAction(action_runner)
30 return DerivedIdlePage 31 return DerivedIdlePage
31 32
32 33
33 class LongRunningIdleGmailPageSet(story.StorySet): 34 class LongRunningIdleGmailPageSet(story.StorySet):
34 def __init__(self): 35 def __init__(self):
35 super(LongRunningIdleGmailPageSet, self).__init__( 36 super(LongRunningIdleGmailPageSet, self).__init__(
36 archive_data_file='data/long_running_idle_gmail_page.json', 37 archive_data_file='data/long_running_idle_gmail_page.json',
37 cloud_storage_bucket=story.PARTNER_BUCKET) 38 cloud_storage_bucket=story.PARTNER_BUCKET)
38 self.AddStory( 39 self.AddStory(
39 _CreateIdlePageClass(google_pages.GmailPage)(self)) 40 _CreateIdlePageClass(google_pages.GmailPage)(self))
40 41
41 42
42 class LongRunningIdleGmailBackgroundPageSet(story.StorySet): 43 class LongRunningIdleGmailBackgroundPageSet(story.StorySet):
43 def __init__(self): 44 def __init__(self):
44 # Reuse the wpr of foreground gmail. 45 # Reuse the wpr of foreground gmail.
45 super(LongRunningIdleGmailBackgroundPageSet, self).__init__( 46 super(LongRunningIdleGmailBackgroundPageSet, self).__init__(
46 archive_data_file='data/long_running_idle_gmail_page.json', 47 archive_data_file='data/long_running_idle_gmail_page.json',
47 cloud_storage_bucket=story.PARTNER_BUCKET) 48 cloud_storage_bucket=story.PARTNER_BUCKET)
48 self.AddStory( 49 self.AddStory(
49 _CreateIdleBackgroundPageClass(google_pages.GmailPage)(self)) 50 _CreateIdleBackgroundPageClass(google_pages.GmailPage)(self))
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/memory_infra.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698