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

Unified Diff: tracing/tracing/metrics/system_health/rail_power_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/system_health/rail_power_metric.html
diff --git a/tracing/tracing/metrics/system_health/rail_power_metric.html b/tracing/tracing/metrics/system_health/rail_power_metric.html
index eb38083f1e44cf472edb62eeb82d5585ba91df89..7c561344a82430e3f3f456d63afc445463845702 100644
--- a/tracing/tracing/metrics/system_health/rail_power_metric.html
+++ b/tracing/tracing/metrics/system_health/rail_power_metric.html
@@ -9,7 +9,6 @@ found in the LICENSE file.
<link rel="import" href="/tracing/metrics/metric_registry.html">
<link rel="import" href="/tracing/metrics/system_health/clock_sync_latency_metric.html">
<link rel="import" href="/tracing/value/histogram.html">
-<link rel="import" href="/tracing/value/value.html">
<script>
'use strict';
@@ -25,12 +24,18 @@ tr.exportTo('tr.metrics.sh', function() {
for (var exp of model.userModel.expectations) {
var currTitle = exp.title.toLowerCase().replace(' ', '_');
if (!railStageToTimeHist.has(currTitle)) {
- var timeHist = new tr.v.Histogram(
- tr.b.Unit.byName.timeDurationInMs_smallerIsBetter)
- var energyHist = new tr.v.Histogram(
- tr.b.Unit.byName.energyInJoules_smallerIsBetter)
- var powerHist = new tr.v.Histogram(
- tr.b.Unit.byName.powerInWatts_smallerIsBetter)
+ var timeHist = new tr.v.Histogram('time:' + currTitle,
+ tr.b.Unit.byName.timeDurationInMs_smallerIsBetter);
+ timeHist.description = 'Time spent in RAIL stage ' + currTitle;
+
+ var energyHist = new tr.v.Histogram('energy:' + currTitle,
+ tr.b.Unit.byName.energyInJoules_smallerIsBetter);
+ energyHist.description = 'Energy consumed by RAIL stage ' + currTitle;
+
+ var powerHist = new tr.v.Histogram('power:' + currTitle,
+ tr.b.Unit.byName.powerInWatts_smallerIsBetter);
+ powerHist.description =
+ 'Energy consumption rate by RAIL stage ' + currTitle;
timeHist.customizeSummaryOptions({
avg: false,
@@ -62,6 +67,10 @@ tr.exportTo('tr.metrics.sh', function() {
railStageToTimeHist.set(currTitle, timeHist);
railStageToEnergyHist.set(currTitle, energyHist);
railStageToPowerHist.set(currTitle, powerHist);
+
+ values.addHistogram(timeHist);
+ values.addHistogram(energyHist);
+ values.addHistogram(powerHist);
}
var durationInMs = exp.duration;
var durationInS = tr.b.convertUnit(durationInMs,
@@ -74,20 +83,6 @@ tr.exportTo('tr.metrics.sh', function() {
railStageToEnergyHist.get(currTitle).addSample(energyInJ);
railStageToPowerHist.get(currTitle).addSample(powerInW);
}
-
- for (var title of railStageToTimeHist.keys()) {
- values.addValue(new tr.v.NumericValue('time:' + title,
- railStageToTimeHist.get(title),
- {description: 'Time spent in RAIL stage ' + title}));
-
- values.addValue(new tr.v.NumericValue('energy:' + title,
- railStageToEnergyHist.get(title),
- {description: 'Energy consumed by RAIL stage ' + title}));
-
- values.addValue(new tr.v.NumericValue('power:' + title,
- railStageToPowerHist.get(title),
- {description: 'Energy consumption rate by RAIL stage ' + title}));
- }
}
tr.metrics.MetricRegistry.register(railPowerMetric);

Powered by Google App Engine
This is Rietveld 408576698