| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 # Copyright 2015 The LUCI Authors. All rights reserved. | |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | |
| 4 # that can be found in the LICENSE file. | |
| 5 | |
| 6 --> | |
| 7 | |
| 8 <!-- | |
| 9 @group Swarming Elements | |
| 10 | |
| 11 `stats-overview' displays an overview of the last 20 minutes stats. | |
| 12 | |
| 13 @element stats-overview | |
| 14 --> | |
| 15 | |
| 16 <link rel="import" href="bower_components/polymer/polymer.html"> | |
| 17 <link rel="import" href="bower_components/core-ajax/core-ajax.html"> | |
| 18 | |
| 19 <link rel="import" href="stats-request-chart.html"> | |
| 20 <link rel="import" href="stats-work-chart.html"> | |
| 21 <link rel="import" href="stats-time-chart.html"> | |
| 22 | |
| 23 <polymer-element name="stats-overview" attributes="dimensions" layout vertical> | |
| 24 <template> | |
| 25 <core-ajax id="get_stats_summary" | |
| 26 headers='{"x-datasource-auth": "a"}' | |
| 27 url="/swarming/api/v1/stats/summary/minutes" | |
| 28 params='{"duration": "20"}' | |
| 29 handleAs="json" | |
| 30 on-core-response="{{onGetStatsSummarySuccess}}"> | |
| 31 </core-ajax> | |
| 32 | |
| 33 <div layout vertical> | |
| 34 <stats-work-chart | |
| 35 data="{{dataTable}}" | |
| 36 resolution="minutes"> | |
| 37 </stats-work-chart> | |
| 38 | |
| 39 <stats-time-chart | |
| 40 data="{{dataTable}}" | |
| 41 resolution="minutes"> | |
| 42 </stats-time-chart> | |
| 43 | |
| 44 <stats-request-chart | |
| 45 data="{{dataTable}}" | |
| 46 resolution="minutes"> | |
| 47 </stats-request-chart> | |
| 48 </div> | |
| 49 </template> | |
| 50 | |
| 51 <script> | |
| 52 Polymer('stats-overview', { | |
| 53 ready: function() { | |
| 54 this.$.get_stats_summary.go(); | |
| 55 }, | |
| 56 | |
| 57 onGetStatsSummarySuccess: function(event, detail, sender) { | |
| 58 this.dataTable = detail.response.table; | |
| 59 } | |
| 60 }); | |
| 61 </script> | |
| 62 </polymer-element> | |
| OLD | NEW |