| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 Copyright (c) 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 | |
| 9 <script> | |
| 10 var cqStatsUtil = cqStatsUtil || {}; | |
| 11 | |
| 12 (function() { | |
| 13 var cqLogHost = 'https://chromium-cq-status.appspot.com'; | |
| 14 | |
| 15 cqStatsUtil.loadStats = function(project, intervalMinutes, names, count) { | |
| 16 var url = '{1}/stats/query?{2}'.assign(cqLogHost, Object.toQueryString({ | |
| 17 project: project, | |
| 18 interval_minutes: intervalMinutes, | |
| 19 names: names.join(','), | |
| 20 count: count, | |
| 21 })); | |
| 22 return net.json({url: url}).then(function(json) { | |
| 23 return json.results.reverse(); | |
| 24 }); | |
| 25 }; | |
| 26 | |
| 27 cqStatsUtil.loadStatItems = function(statName, cqStatsKey) { | |
| 28 var url = '{1}/stats/highest/{2}/{3}'.assign(cqLogHost, statName, cqStatsKey); | |
| 29 return net.json({url: url, cache: true}); | |
| 30 }; | |
| 31 | |
| 32 cqStatsUtil.namedStat = function(name, cqStats) { | |
| 33 return cqStats.stats.find(function(stat) { | |
| 34 return stat.name === name; | |
| 35 }); | |
| 36 }; | |
| 37 })(); | |
| 38 </script> | |
| OLD | NEW |