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

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

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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/value/numeric.html"> 11 <link rel="import" href="/tracing/value/numeric.html">
11 <link rel="import" href="/tracing/value/value.html"> 12 <link rel="import" href="/tracing/value/value.html">
12 13
13 <script> 14 <script>
14 'use strict'; 15 'use strict';
15 16
16 tr.exportTo('tr.metrics.sh', function() { 17 tr.exportTo('tr.metrics.sh', function() {
17 18
18 var IDEAL_FRAME_RATE = 60; 19 var IDEAL_FRAME_RATE = 60;
19 var IDEAL_FRAME_DURATION = 1000 / IDEAL_FRAME_RATE; 20 var IDEAL_FRAME_DURATION = 1000 / IDEAL_FRAME_RATE;
(...skipping 10 matching lines...) Expand all
30 frameStartTs += IDEAL_FRAME_DURATION; 31 frameStartTs += IDEAL_FRAME_DURATION;
31 frameEnergyConsumed.add(currentFrameEnergy); 32 frameEnergyConsumed.add(currentFrameEnergy);
32 } 33 }
33 34
34 valueList.addValue(new tr.v.NumericValue( 35 valueList.addValue(new tr.v.NumericValue(
35 'energy_consumed_per_frame', frameEnergyConsumed, 36 'energy_consumed_per_frame', frameEnergyConsumed,
36 {description: 'Energy consumption per frame in joules'})); 37 {description: 'Energy consumption per frame in joules'}));
37 } 38 }
38 39
39 function powerMetric(valueList, model) { 40 function powerMetric(valueList, model) {
41 // TODO(alexandermont): Once it's possible to specify multiple metrics
42 // in a Telemetry benchmark, separate out this metric from the power
43 // metric and have the benchmark use both.
44 // (See: https://github.com/catapult-project/catapult/issues/2430.)
40 if (!model.device.powerSeries) 45 if (!model.device.powerSeries)
41 return; 46 return;
42 energyConsumedPerFrame(valueList, model); 47 energyConsumedPerFrame(valueList, model);
43 } 48 }
44 49
45 tr.metrics.MetricRegistry.register(powerMetric); 50 tr.metrics.MetricRegistry.register(powerMetric);
46 51
47 return { 52 return {
48 powerMetric: powerMetric 53 powerMetric: powerMetric
49 }; 54 };
50 }); 55 });
51 </script> 56 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698