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

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

Issue 2744273003: [Telemetry] Add benchmark that doesn't launch chrome and collects platform data. (Closed)
Patch Set: [Telemetry] Add benchmark that doesn't launch chrome and collects platform data. Created 3 years, 9 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/perf/page_sets/idle_platform.py
diff --git a/tools/perf/page_sets/idle_platform.py b/tools/perf/page_sets/idle_platform.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed0505547c29f13acd96ae4dc08f64af41443b05
--- /dev/null
+++ b/tools/perf/page_sets/idle_platform.py
@@ -0,0 +1,43 @@
+# Copyright 2014 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 time
+
+from telemetry.page import page
+from telemetry.page import shared_page_state
+from telemetry import story
+
+
+class _IdleSharedState(shared_page_state.SharedPageState):
+ def __init__(self, test, finder_options, story_set, idle_time=30):
+ super(_IdleSharedState, self).__init__(test, finder_options, story_set)
+ self._idle_time = idle_time
+
+ def WillRunStory(self, _):
+ if not self.platform.tracing_controller.is_tracing_running:
+ # For TimelineBasedMeasurement benchmarks, tracing has already started.
+ # For PageTest benchmarks, tracing has not yet started. We need to make
+ # sure no tracing state is left before starting the browser for PageTest
+ # benchmarks.
+ self.platform.tracing_controller.ClearStateIfNeeded()
+
+ def RunStory(self, _):
+ time.sleep(self._idle_time)
+
+ def DidRunStory(self, results):
+ pass
+
+class IdlePlatformPage(page.Page):
nednguyen 2017/03/13 16:33:35 Let inherit this from story, so that you don't nee
rnephew (Reviews Here) 2017/03/13 21:29:18 Done, but now requires https://codereview.chromium
+ def __init__(self, url, page_set):
+ super(IdlePlatformPage, self).__init__(
+ url=url, page_set=page_set, credentials_path='data/credentials.json',
+ shared_page_state_class=_IdleSharedState, name='Idle Platform')
+
+
+class IdlePlatformPageSet(story.StorySet):
+ def __init__(self):
+ super(IdlePlatformPageSet, self).__init__(
+ archive_data_file=None,
+ cloud_storage_bucket=story.PARTNER_BUCKET)
+ # Page requires URL to be a valid.
+ self.AddStory(IdlePlatformPage('http://Idle Platform', self))
« tools/perf/benchmarks/idle_platform.py ('K') | « tools/perf/benchmarks/idle_platform.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698