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

Side by Side Diff: tools/perf/benchmarks/battor.py

Issue 1984473002: [Telemetry] Add BattOr benchmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/PRESUBMIT.py ('k') | tools/perf/page_sets/data/power_cases.json » ('j') | 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 2016 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
5 import os
6 import sys
7
8 from core import path_util
9 from core import perf_benchmark
10 from telemetry.web_perf import timeline_based_measurement
11 import page_sets
12
13
14 BATTOR_PATH = os.path.join(
rnephew (Reviews Here) 2016/05/17 18:54:16 Is there a better place to add this to the python
nednguyen 2016/05/18 02:15:18 Here is ok. Ideally, the tools/perf should follow
15 path_util.GetTelemetryDir(), '..', 'common', 'battor', 'battor')
16 sys.path.insert(1, BATTOR_PATH)
17 import battor_wrapper
18
19 class _BattOrBenchmark(perf_benchmark.PerfBenchmark):
20
21 def CreateTimelineBasedMeasurementOptions(self):
22 options = timeline_based_measurement.Options()
23 options.config.enable_battor_trace = True
24 # TODO(rnephew): Enable chrome trace when clock syncs work well with it.
25 options.config.enable_chrome_trace = False
26 options.SetTimelineBasedMetric('SystemHealthMetrics')
27 return options
28
29 @classmethod
30 def ShouldDisable(cls, browser):
31 # Only run if BattOr is detected.
32 test_platform = browser.platform.GetOSName()
33 # pylint: disable=protected-access
34 device = (browser.platform._platform_backend.device
nednguyen 2016/05/18 02:15:17 Accessing _platform_backend here violates the priv
nednguyen 2016/05/18 02:17:07 err, sorry. Let's name it platform.HasBattorConnec
rnephew (Reviews Here) 2016/05/19 16:50:03 Done. Needs https://codereview.chromium.org/199763
35 if test_platform == 'android' else None)
36 if not battor_wrapper.IsBattOrConnected(test_platform,
37 android_device=device):
38 return True
39
40 # Galaxy S5s have problems with running system health metrics.
41 # http://crbug.com/600463
42 galaxy_s5_type_name = 'SM-G900H'
43 return browser.platform.GetDeviceTypeName() == galaxy_s5_type_name
44
45 @classmethod
46 def ShouldTearDownStateAfterEachStoryRun(cls):
47 return True
48
49
50 class BattOrPowerMobileSites(_BattOrBenchmark):
51 page_set = page_sets.power_cases.PowerCasesPageSet
52
53 @classmethod
54 def Name(cls):
55 return 'BattOr.BattOrCases'
56
OLDNEW
« no previous file with comments | « tools/perf/PRESUBMIT.py ('k') | tools/perf/page_sets/data/power_cases.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698