Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: appengine_apps/trooper_o_matic/model/cq-graph.html

Issue 774323002: Moved trooper_o_matic to appengine/ (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 <script>
8 function CQGraph(heading, unit, itemUnit, data, alerts, itemAlertThreshold) {
9 this.heading = heading;
10 this.unit = unit;
11 this.itemUnit = itemUnit;
12 this.data = data;
13 this.alerts = alerts || {};
14 this.itemAlertThreshold =
15 itemAlertThreshold !== undefined ? itemAlertThreshold : Infinity;
16 }
17
18 CQGraph.prototype.breachedItems = function(col, threshold) {
19 return this.data.get().then(function(data) {
20 var colIndex = data.cols.indexOf(col);
21 var items = [];
22 data.rows.forEach(function(row, i) {
23 if (row[colIndex] >= threshold) {
24 items.push({
25 timestamp: row[0],
26 value: row[colIndex],
27 index: i,
28 });
29 }
30 });
31 return items;
32 });
33 };
34 </script>
OLDNEW
« no previous file with comments | « appengine_apps/trooper_o_matic/makefile ('k') | appengine_apps/trooper_o_matic/model/cq-graph-item.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698