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

Unified Diff: tracing/tracing/metrics/cpu_process_metric.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/metrics/compare_samples_cmdline.html ('k') | tracing/tracing/metrics/discover_cmdline.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/metrics/cpu_process_metric.html
diff --git a/tracing/tracing/metrics/cpu_process_metric.html b/tracing/tracing/metrics/cpu_process_metric.html
index 67f52a7201b3a00daf7b0086a3f5fe7bb29f4d67..c108191e34e08e21d42b2f9e1dde884eac5588e9 100644
--- a/tracing/tracing/metrics/cpu_process_metric.html
+++ b/tracing/tracing/metrics/cpu_process_metric.html
@@ -17,10 +17,11 @@ tr.exportTo('tr.metrics.sh', function() {
for (var pid in model.processes) {
var snapshotInstances = model.processes[pid].objects.getAllInstancesNamed(
'CPUSnapshots');
- if (!snapshotInstances)
- continue;
- for (var object of snapshotInstances[0].snapshots)
+ if (!snapshotInstances) continue;
+
+ for (var object of snapshotInstances[0].snapshots) {
snapshots.push(object.args.processes);
+ }
}
return snapshots;
}
@@ -29,13 +30,15 @@ tr.exportTo('tr.metrics.sh', function() {
var processSums = new Map();
for (var processData of snapshot) {
var processName = processData.name;
- if (!(processSums.has(processName)))
+ if (!(processSums.has(processName))) {
processSums.set(processName, {sum: 0.0, paths: new Set()});
+ }
processSums.get(processName).sum += parseFloat(processData.pCpu);
// The process path may be missing on Windows because of AccessDenied
// error thrown by psutil package used by CPU tracing agent.
- if (processData.path)
+ if (processData.path) {
processSums.get(processName).paths.add(processData.path);
+ }
}
return processSums;
}
@@ -54,8 +57,9 @@ tr.exportTo('tr.metrics.sh', function() {
}
processNumerics.get(processName).numeric.addSample(
processData.sum / 100.0);
- for (var path of processData.paths)
+ for (var path of processData.paths) {
processNumerics.get(processName).paths.add(path);
+ }
}
}
return processNumerics;
@@ -70,8 +74,9 @@ tr.exportTo('tr.metrics.sh', function() {
// when its CPU usage was below minimum threshold when the snapshot was
// taken.
var missingSnapshotCount = snapshots.length - numeric.numValues;
- for (var i = 0; i < missingSnapshotCount; i++)
+ for (var i = 0; i < missingSnapshotCount; i++) {
numeric.addSample(0);
+ }
numeric.diagnostics.set('paths', new
tr.v.d.Generic([...processData.paths]));
histograms.addHistogram(numeric);
« no previous file with comments | « tracing/tracing/metrics/compare_samples_cmdline.html ('k') | tracing/tracing/metrics/discover_cmdline.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698