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

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

Issue 2629413002: [tools/perf] Trim down story name that has more than 180 charaters (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | tools/perf/page_sets/top_desktop_sites_2012Q3.py » ('j') | 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 from profile_creators import profile_safe_url_list 4 from profile_creators import profile_safe_url_list
5 from telemetry.page import page as page_module 5 from telemetry.page import page as page_module
6 from telemetry.page import shared_page_state 6 from telemetry.page import shared_page_state
7 from telemetry import story 7 from telemetry import story
8 8
9 9
10 class ProfileSafeUrlPage(page_module.Page): 10 class ProfileSafeUrlPage(page_module.Page):
11 def __init__(self, url, page_set): 11 def __init__(self, url, page_set):
12 super(ProfileSafeUrlPage, self).__init__( 12 super(ProfileSafeUrlPage, self).__init__(
13 url=url, 13 url=url,
14 # Make sure story name is not too long and has type 'str' instead of
15 # 'unicode'.
16 name=str(url[:140]),
14 page_set = page_set, 17 page_set = page_set,
15 shared_page_state_class=shared_page_state.SharedDesktopPageState, 18 shared_page_state_class=shared_page_state.SharedDesktopPageState,
16 credentials_path = 'data/credentials.json') 19 credentials_path = 'data/credentials.json')
17 self.credentials = 'google' 20 self.credentials = 'google'
18 21
19 22
20 class ProfileSafeUrlsPageSet(story.StorySet): 23 class ProfileSafeUrlsPageSet(story.StorySet):
21 """Safe urls used for profile generation.""" 24 """Safe urls used for profile generation."""
22 25
23 def __init__(self): 26 def __init__(self):
24 super(ProfileSafeUrlsPageSet, self).__init__( 27 super(ProfileSafeUrlsPageSet, self).__init__(
25 archive_data_file='data/profile_safe_urls.json', 28 archive_data_file='data/profile_safe_urls.json',
26 cloud_storage_bucket=story.PARTNER_BUCKET) 29 cloud_storage_bucket=story.PARTNER_BUCKET)
27 30
28 # Only use the first 500 urls to prevent the .wpr files from getting too 31 # Only use the first 500 urls to prevent the .wpr files from getting too
29 # big. 32 # big.
30 safe_urls = profile_safe_url_list.GetShuffledSafeUrls()[0:500] 33 safe_urls = profile_safe_url_list.GetShuffledSafeUrls()[0:500]
31 for safe_url in safe_urls: 34 for safe_url in safe_urls:
32 self.AddStory(ProfileSafeUrlPage(safe_url, self)) 35 self.AddStory(ProfileSafeUrlPage(safe_url, self))
OLDNEW
« no previous file with comments | « no previous file | tools/perf/page_sets/top_desktop_sites_2012Q3.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698