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

Unified Diff: appengine_apps/trooper_o_matic/model/cqstats-graph-data.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 side-by-side diff with in-line comments
Download patch
Index: appengine_apps/trooper_o_matic/model/cqstats-graph-data.html
diff --git a/appengine_apps/trooper_o_matic/model/cqstats-graph-data.html b/appengine_apps/trooper_o_matic/model/cqstats-graph-data.html
deleted file mode 100644
index 732cd035c7158ad093670245811523e578e718de..0000000000000000000000000000000000000000
--- a/appengine_apps/trooper_o_matic/model/cqstats-graph-data.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!--
-Copyright 2014 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-
-<link rel="import" href="../lib/log.html">
-<link rel="import" href="../lib/net.html">
-<link rel="import" href="../lib/cqstats-util.html">
-
-<script>
-function CQStatsGraphData(name, cqStatsListPromise) {
- this.rowItemsAvailable = true;
- this._name = name;
- this._cqStatsListPromise = cqStatsListPromise;
- this._formattedDataPromise = cqStatsListPromise.then(
- this._formatCQStatsList.bind(this));
-}
-
-CQStatsGraphData.createBatch = function(
- project, intervalMinutes, names, count) {
- var cqStatsListPromise = cqStatsUtil.loadStats(
- project, intervalMinutes, names, count).catch(log);
- return names.map(function(name) {
- return new CQStatsGraphData(name, cqStatsListPromise);
- });
-};
-
-CQStatsGraphData.prototype._formatCQStatsList = function(cqStatsList) {
- var name = this._name;
- return {
- cols: ['timestamp', 'max', 'p90', 'p50', 'min', 'mean'],
- rows: cqStatsList.map(function(cqStats) {
- var stat = null;
- cqStats.stats.forEach(function(testStat) {
- if (testStat.name === name) {
- stat = testStat;
- }
- });
- // Convert timestamps to Date objects and seconds to minutes.
- return [
- new Date(cqStats.end * 1000),
- stat.max / 60,
- stat.percentile_90 / 60,
- stat.percentile_50 / 60,
- stat.min / 60,
- stat.mean / 60,
- ];
- }),
- };
-}
-
-CQStatsGraphData.prototype.get = function() {
- return this._formattedDataPromise;
-};
-
-CQStatsGraphData.prototype.rowItems = function(index) {
- var name = this._name;
- return this._cqStatsListPromise.then(function(cqStatsList) {
- var cqStats = cqStatsList[index];
- return cqStatsUtil.loadStatItems(name, cqStats.key).then(function(items) {
- // Convert seconds to minutes.
- items.forEach(function(item) { item[0] /= 60; });
- return {
- items: items,
- begin: new Date(cqStats.begin * 1000),
- end: new Date(cqStats.end * 1000),
- };
- });
- })
-};
-</script>

Powered by Google App Engine
This is Rietveld 408576698