2 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
26 BubbleQueueServer = function()
29 "commit-queue": {platform: Dashboard.Platform.MacOSXMavericks, shortName: "commit", title: "Commit Queue"},
30 "style-queue": {shortName: "style", title: "Style Checker Queue"},
31 "gtk-wk2-ews": {platform: Dashboard.Platform.LinuxGTK, shortName: "gtk-wk2", title: "WebKit2\xa0Release\xa0Build\xa0EWS"},
32 "ios-ews": {platform: Dashboard.Platform.iOS9Device, shortName: "ios", title: "WebKit\xa0Release\xa0Build\xa0EWS"},
33 "mac-ews": {platform: Dashboard.Platform.MacOSXMavericks, shortName: "mac", title: "WebKit1\xa0Release\xa0Tests\xa0EWS"},
34 "mac-wk2-ews": {platform: Dashboard.Platform.MacOSXMavericks, shortName: "mac-wk2", title: "WebKit2\xa0Release\xa0Tests\xa0EWS"},
35 "win-ews": {platform: Dashboard.Platform.Windows7, shortName: "win", title: "WebKit1\xa0Release\xa0Build\xa0EWS"},
36 "efl-wk2-ews": {platform: Dashboard.Platform.LinuxEFL, shortName: "efl-wk2", title: "WebKit2\xa0Release\xa0Build\xa0EWS"}
39 BaseObject.call(this);
41 this.baseURL = "https://webkit-queues.webkit.org/";
44 for (var id in queueInfo)
45 this.queues[id] = new BubbleQueue(this, id, queueInfo[id]);
48 BaseObject.addConstructorFunctions(BubbleQueueServer);
50 BubbleQueueServer.prototype = {
51 constructor: BubbleQueueServer,
52 __proto__: BaseObject.prototype,
54 jsonQueueLengthURL: function(queueID)
56 return this.baseURL + "queue-length-json/" + encodeURIComponent(queueID);
59 jsonQueueStatusURL: function(queueID)
61 return this.baseURL + "queue-status-json/" + encodeURIComponent(queueID);
64 jsonProcessingTimesURL: function(fromTime, toTime)
66 return this.baseURL + "processing-times-json/" + [fromTime.getUTCFullYear(), fromTime.getUTCMonth() + 1, fromTime.getUTCDate(), fromTime.getUTCHours(), fromTime.getUTCMinutes(), fromTime.getUTCSeconds()].join("-")
67 + "-" + [toTime.getUTCFullYear(), toTime.getUTCMonth() + 1, toTime.getUTCDate(), toTime.getUTCHours(), toTime.getUTCMinutes(), toTime.getUTCSeconds()].join("-");
70 queueStatusURL: function(queueID)
72 return this.baseURL + "queue-status/" + encodeURIComponent(queueID);
75 // Retrieves information about all patches that were submitted in the time range:
79 // date: <date/time when the patch was submitted to the queue>,
80 // retry_count: <number of times a bot had to bail out and drop the lock, for another bot to start from scratch>,
81 // wait_duration: <how long it took before a bot first locked the patch for processing>,
82 // process_duration: <how long it took from end of wait to finish, only valid for finished patches. Includes wait time between retries>
83 // final_message: <(pass|fail|not processed|could not apply|internal error|in progress)>
89 loadProcessingTimes: function(fromTime, toTime, callback)
91 JSON.load(this.jsonProcessingTimesURL(fromTime, toTime), function(data) {
94 queue.date = new Date(queue.date);
96 callback(data, fromTime, toTime);