OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright 2014 The Chromium Authors. All rights reserved. | |
3 Use of this source code is governed by a BSD-style license that can be | |
4 found in the LICENSE file. | |
5 --> | |
6 | |
7 <link rel="import" href="../lib/sugar.html"> | |
8 <link rel="import" href="../model/cq-graph.html"> | |
9 <link rel="import" href="../model/cqstats-graph-data.html"> | |
10 <link rel="import" href="../model/cqstats-ratio-graph-data.html"> | |
11 <link rel="import" href="../model/json-graph-data.html"> | |
12 <link rel="import" href="./tom-cq-graph.html"> | |
13 | |
14 <polymer-element name="tom-cq-graphs" attributes="project"> | |
15 <template> | |
16 <h1>Commit Queue Status</h1> | |
17 <template repeat="{{ graph in graphList }}"> | |
18 <tom-cq-graph graph="{{ graph }}"></tom-cq-graph> | |
19 </template> | |
20 </template> | |
21 <script> | |
22 Polymer({ | |
23 ready: function() { | |
24 this.graphList = [ | |
25 this._falseRejectGraph(), | |
26 this._timeGraphs(), | |
27 this._queueLengthGraph(), | |
28 ].flatten(); | |
29 }, | |
30 _timeGraphs: function() { | |
31 var intervalMinutes = 60; | |
32 var dataPointCount = 25; | |
33 var unit = 'minutes'; | |
34 var varying = [{ | |
35 heading: 'Times: Single Run', | |
36 statName: 'attempt-durations', | |
37 alerts: { | |
38 p90: 120, | |
39 mean: 60, | |
40 }, | |
41 itemAlertThreshold: 60, | |
42 }, { | |
43 heading: 'Times: Time in Queue Over All Runs', | |
44 statName: 'patchset-total-commit-queue-durations', | |
45 }, { | |
46 heading: 'Times: Time from Checking "Commit" Box to Complete', | |
47 statName: 'patchset-total-wall-time-durations', | |
48 }]; | |
49 var names = varying.map(function(item) { return item.statName }); | |
50 var dataList = CQStatsGraphData.createBatch( | |
51 this.project, intervalMinutes, names, dataPointCount); | |
52 return dataList.map(function(data, i) { | |
53 var graph = varying[i]; | |
54 return new CQGraph(graph.heading, unit, unit, data, graph.alerts, | |
55 graph.itemAlertThreshold); | |
56 }); | |
57 }, | |
58 _falseRejectGraph: function() { | |
59 var intervalMinutes = 60 * 24; | |
60 var dataPointCount = 30; | |
61 var data = new CQStatsRatioGraphData('false reject rate', this.project, | |
62 intervalMinutes, 'attempt-false-reject-count', 'attempt-count', | |
63 dataPointCount); | |
64 var alerts = { 'false reject rate': 1 }; | |
65 var itemAlertThreshold = 2; | |
66 return new CQGraph('False CQ Attempt Rejection Rate', | |
67 'percent', 'false rejects', data, alerts, itemAlertThreshold); | |
68 }, | |
69 _queueLengthGraph: function() { | |
70 var url = '/project/' + this.project + '/cq-length'; | |
71 return new CQGraph('Commit Queue Length', 'count', '', | |
72 new JSONGraphData(url)); | |
73 }, | |
74 }); | |
75 </script> | |
76 </polymer-element> | |
OLD | NEW |