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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/benchmarks/battor.py
diff --git a/tools/perf/benchmarks/battor.py b/tools/perf/benchmarks/battor.py
new file mode 100644
index 0000000000000000000000000000000000000000..28d8eefca571b2a840cc3fb1a130e4a89d623d01
--- /dev/null
+++ b/tools/perf/benchmarks/battor.py
@@ -0,0 +1,56 @@
+# Copyright 2016 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 os
+import sys
+
+from core import path_util
+from core import perf_benchmark
+from telemetry.web_perf import timeline_based_measurement
+import page_sets
+
+
+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
+ path_util.GetTelemetryDir(), '..', 'common', 'battor', 'battor')
+sys.path.insert(1, BATTOR_PATH)
+import battor_wrapper
+
+class _BattOrBenchmark(perf_benchmark.PerfBenchmark):
+
+ def CreateTimelineBasedMeasurementOptions(self):
+ options = timeline_based_measurement.Options()
+ options.config.enable_battor_trace = True
+ # TODO(rnephew): Enable chrome trace when clock syncs work well with it.
+ options.config.enable_chrome_trace = False
+ options.SetTimelineBasedMetric('SystemHealthMetrics')
+ return options
+
+ @classmethod
+ def ShouldDisable(cls, browser):
+ # Only run if BattOr is detected.
+ test_platform = browser.platform.GetOSName()
+ # pylint: disable=protected-access
+ 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
+ if test_platform == 'android' else None)
+ if not battor_wrapper.IsBattOrConnected(test_platform,
+ android_device=device):
+ return True
+
+ # Galaxy S5s have problems with running system health metrics.
+ # http://crbug.com/600463
+ galaxy_s5_type_name = 'SM-G900H'
+ return browser.platform.GetDeviceTypeName() == galaxy_s5_type_name
+
+ @classmethod
+ def ShouldTearDownStateAfterEachStoryRun(cls):
+ return True
+
+
+class BattOrPowerMobileSites(_BattOrBenchmark):
+ page_set = page_sets.power_cases.PowerCasesPageSet
+
+ @classmethod
+ def Name(cls):
+ return 'BattOr.BattOrCases'
+
« 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