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

Side by Side Diff: tools/perf/metrics/power.py

Issue 1029263003: [telemetry] Sort imports in Telemetry and its dependents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure we're up to date. Created 5 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 unified diff | Download patch
« no previous file with comments | « tools/perf/metrics/memory.py ('k') | tools/perf/metrics/speedindex.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import time 5 import time
6 6
7 from metrics import Metric
8 from telemetry.core.platform import process_statistic_timeline_data 7 from telemetry.core.platform import process_statistic_timeline_data
9 from telemetry.value import scalar 8 from telemetry.value import scalar
10 9
10 from metrics import Metric
11
11 12
12 class PowerMetric(Metric): 13 class PowerMetric(Metric):
13 """A metric for measuring power usage.""" 14 """A metric for measuring power usage."""
14 15
15 # System power draw while idle. 16 # System power draw while idle.
16 _quiescent_power_draw_mwh = 0 17 _quiescent_power_draw_mwh = 0
17 18
18 def __init__(self, platform, quiescent_measurement_time_s=0): 19 def __init__(self, platform, quiescent_measurement_time_s=0):
19 """PowerMetric Constructor. 20 """PowerMetric Constructor.
20 21
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 continue 187 continue
187 188
188 assert isinstance(cpu_stats[process_type]['IdleWakeupCount'], 189 assert isinstance(cpu_stats[process_type]['IdleWakeupCount'],
189 process_statistic_timeline_data.IdleWakeupTimelineData) 190 process_statistic_timeline_data.IdleWakeupTimelineData)
190 idle_wakeup_delta = (cpu_stats[process_type]['IdleWakeupCount'] - 191 idle_wakeup_delta = (cpu_stats[process_type]['IdleWakeupCount'] -
191 start_cpu_stats[process_type]['IdleWakeupCount']) 192 start_cpu_stats[process_type]['IdleWakeupCount'])
192 cpu_delta[process_type] = idle_wakeup_delta.total_sum() 193 cpu_delta[process_type] = idle_wakeup_delta.total_sum()
193 total = total + cpu_delta[process_type] 194 total = total + cpu_delta[process_type]
194 cpu_delta['Total'] = total 195 cpu_delta['Total'] = total
195 return cpu_delta 196 return cpu_delta
OLDNEW
« no previous file with comments | « tools/perf/metrics/memory.py ('k') | tools/perf/metrics/speedindex.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698