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

Unified Diff: masters/master.chromium/public_html/gantt_chart.js

Issue 2489813002: Revert of Adding gantt chart to Build Status page on Buildbot Masters (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « masters/master.chromium.perf.fyi/templates/build.html ('k') | masters/master.chromium/templates/build.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: masters/master.chromium/public_html/gantt_chart.js
diff --git a/masters/master.chromium/public_html/gantt_chart.js b/masters/master.chromium/public_html/gantt_chart.js
deleted file mode 100644
index 21832cc6a38e270d932155002eeff881ff23a64f..0000000000000000000000000000000000000000
--- a/masters/master.chromium/public_html/gantt_chart.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2016 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.
-google.charts.load('current', {'packages':['gantt']});
-
-/**
- * reconcileSwarmingSteps reconciles a Swarming step's "trigger" step with
- * it's subsequent "collect results" step.
- *
- * Swarming steps in BuildBot create two steps - one to trigger the work
- * on swarming, and a later step to collect the results.
- *
- * The two steps have the same name, except the trigger step has "[trigger] "
- * prepended to the name.
- *
- * This function consolidates the two steps into one by using the start
- * time from the trigger step and the end time from the "collect results"
- * step.
- *
- * This function assumes that a trigger step will be found before the
- * corresponding "collect results" step in the list of steps.
- * @param {Array<Object>} steps List of step objects. Each step object
- * has the following properties: name {string}, start {Date}, end {Date}
- */
-function reconcileSwarmingSteps(steps) {
- let reconciledSteps = [];
- let triggerSteps = {};
-
- for (let s of steps) {
- // trigger steps have names like "[trigger] TheRestOfTheNameGoesHere..."
- let isTriggerStep = /\[trigger\] (.*)/.exec(s.name);
- if (isTriggerStep) {
- triggerSteps[isTriggerStep[1]] = s;
- } else {
- if (triggerSteps[s.name]) {
- s.start = triggerSteps[s.name].start;
- }
- reconciledSteps.push(s);
- }
- }
-
- return reconciledSteps;
-};
-
-function drawChart(steps) {
- let data = new google.visualization.DataTable();
- data.addColumn('string', 'Task ID');
- data.addColumn('string', 'Task Name');
- data.addColumn('string', 'Resource');
- data.addColumn('date', 'Start Date');
- data.addColumn('date', 'End Date');
- data.addColumn('number', 'Duration');
- data.addColumn('number', 'Percent Complete');
- data.addColumn('string', 'Dependencies');
-
- for (s of steps) {
- data.addRow([s.name, s.name, null, s.start, s.end, null, 100, null]);
- }
-
- let trackHeight = 25;
- let options = {
- height: data.getNumberOfRows() * trackHeight,
- gantt: {
- trackHeight: trackHeight,
- barHeight: trackHeight * 0.8,
- labelMaxWidth: 500,
- }
- };
-
- let chart = new google.visualization.Gantt(
- document.getElementById('chart_div'));
- chart.draw(data, options);
-}
-
-let chartVisible = false;
-function toggleChart(rawSteps) {
- if (chartVisible) {
- document.getElementById('chart_div').style.display = 'none';
- chartVisible = false;
- } else {
- document.getElementById('chart_div').style.display = 'block';
- let steps = reconcileSwarmingSteps(rawSteps);
- drawChart(steps);
- chartVisible = true;
- }
-}
« no previous file with comments | « masters/master.chromium.perf.fyi/templates/build.html ('k') | masters/master.chromium/templates/build.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698