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

Unified Diff: ct/py/create_page_set.py

Issue 1392173005: [CT] Update worker scripts to use new benchmarks and delete old benchmarks (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Remove staging code Created 5 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 side-by-side diff with in-line comments
Download patch
Index: ct/py/create_page_set.py
diff --git a/ct/py/create_page_set.py b/ct/py/create_page_set.py
index cc682c1581b08b487b751147d4903562e7b085cc..cc33135cffd6f15d1da3a9364230f62bfedbe663 100644
--- a/ct/py/create_page_set.py
+++ b/ct/py/create_page_set.py
@@ -19,6 +19,7 @@ Running the above command will create 10000 different page sets.
__author__ = 'Ravi Mistry'
+import json
import optparse
import os
import urllib
@@ -105,56 +106,14 @@ if '__main__' == __name__:
options.pagesets_type,
'alexa%s-%s.json' % (options.start_number, options.end_number))
- page_set_content = """
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-# pylint: disable=W0401,W0614
-
-from telemetry import story
-from telemetry.page import page as page_module
-from telemetry.page import shared_page_state
-from page_sets import repaint_helpers
-
-
-class TypicalAlexaPage(page_module.Page):
-
- def __init__(self, url, page_set):
- super(TypicalAlexaPage, self).__init__(
- url=url,
- page_set=page_set,
- shared_page_state_class=shared_page_state.Shared%(user_agent)sPageState)
- self.archive_data_file = '%(archive_data_file)s'
-
- def RunNavigateSteps(self, action_runner):
- action_runner.Navigate(self.url)
- action_runner.Wait(2)
-
- def RunPageInteractions(self, action_runner):
- repaint_helpers.Repaint(action_runner)
-
-
-class Alexa%(start)s_%(end)sPageSet(story.StorySet):
-
- def __init__(self):
- super(Alexa%(start)s_%(end)sPageSet, self).__init__(
- archive_data_file='%(archive_data_file)s')
-
- urls_list = %(urls_list)s
-
- for url in urls_list:
- self.AddStory(TypicalAlexaPage(url, self))
-""" % {
- "user_agent": options.useragent_type.capitalize(),
- "archive_data_file": archive_data_file,
- "start": options.start_number,
- "end": options.end_number,
- "urls_list": str(websites),
+ page_set_content = {
+ 'user_agent': options.useragent_type,
+ 'archive_data_file': archive_data_file,
+ 'urls_list': ','.join(websites),
}
# Output the pageset to a file.
with open(os.path.join(options.pagesets_output_dir, 'alexa%s_%s.py' % (
options.start_number, options.end_number)),
'w') as outfile:
- outfile.write(page_set_content)
-
+ json.dump(page_set_content, outfile)
dogben 2015/10/14 18:25:50 Any potential issues with changing the format of t
rmistry 2015/10/15 12:23:21 Right, all pagesets will need to be recreated and

Powered by Google App Engine
This is Rietveld 408576698