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

Side by Side Diff: tools/perf/measurements/energy.py

Issue 1092393002: Telemetry: Quiescent power benchmarks for Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@safari-backend
Patch Set: Created 5 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
OLDNEW
(Empty)
1 # Copyright 2015 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 time
6
7 from metrics import cpu
8 from metrics import power
9 from telemetry.page import page_test
10
11
12 class Energy(page_test.PageTest):
13 """Measures power usage, idle wakeups, and CPU utilization."""
14
15 # Amount of time to measure, in seconds.
16 SAMPLE_TIME = 10
17
18 def ValidateAndMeasurePage(self, page, tab, results):
19 metrics = [ power.PowerMetric(tab.browser.platform), cpu.CpuMetric(tab.brows er) ]
ccameron 2015/04/20 21:36:33 It may be a good idea to wait for a few seconds he
Andre 2015/04/20 21:52:40 metric.PowerMetric supports measuring quiescent po
Andre 2015/04/22 00:46:54 I've added util.WaitFor(tab.hasReachedQuiescence)
20 for metric in metrics:
21 metric.Start(page, tab)
22
23 time.sleep(Energy.SAMPLE_TIME)
24
25 for metric in metrics:
26 metric.Stop(page, tab)
27 metric.AddResults(tab, results)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698