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

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

Issue 2334233003: Merge NumericValue into Histogram (Closed)
Patch Set: fix rail_power_metric Created 4 years, 3 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: 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 9349af7c82d3282854ac36d7d14f54f2bf43bf66..2a0a9bae3c1b56c5627aad879f45f16c06c8ec04 100644
--- a/tracing/tracing/metrics/cpu_process_metric.html
+++ b/tracing/tracing/metrics/cpu_process_metric.html
@@ -7,7 +7,6 @@ found in the LICENSE file.
<link rel="import" href="/tracing/metrics/metric_registry.html">
<link rel="import" href="/tracing/value/histogram.html">
-<link rel="import" href="/tracing/value/value.html">
<script>
'use strict';
@@ -48,7 +47,7 @@ tr.exportTo('tr.metrics.sh', function() {
for (var [processName, processData] of processSums.entries()) {
if (!(processNumerics.has(processName))) {
processNumerics.set(processName, {
- numeric: new tr.v.Histogram(
+ numeric: new tr.v.Histogram('cpu:percent:' + processName,
tr.b.Unit.byName.normalizedPercentage_smallerIsBetter),
paths: new Set()
});
@@ -65,7 +64,7 @@ tr.exportTo('tr.metrics.sh', function() {
function cpuProcessMetric(values, model) {
var snapshots = getCpuSnapshotsFromModel(model);
var processNumerics = buildNumericsFromSnapshots(snapshots);
- for (var [processName, processData] of processNumerics.entries()) {
+ for (var [processName, processData] of processNumerics) {
var numeric = processData.numeric;
// Treat missing snapshots as zeros. A process is missing from a snapshots
// when its CPU usage was below minimum threshold when the snapshot was
@@ -73,10 +72,9 @@ tr.exportTo('tr.metrics.sh', function() {
var missingSnapshotCount = snapshots.length - numeric.numValues;
for (var i = 0; i < missingSnapshotCount; i++)
numeric.addSample(0);
- var value = new tr.v.NumericValue('cpu:percent:' + processName, numeric);
- value.diagnostics.set('paths', new
+ numeric.diagnostics.set('paths', new
tr.v.d.Generic([...processData.paths]));
- values.addValue(value);
+ values.addHistogram(numeric);
}
}
« no previous file with comments | « tracing/tracing/metrics/blink/gc_metric_test.html ('k') | tracing/tracing/metrics/cpu_process_metric_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698