| OLD | NEW | 
|---|
|  | (Empty) | 
| 1 <!-- |  | 
| 2 # Copyright 2016 The LUCI Authors. All rights reserved. |  | 
| 3 # Use of this source code is governed by the Apache v2.0 license that can be |  | 
| 4 # found in the LICENSE file. |  | 
| 5 --> |  | 
| 6 |  | 
| 7 <link rel="import" href="../bower_components/polymer/polymer.html"> |  | 
| 8 <link rel="import" href="../bower_components/iron-ajax/iron-ajax.html"> |  | 
| 9 <link rel="import" href="../bower_components/iron-flex-layout/iron-flex-layout-c
    lasses.html"> |  | 
| 10 |  | 
| 11 <link rel="import" href="load-charts-api.html"> |  | 
| 12 <link rel="import" href="partial-line-chart.html"> |  | 
| 13 |  | 
| 14 <dom-module id="stats-overview"> |  | 
| 15   <style include="iron-flex iron-flex-alignment iron-positioning"> |  | 
| 16 |  | 
| 17   </style> |  | 
| 18 |  | 
| 19   <template> |  | 
| 20     <iron-ajax |  | 
| 21       auto url="/swarming/api/v1/stats/summary/minutes" |  | 
| 22       headers="[[headers]]" |  | 
| 23       params="[[params]]" |  | 
| 24       handle-as="json" |  | 
| 25       last-response="{{response}}"> |  | 
| 26     </iron-ajax> |  | 
| 27 |  | 
| 28     <load-charts-api loaded="{{charts_api_loaded}}"></load-charts-api> |  | 
| 29 |  | 
| 30     <div class="vertical layout charts"> |  | 
| 31 |  | 
| 32     <!-- These arrays are JSON, so they must use double quotes--> |  | 
| 33       <partial-line-chart |  | 
| 34         all_data="{{data_table}}" |  | 
| 35         resolution="minutes" |  | 
| 36         names='["bots_active","tasks_active","tasks_bot_died","tasks_request_exp
    ired"]' |  | 
| 37         title="Shards Activity"> |  | 
| 38       </partial-line-chart> |  | 
| 39 |  | 
| 40       <partial-line-chart |  | 
| 41         all_data="{{data_table}}" |  | 
| 42         resolution="minutes" |  | 
| 43         names='["tasks_avg_pending_secs","tasks_total_runtime_secs","tasks_avg_r
    untime_secs"]' |  | 
| 44         title="Times"> |  | 
| 45       </partial-line-chart> |  | 
| 46 |  | 
| 47       <partial-line-chart |  | 
| 48         all_data="{{data_table}}" |  | 
| 49         resolution="minutes" |  | 
| 50         names='["http_requests","http_failures"]' |  | 
| 51         title="Requests"> |  | 
| 52       </partial-line-chart> |  | 
| 53 |  | 
| 54     </div> |  | 
| 55   </template> |  | 
| 56   <script> |  | 
| 57     Polymer({ |  | 
| 58       is: 'stats-overview', |  | 
| 59       properties: { |  | 
| 60         // input |  | 
| 61 |  | 
| 62         //output |  | 
| 63         data_table: { |  | 
| 64           type: Object, |  | 
| 65           computed: "_extractData(response,charts_api_loaded)", |  | 
| 66           notify: true, |  | 
| 67         }, |  | 
| 68 |  | 
| 69         //private |  | 
| 70         charts_api_loaded: { |  | 
| 71           type: Boolean, |  | 
| 72         }, |  | 
| 73         _headers: { |  | 
| 74           type: Object, |  | 
| 75           value: { |  | 
| 76             "x-datasource-auth": "a", |  | 
| 77           }, |  | 
| 78         }, |  | 
| 79         params: { |  | 
| 80           type: Object, |  | 
| 81           value: { |  | 
| 82             duration: 20, |  | 
| 83           }, |  | 
| 84         }, |  | 
| 85         response: { |  | 
| 86           type: Object, |  | 
| 87         }, |  | 
| 88       }, |  | 
| 89 |  | 
| 90       _extractData: function (_response, ready) { |  | 
| 91         return _response.table; |  | 
| 92       }, |  | 
| 93     }); |  | 
| 94   </script> |  | 
| 95 </dom-module> |  | 
| OLD | NEW | 
|---|