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

Unified Diff: tracing/tracing/metrics/system_health/rail_power_metric.html

Issue 2333053002: Put all power metrics in one file. (Closed)
Patch Set: revert loading metric test 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
deleted file mode 100644
index 7c561344a82430e3f3f456d63afc445463845702..0000000000000000000000000000000000000000
--- a/tracing/tracing/metrics/system_health/rail_power_metric.html
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html>
-<!--
-Copyright 2016 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-
-<link rel="import" href="/tracing/base/statistics.html">
-<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">
-
-<script>
-'use strict';
-
-tr.exportTo('tr.metrics.sh', function() {
- function railPowerMetric(values, model) {
- if (!model.device.powerSeries)
- return;
- var railStageToTimeHist = new Map();
- var railStageToEnergyHist = new Map();
- var railStageToPowerHist = new Map();
-
- for (var exp of model.userModel.expectations) {
- var currTitle = exp.title.toLowerCase().replace(' ', '_');
- if (!railStageToTimeHist.has(currTitle)) {
- 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,
- count: false,
- max: true,
- min: true,
- std: false,
- sum: true,
- });
-
- energyHist.customizeSummaryOptions({
- avg: false,
- count: false,
- max: true,
- min: true,
- std: false,
- sum: true,
- });
-
- powerHist.customizeSummaryOptions({
- avg: true,
- count: false,
- max: true,
- min: true,
- std: false,
- sum: false,
- });
-
- 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,
- tr.b.UnitScale.Metric.MILLI, tr.b.UnitScale.Metric.NONE);
- var energyInJ = model.device.powerSeries.getEnergyConsumedInJ(
- exp.start, exp.end);
- var powerInW = energyInJ / durationInS;
-
- railStageToTimeHist.get(currTitle).addSample(durationInMs);
- railStageToEnergyHist.get(currTitle).addSample(energyInJ);
- railStageToPowerHist.get(currTitle).addSample(powerInW);
- }
- }
-
- tr.metrics.MetricRegistry.register(railPowerMetric);
-
- return {
- railPowerMetric: railPowerMetric
- };
-});
-</script>

Powered by Google App Engine
This is Rietveld 408576698