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

Unified Diff: tools/telemetry/examples/benchmarks/simple_story_set.py

Issue 1368533002: [Telemetry] Add an example for adding an end to end Telemetry benchmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Ethan comment message_loop -> v8 change 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: tools/telemetry/examples/benchmarks/simple_story_set.py
diff --git a/tools/telemetry/examples/benchmarks/simple_story_set.py b/tools/telemetry/examples/benchmarks/simple_story_set.py
new file mode 100644
index 0000000000000000000000000000000000000000..019e79076c23f952bc3b982d9d42580dba23c0fa
--- /dev/null
+++ b/tools/telemetry/examples/benchmarks/simple_story_set.py
@@ -0,0 +1,34 @@
+# 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.
+
+from telemetry import story
+from telemetry import page
+
+
+class ExamplePage(page.Page):
+
+ def __init__(self, page_set):
+ super(ExamplePage, self).__init__(
+ url='https://google.com/search?q=lemon',
+ page_set=page_set)
+
+ def RunPageInteractions(self, action_runner):
+ action_runner.Wait(0.5)
aiolos (Not reviewing) 2015/11/06 18:15:21 It might be worthwhile to add a comment about Crea
nednguyen 2015/11/06 18:36:15 Done.
+ with action_runner.CreateInteraction('Wait'):
+ action_runner.Wait(0.3)
+ action_runner.Wait(0.1)
+ with action_runner.CreateInteraction('Scroll'):
+ # To see all the web APIs that action_runner supports, see:
aiolos (Not reviewing) 2015/11/06 18:15:21 This seems like an odd place for this comment. Can
nednguyen 2015/11/06 18:36:15 Done.
+ # telemetry.page.action_runner module.
+ action_runner.ScrollPage()
+ with action_runner.CreateInteraction('Wait-two'):
+ action_runner.Wait(1)
+
+
+class SimpleStorySet(story.StorySet):
+ def __init__(self):
+ super(SimpleStorySet, self).__init__(
+ archive_data_file='data/simple_story_set.json',
+ cloud_storage_bucket=story.PARTNER_BUCKET)
+ self.AddStory(ExamplePage(self))

Powered by Google App Engine
This is Rietveld 408576698