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

Unified Diff: tools/perf/page_sets/alexa_top_500.py

Issue 1210403002: [DoNotCommit] telemetry: Retrieve per-allocator memory usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/page_sets/alexa_top_500.json ('k') | tools/perf/page_sets/alexa_top_500_blacklist.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/alexa_top_500.py
diff --git a/tools/perf/page_sets/alexa_top_500.py b/tools/perf/page_sets/alexa_top_500.py
new file mode 100644
index 0000000000000000000000000000000000000000..88b8ad1410dbf6f366966da96e51743a089dd15f
--- /dev/null
+++ b/tools/perf/page_sets/alexa_top_500.py
@@ -0,0 +1,62 @@
+# 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.
+import json
+import os
+
+from telemetry.page import page as page_module
+from telemetry.page import shared_page_state
+from telemetry import story
+
+
+_ALEXA_TOP500_JSON = os.path.join(
+ os.path.abspath(os.path.dirname(__file__)), 'alexa_top_500.json')
+_ALEXA_TOP500_JSON_BLACKLIST = os.path.join(
+ os.path.abspath(os.path.dirname(__file__)), 'alexa_top_500_blacklist.json')
+
+class AlexaTop500Page(page_module.Page):
+
+ def __init__(self, url, page_set):
+ super(AlexaTop500Page, self).__init__(
+ url=url, page_set=page_set,
+ shared_page_state_class=shared_page_state.SharedDesktopPageState)
+
+ def RunPageInteractions(self, action_runner):
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage()
+
+
+class AlexaTop500PageSet(story.StorySet):
+ def __init__(self):
+ super(AlexaTop500PageSet, self).__init__(
+ archive_data_file='data/alexa_top_500.json',
+ )
+
+ excludes = set([
+ 'qq.com',
+ 'telegraph.co.uk',
+ 'googleusercontent.com',
+ 'nba.com',
+ 'seznam.cz',
+ 'sina.com.cn',
+ 'youku.com',
+ 'zhihu.com',
+ 'huffingtonpost.com',
+ 't-online.de',
+ ])
+
+ # with open(_ALEXA_TOP500_JSON_BLACKLIST) as f:
+ # excludes = set(json.load(f))
+
+ sites = []
+ with open(_ALEXA_TOP500_JSON) as f:
+ site_entries = json.load(f)
+ for entry in site_entries:
+ if entry['url'] in excludes:
+ continue
+ sites.append(entry['url'])
+
+ MAX_PAGES = 300
+ for i, site in enumerate(sites):
+ if i < MAX_PAGES:
+ self.AddStory(AlexaTop500Page('http://' + site, self))
« no previous file with comments | « tools/perf/page_sets/alexa_top_500.json ('k') | tools/perf/page_sets/alexa_top_500_blacklist.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698