| 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/base/base.html"> | 8 <link rel="import" href="/tracing/base/base.html"> |
| 9 <link rel="import" href="/tracing/base/iteration_helpers.html"> | 9 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
| 10 <link rel="import" | 10 <link rel="import" href="/tracing/base/xhr.html"> |
| 11 href="/tracing/metrics/system_health/system_health_metric.html"> | |
| 12 <link rel="import" href="/tracing/ui/extras/deep_reports/scalar_value.html"> | 11 <link rel="import" href="/tracing/ui/extras/deep_reports/scalar_value.html"> |
| 13 <link rel="import" href="/tracing/base/xhr.html"> | |
| 14 | 12 |
| 15 <script> | 13 <script> |
| 16 'use strict'; | 14 'use strict'; |
| 17 | 15 |
| 18 tr.exportTo('tr.ui.e.deep_reports', function() { | 16 tr.exportTo('tr.ui.e.deep_reports', function() { |
| 19 /** | 17 /** |
| 20 * Runs deep reports on the provided files, and pushes telemetry-style | 18 * Runs deep reports on the provided files, and pushes telemetry-style |
| 21 * values to the results object. | 19 * values to the results object. |
| 22 */ | 20 */ |
| 23 function main(results, filesInDir) { | 21 function main(results, filesInDir) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 48 try { | 46 try { |
| 49 m.importTraces([trace], io); | 47 m.importTraces([trace], io); |
| 50 } catch (e) { | 48 } catch (e) { |
| 51 throw new Error('While loading ' + filename + ' got: ' + e.toString()); | 49 throw new Error('While loading ' + filename + ' got: ' + e.toString()); |
| 52 } | 50 } |
| 53 return m; | 51 return m; |
| 54 }); | 52 }); |
| 55 } | 53 } |
| 56 | 54 |
| 57 function processModel(results, page, model) { | 55 function processModel(results, page, model) { |
| 58 var score = tr.metrics.sh.SystemHealthMetric.forModel(model); | |
| 59 if (score === undefined) | |
| 60 return; | |
| 61 | |
| 62 results.addValue( | 56 results.addValue( |
| 63 new tr.ui.e.deep_reports.ScalarValue( | 57 new tr.ui.e.deep_reports.ScalarValue( |
| 64 page, 'numRailIRs', 'ms', model.userModel.expectations.length)); | 58 page, 'numRailIRs', 'ms', model.userModel.expectations.length)); |
| 65 results.addValue( | |
| 66 new tr.ui.e.deep_reports.ScalarValue( | |
| 67 page, 'railScore', 'rails', score)); | |
| 68 } | 59 } |
| 69 | 60 |
| 70 return { | 61 return { |
| 71 main: main | 62 main: main |
| 72 }; | 63 }; |
| 73 }); | 64 }); |
| 74 </script> | 65 </script> |
| OLD | NEW |