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

Unified Diff: tracing/tracing/ui/tracks/cpu_usage_track.html

Issue 2083213002: Change call-sites in trace viewer to use generators instead of iteration functions. (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: fix nits, rebase Created 4 years, 6 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 | « tracing/tracing/ui/extras/side_panel/input_latency_side_panel.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/tracks/cpu_usage_track.html
diff --git a/tracing/tracing/ui/tracks/cpu_usage_track.html b/tracing/tracing/ui/tracks/cpu_usage_track.html
index d0c70002f542426026fed1113a42233ba1320f86..401420dbc007e61a8d2540710168e02ad106094d 100644
--- a/tracing/tracing/ui/tracks/cpu_usage_track.html
+++ b/tracing/tracing/ui/tracks/cpu_usage_track.html
@@ -70,10 +70,10 @@ tr.exportTo('tr.ui.tracks', function() {
// Iterate slices, find all the CPU samples which overlap. For each
// such CPU sample, increment it of the "average CPU usage" of the
// slice.
- process.iterateAllEvents(function(e) {
+ for (var e of process.getDescendantEvents()) {
if (!(e instanceof tr.model.ThreadSlice) || e.duration === 0 ||
e.cpuDuration === undefined) {
- return;
+ continue;
}
// This slice contains the most fine-grained CPU usage information
@@ -89,7 +89,7 @@ tr.exportTo('tr.ui.tracks', function() {
// = s.cpuSelfTime / s.selfTime
if (e.selfTime === 0 || e.selfTime === undefined ||
e.cpuSelfTime === undefined) {
- return;
+ continue;
}
var cpuSelfTimeRatio = e.cpuSelfTime / e.selfTime;
@@ -109,7 +109,7 @@ tr.exportTo('tr.ui.tracks', function() {
}, this);
this.addCPUUsageOverInterval_(cpuUsage, cpuSelfTimeRatio, lastTime,
e.end);
- }, this);
+ }
}, this);
}
return cpuUsage || [];
« no previous file with comments | « tracing/tracing/ui/extras/side_panel/input_latency_side_panel.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698