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

Side by Side Diff: tracing/tracing/metrics/system_health/power_metric.html

Issue 2283213002: Rename Histogram.add() to addSample(). (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/base/statistics.html"> 8 <link rel="import" href="/tracing/base/statistics.html">
9 <link rel="import" href="/tracing/metrics/metric_registry.html"> 9 <link rel="import" href="/tracing/metrics/metric_registry.html">
10 <link rel="import" href="/tracing/metrics/system_health/clock_sync_latency_metri c.html"> 10 <link rel="import" href="/tracing/metrics/system_health/clock_sync_latency_metri c.html">
(...skipping 14 matching lines...) Expand all
25 var frameEnergyConsumedInJ = new tr.v.Histogram( 25 var frameEnergyConsumedInJ = new tr.v.Histogram(
26 tr.v.Unit.byName.energyInJoules_smallerIsBetter, 26 tr.v.Unit.byName.energyInJoules_smallerIsBetter,
27 tr.v.HistogramBinBoundaries.createLinear(0, 0.5, 20)); 27 tr.v.HistogramBinBoundaries.createLinear(0, 0.5, 20));
28 28
29 var frameStartTs = parseFloat(model.device.powerSeries.samples[0].start); 29 var frameStartTs = parseFloat(model.device.powerSeries.samples[0].start);
30 while (model.device.powerSeries.getSamplesWithinRange( 30 while (model.device.powerSeries.getSamplesWithinRange(
31 frameStartTs, frameStartTs + IDEAL_FRAME_DURATION_MS).length) { 31 frameStartTs, frameStartTs + IDEAL_FRAME_DURATION_MS).length) {
32 var currentFrameEnergy = model.device.powerSeries.getEnergyConsumedInJ( 32 var currentFrameEnergy = model.device.powerSeries.getEnergyConsumedInJ(
33 frameStartTs, frameStartTs + IDEAL_FRAME_DURATION_MS); 33 frameStartTs, frameStartTs + IDEAL_FRAME_DURATION_MS);
34 frameStartTs += IDEAL_FRAME_DURATION_MS; 34 frameStartTs += IDEAL_FRAME_DURATION_MS;
35 frameEnergyConsumedInJ.add(currentFrameEnergy); 35 frameEnergyConsumedInJ.addSample(currentFrameEnergy);
36 } 36 }
37 37
38 valueList.addValue(new tr.v.NumericValue( 38 valueList.addValue(new tr.v.NumericValue(
39 'energy_consumed_per_frame', frameEnergyConsumedInJ, 39 'energy_consumed_per_frame', frameEnergyConsumedInJ,
40 {description: 'Energy consumption per frame in joules'})); 40 {description: 'Energy consumption per frame in joules'}));
41 } 41 }
42 42
43 function powerMetric(valueList, model) { 43 function powerMetric(valueList, model) {
44 if (!model.device.powerSeries) 44 if (!model.device.powerSeries)
45 return; 45 return;
46 46
47 energyConsumedPerFrame(valueList, model); 47 energyConsumedPerFrame(valueList, model);
48 } 48 }
49 49
50 tr.metrics.MetricRegistry.register(powerMetric); 50 tr.metrics.MetricRegistry.register(powerMetric);
51 51
52 return { 52 return {
53 powerMetric: powerMetric 53 powerMetric: powerMetric
54 }; 54 };
55 }); 55 });
56 </script> 56 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/metrics/system_health/memory_metric.html ('k') | tracing/tracing/metrics/system_health/rail_power_metric.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698