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

Side by Side 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: fix archive_data_path from None to empty string Created 3 years, 8 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 | « tools/perf/benchmarks/power.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 import time
5
6 from telemetry.page import shared_page_state
7 from telemetry import story
8
9
10 class _IdleSharedState(shared_page_state.SharedPageState):
11 def __init__(self, test, finder_options, story_set):
12 super(_IdleSharedState, self).__init__(test, finder_options, story_set)
13 self._current_story = None
14
15 def WillRunStory(self, current_story):
16 self._current_story = current_story
17 assert self.platform.tracing_controller.is_tracing_running
18
19 def RunStory(self, _):
20 self._current_story.Run(self)
21
22 def DidRunStory(self, _):
23 self._current_story = None
24
25
26 class _IdleStory(story.Story):
27 def __init__(self, name, duration):
28 super(_IdleStory, self).__init__(
29 shared_state_class=_IdleSharedState, name=name)
30 self._duration = duration
31
32 def Run(self, shared_state):
33 time.sleep(self._duration)
34
35
36 class IdleStorySet(story.StorySet):
37 def __init__(self):
38 super(IdleStorySet, self).__init__()
39 self.AddStory(_IdleStory('IdleStory_10s', 10))
40 self.AddStory(_IdleStory('IdleStory_60s', 60))
41 self.AddStory(_IdleStory('IdleStory_120s', 120))
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/power.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698