| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 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/metrics/system_health/system_health_metric.htm
l"> | |
| 9 <link rel="import" href="/tracing/ui/analysis/analysis_sub_view.html"> | 8 <link rel="import" href="/tracing/ui/analysis/analysis_sub_view.html"> |
| 10 <link rel="import" href="/tracing/ui/analysis/single_event_sub_view.html"> | 9 <link rel="import" href="/tracing/ui/analysis/single_event_sub_view.html"> |
| 11 <link rel="import" href="/tracing/value/ui/time_duration_span.html"> | 10 <link rel="import" href="/tracing/value/ui/time_duration_span.html"> |
| 12 | 11 |
| 13 <polymer-element name="tr-ui-a-single-user-expectation-sub-view" | 12 <polymer-element name="tr-ui-a-single-user-expectation-sub-view" |
| 14 extends="tr-ui-a-sub-view"> | 13 extends="tr-ui-a-sub-view"> |
| 15 <script> | 14 <script> |
| 16 'use strict'; | 15 'use strict'; |
| 17 | 16 |
| 18 var ResponsivenessMetric = tr.metrics.sh.ResponsivenessMetric; | 17 var ResponsivenessMetric = tr.metrics.sh.ResponsivenessMetric; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 43 get relatedEventsToHighlight() { | 42 get relatedEventsToHighlight() { |
| 44 if (!this.currentSelection_) | 43 if (!this.currentSelection_) |
| 45 return undefined; | 44 return undefined; |
| 46 return this.currentSelection_[0].associatedEvents; | 45 return this.currentSelection_[0].associatedEvents; |
| 47 }, | 46 }, |
| 48 | 47 |
| 49 onCustomizeRows_: function(event) { | 48 onCustomizeRows_: function(event) { |
| 50 var ir = this.selection[0]; | 49 var ir = this.selection[0]; |
| 51 | 50 |
| 52 var metrics = [ | 51 var metrics = [ |
| 53 {name: 'System Health', metric: SystemHealthMetric}, | |
| 54 {name: 'Responsiveness', metric: ResponsivenessMetric}, | 52 {name: 'Responsiveness', metric: ResponsivenessMetric}, |
| 55 {name: 'Efficiency', metric: EfficiencyMetric}]; | 53 {name: 'Efficiency', metric: EfficiencyMetric}]; |
| 56 | 54 |
| 57 metrics.forEach(function(spec) { | 55 metrics.forEach(function(spec) { |
| 58 var score = spec.metric.forExpectation(ir); | 56 var score = spec.metric.forExpectation(ir); |
| 59 if (score === undefined) | 57 if (score === undefined) |
| 60 return; | 58 return; |
| 61 | 59 |
| 62 event.rows.push({ | 60 event.rows.push({ |
| 63 name: spec.name, | 61 name: spec.name, |
| 64 value: tr.ui.b.toThreeDigitLocaleString(score) | 62 value: tr.ui.b.toThreeDigitLocaleString(score) |
| 65 }); | 63 }); |
| 66 }); | 64 }); |
| 67 | 65 |
| 68 if (ir.rawCpuMs) { | 66 if (ir.rawCpuMs) { |
| 69 var cpuEl = document.createElement('tr-v-ui-time-duration-span'); | 67 var cpuEl = document.createElement('tr-v-ui-time-duration-span'); |
| 70 cpuEl.duration = ir.totalCpuMs; | 68 cpuEl.duration = ir.totalCpuMs; |
| 71 event.rows.push({name: 'Total CPU', value: cpuEl}); | 69 event.rows.push({name: 'Total CPU', value: cpuEl}); |
| 72 } | 70 } |
| 73 } | 71 } |
| 74 }); | 72 }); |
| 75 </script> | 73 </script> |
| 76 </polymer-element> | 74 </polymer-element> |
| OLD | NEW |