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

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: Fix cpu_stats comment. 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..0d10aa4c72fdf035acd8cdff973ec18175507d23 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 process_statistic_timeline_data
from telemetry.value import scalar
@@ -178,7 +179,10 @@ 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
+
+ assert isinstance(cpu_stats[process_type]['IdleWakeupCount'],
+ process_statistic_timeline_data.IdleWakeupTimelineData)
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.total_sum()
return cpu_delta

Powered by Google App Engine
This is Rietveld 408576698