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

Unified Diff: tools/perf/metrics/power.py

Issue 501813002: [Telemetry] Fix idle wakeup reporting in the face of dead processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
Index: tools/perf/metrics/power.py
diff --git a/tools/perf/metrics/power.py b/tools/perf/metrics/power.py
index c871b1dd9fc908fdb3a0cd8eb44908cf802c75cb..cc55d470d27491ac64d5a2a7bc46603fda5f2fd8 100644
--- a/tools/perf/metrics/power.py
+++ b/tools/perf/metrics/power.py
@@ -5,6 +5,7 @@
import time
from metrics import Metric
+from telemetry.core.platform import timeline_objects
from telemetry.value import scalar
@@ -178,7 +179,12 @@ def _SubtractCpuStats(cpu_stats, start_cpu_stats):
if (('IdleWakeupCount' not in cpu_stats[process_type]) or
('IdleWakeupCount' not in start_cpu_stats[process_type])):
continue
+
+ # Verify that the IdleWakeupCount field has been converted to a
tonyg 2014/08/24 16:53:43 Let's just kill this comment. It answers "what" in
jeremy 2014/08/26 14:14:16 Done.
+ # TimlineData-based object.
+ assert isinstance(cpu_stats[process_type]['IdleWakeupCount'],
+ timeline_objects.IdleStatsData)
idle_wakeup_delta = (cpu_stats[process_type]['IdleWakeupCount'] -
start_cpu_stats[process_type]['IdleWakeupCount'])
- cpu_delta[process_type] = idle_wakeup_delta
+ cpu_delta[process_type] = idle_wakeup_delta.IdleWakeupCount()
return cpu_delta

Powered by Google App Engine
This is Rietveld 408576698