Changeset 174622 in webkit


Ignore:
Timestamp:
Oct 10, 2014 4:29:52 PM (10 years ago)
Author:
ap@apple.com
Message:

Dashboard metrics page should have EWS statistics
https://bugs.webkit.org/show_bug.cgi?id=137626

Reviewed by Ryosuke Niwa.

  • BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js:

(BubbleQueue): Put shortName in the object, so that it's actually useful.

  • BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:

(BubbleQueueServer): Re-ordered queues to match bubble order.
(BubbleQueueServer.prototype.jsonProcessingTimesURL): Added URL for the new handler.
(BubbleQueueServer.prototype.loadProcessingTimes): Load the data from webkit-queues.

  • BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js:

Added analysis for bubble queues.

  • BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js: Added.
  • BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js:

(buildBubbleQueuesTable): Build the UI.

  • BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html:

Added JS sources to load.

  • QueueStatusServer/app.yaml: To update app version.
  • QueueStatusServer/handlers/processingtimesjson.py: Added.
  • QueueStatusServer/main.py: Added a handler for processing-times-json.
Location:
trunk/Tools
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js

    r174366 r174622  
    3333    this.queueServer = queueServer;
    3434    this.id = id;
     35    this.shortName = info.shortName || id;
    3536    this.title = info.title || "\xa0";
    3637
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js

    r174366 r174622  
    2929        "commit-queue": {platform: Dashboard.Platform.MacOSXMountainLion, shortName: "commit", title: "Commit Queue"},
    3030        "style-queue": {shortName: "style", title: "Style Checker Queue"},
     31        "gtk-wk2-ews": {platform: Dashboard.Platform.LinuxGTK, shortName: "gtk-wk2", title: "WebKit2\xa0Release\xa0Build\xa0EWS"},
    3132        "mac-ews": {platform: Dashboard.Platform.MacOSXMountainLion, shortName: "mac", title: "WebKit1\xa0Release\xa0Tests\xa0EWS"},
    3233        "mac-wk2-ews": {platform: Dashboard.Platform.MacOSXMountainLion, shortName: "mac-wk2", title: "WebKit2\xa0Release\xa0Tests\xa0EWS"},
    3334        "win-ews": {platform: Dashboard.Platform.Windows7, shortName: "win", title: "WebKit1\xa0Release\xa0Build\xa0EWS"},
    34         "gtk-wk2-ews": {platform: Dashboard.Platform.LinuxGTK, shortName: "gtk-wk2", title: "WebKit2\xa0Release\xa0Build\xa0EWS"},
    3535        "efl-wk2-ews": {platform: Dashboard.Platform.LinuxEFL, shortName: "efl-wk2", title: "WebKit2\xa0Release\xa0Build\xa0EWS"}
    3636    };
     
    6161    },
    6262
     63    jsonProcessingTimesURL: function(fromTime, toTime)
     64    {
     65        return this.baseURL + "processing-times-json/" + [fromTime.getUTCFullYear(), fromTime.getUTCMonth() + 1, fromTime.getUTCDate(), fromTime.getUTCHours(), fromTime.getUTCMinutes(), fromTime.getUTCSeconds()].join("-")
     66            + "-" + [toTime.getUTCFullYear(), toTime.getUTCMonth() + 1, toTime.getUTCDate(), toTime.getUTCHours(), toTime.getUTCMinutes(), toTime.getUTCSeconds()].join("-");
     67    },
     68
    6369    queueStatusURL: function(queueID)
    6470    {
    6571        return this.baseURL + "queue-status/" + encodeURIComponent(queueID);
    6672    },
     73
     74    // Retrieves information about all patches that were submitted in the time range:
     75    // {
     76    //     patch_id_1: {
     77    //         queue_name_1: {
     78    //             date: <date/time when the patch was submitted to the queue>,
     79    //             retry_count: <number of times a bot had to bail out and drop the lock, for another bot to start from scratch>,
     80    //             wait_duration: <how long it took before a bot first locked the patch for processing>,
     81    //             process_duration: <how long it took from end of wait to finish, only valid for finished patches. Includes wait time between retries>
     82    //             final_message: <(pass|fail|not processed|could not apply|internal error|in progress)>
     83    //         },
     84    //         ...
     85    //     },
     86    //     ...
     87    // }
     88    loadProcessingTimes: function(fromTime, toTime, callback)
     89    {
     90        JSON.load(this.jsonProcessingTimesURL(fromTime, toTime), function(data) {
     91            for (patch in data) {
     92                for (queue in patch)
     93                    queue.date = new Date(queue.date);
     94            }
     95            callback(data, fromTime, toTime);
     96        }.bind(this));
     97    },
    6798};
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js

    r173381 r174622  
    7979
    8080        webkitTrac.load(this._rangeStartTime, this._rangeEndTime);
     81
     82        bubbleQueueServer.loadProcessingTimes(this._rangeStartTime, this._rangeEndTime, this._loadedBubblesTiming.bind(this));
    8183    },
    8284
     
    381383        if (this._hasTracData)
    382384            this._analyze();
    383     }
     385    },
     386
     387    _analyzeBubblePerformance: function(queueID, patches)
     388    {
     389        var patchesThatCausedInternalError = [];
     390        for (patchID in patches) {
     391            if (patches[patchID].resolution === "internal error")
     392                patchesThatCausedInternalError.push(patchID);
     393        }
     394
     395        var waitTimes = [];
     396        var totalTimes = [];
     397        var totalTimesForPatchesThatWereNotRetried = [];
     398        var totalTimesForPatchesThatSpinnedAndPassedOrFailed = [];
     399        var patchesThatDidNotComplete = [];
     400        var retryCounts = [];
     401        var patchesThatSpinnedAndDidNotComplete = [];
     402        var patchesThatSpinnedAndCeasedToApply = [];
     403        var patchesThatSpinnedAndPassedOrFailed = [];
     404        var patchesDidNotApply = [];
     405        for (patchID in patches) {
     406            var patch = patches[patchID];
     407
     408            // Wait time is equally interesting for all patches.
     409            waitTimes.push(patch.wait_duration);
     410
     411            if (patch.resolution === "not processed")
     412                patchesThatDidNotComplete.push(patchID);
     413
     414            if (patch.retry_count === 0)
     415                totalTimesForPatchesThatWereNotRetried.push(patch.wait_duration + patch.process_duration);
     416            else {
     417                retryCounts.push(patch.retry_count);
     418                if (patch.resolution === "not processed")
     419                    patchesThatSpinnedAndDidNotComplete.push(patchID);
     420                else if (patch.resolution === "could not apply")
     421                    patchesThatSpinnedAndCeasedToApply.push(patchID);
     422                else if (patch.resolution === "pass" || patch.resolution === "fail") {
     423                    patchesThatSpinnedAndPassedOrFailed.push(patchID);
     424                    totalTimesForPatchesThatSpinnedAndPassedOrFailed.push(patch.wait_duration + patch.process_duration);
     425                }
     426            }
     427
     428            // Analyze processing performance for patches that were definitely processed.
     429            // We can't target improving performance of others (such as patches that were obsoleted while in the queue).
     430            // Patches that don't apply to trunk have to be excluded, because otherwise we
     431            // get times for patches that spinned until they ceased to apply.
     432            if (patch.resolution === "pass" || patch.resolution === "fail")
     433                totalTimes.push(patch.wait_duration + patch.process_duration);
     434
     435            if (patch.resolution === "could not apply")
     436                patchesDidNotApply.push(patchID);
     437        }
     438
     439        var result = {
     440            queueID: queueID,
     441            totalPatches: Object.keys(patches).length,
     442            patchesThatDidNotCompleteCount: patchesThatDidNotComplete.length,
     443            patchesWithRetriesCount: retryCounts.length,
     444            patchesThatDidNotApplyCount: patchesDidNotApply.length,
     445            patchesThatSpinnedAndDidNotCompleteCount: patchesThatSpinnedAndDidNotComplete.length,
     446            patchesThatSpinnedAndCeasedToApplyCount: patchesThatSpinnedAndCeasedToApply.length,
     447            patchesThatSpinnedAndPassedOrFailedCount: patchesThatSpinnedAndPassedOrFailed.length,
     448            medianTotalTimeForPatchesThatSpinnedAndPassedOrFailedInSeconds: totalTimesForPatchesThatSpinnedAndPassedOrFailed.median(),
     449            averageTotalTimeForPatchesThatSpinnedAndPassedOrFailedInSeconds: totalTimesForPatchesThatSpinnedAndPassedOrFailed.average(),
     450            medianWaitTimeInSeconds: waitTimes.median(),
     451            averageWaitTimeInSeconds: waitTimes.average(),
     452            patchesThatCausedInternalError: patchesThatCausedInternalError,
     453        };
     454
     455        if (totalTimes.length) {
     456            result.medianTotalTimeInSeconds = totalTimes.median();
     457            result.averageTotalTimeInSeconds = totalTimes.average();
     458        }
     459
     460        if (totalTimesForPatchesThatWereNotRetried.length) {
     461            result.medianTotalTimeForPatchesThatWereNotRetriedInSeconds = totalTimesForPatchesThatWereNotRetried.median();
     462            result.averageTotalTimeForPatchesThatWereNotRetriedInSeconds = totalTimesForPatchesThatWereNotRetried.average();
     463        }
     464
     465        this.dispatchEventToListeners(Analyzer.Event.QueueResults, result);
     466    },
     467
     468    _analyzeAllBubblesPerformance: function(dataByPatch)
     469    {
     470        var data = {};
     471        for (queueID in bubbleQueueServer.queues)
     472            data[queueID] = {};
     473
     474        for (patchID in dataByPatch) {
     475            for (queueID in dataByPatch[patchID]) {
     476                if (!queueID in data)
     477                    continue;
     478                var patchData = dataByPatch[patchID][queueID];
     479                if (patchData.date < this.fromDate || patchData.date > this.toDate)
     480                    continue;
     481                if (patchData.resolution === "in progress")
     482                    continue;
     483                data[queueID][patchID] = patchData;
     484            };
     485        };
     486        for (queueID in data)
     487            this._analyzeBubblePerformance(queueID, data[queueID]);
     488    },
     489
     490    _loadedBubblesTiming: function(data, fromTime, toTime)
     491    {
     492        // Only analyze if the data covers the latest range requested by the user.
     493        // It may be different from the loaded one if the user quickly requested multiple ranges.
     494        if (fromTime > this._rangeStartTime || toTime < this._rangeEndTime)
     495            return;
     496        this._analyzeAllBubblesPerformance(data);
     497    },
    384498};
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js

    r174366 r174622  
    2424 */
    2525
     26var hasBubbles = typeof bubbleQueueServer != "undefined";
     27
    2628var analyzer = new Analyzer;
    2729
     
    255257        table.appendChild(row);
    256258    }
     259
     260    document.body.appendChild(table);
     261
     262    return table;
     263}
     264
     265function buildBubbleQueuesTable()
     266{
     267    var table = document.createElement("table");
     268    table.classList.add("queue-grid");
     269
     270    var row = document.createElement("tr");
     271    row.classList.add("headers");
     272
     273    for (id in bubbleQueueServer.queues) {
     274        var header = document.createElement("th");
     275        header.textContent = bubbleQueueServer.queues[id].shortName;
     276        row.appendChild(header);
     277    }
     278
     279    table.appendChild(row);
     280
     281    row = document.createElement("tr");
     282    row.classList.add("platform");
     283
     284    for (id in bubbleQueueServer.queues) {
     285        var cell = document.createElement("td");
     286        var view = new MetricsBubbleView(analyzer, bubbleQueueServer.queues[id]);
     287        cell.appendChild(view.element);
     288        row.appendChild(cell);
     289    }
     290
     291    table.appendChild(row);
    257292
    258293    document.body.appendChild(table);
     
    303338
    304339    buildAggregateTable();
     340    if (hasBubbles) {
     341        var tablesDivider = document.createElement("div");
     342        tablesDivider.classList.add("tables-divider");
     343        document.body.appendChild(tablesDivider);
     344        buildBubbleQueuesTable();
     345    }
    305346
    306347    var tablesDivider = document.createElement("div");
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html

    r173008 r174622  
    3737    <script src="Scripts/Dashboard.js"></script>
    3838    <script src="Scripts/Buildbot.js"></script>
     39    <script src="Scripts/BubbleQueueServer.js"></script>
    3940    <script src="Scripts/WebKitBuildbot.js"></script>
    4041    <script src="Scripts/BuildbotQueue.js"></script>
     42    <script src="Scripts/BubbleQueue.js"></script>
    4143    <script src="Scripts/BuildbotIteration.js"></script>
    4244    <script src="Scripts/BuildbotTestResults.js"></script>
     
    4648    <script src="Scripts/MetricsAnalyzer.js"></script>
    4749    <script src="Scripts/MetricsView.js"></script>
     50    <script src="Scripts/MetricsBubbleView.js"></script>
    4851    <script src="External/jquery-1.11.1.min.js"></script>
    4952    <script src="External/moment.min.js"></script>
  • trunk/Tools/ChangeLog

    r174611 r174622  
     12014-10-10  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Dashboard metrics page should have EWS statistics
     4        https://bugs.webkit.org/show_bug.cgi?id=137626
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js:
     9        (BubbleQueue): Put shortName in the object, so that it's actually useful.
     10
     11        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
     12        (BubbleQueueServer): Re-ordered queues to match bubble order.
     13        (BubbleQueueServer.prototype.jsonProcessingTimesURL): Added URL for the new handler.
     14        (BubbleQueueServer.prototype.loadProcessingTimes): Load the data from webkit-queues.
     15
     16        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js:
     17        Added analysis for bubble queues.
     18
     19        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js: Added.
     20
     21        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js:
     22        (buildBubbleQueuesTable): Build the UI.
     23
     24        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html:
     25        Added JS sources to load.
     26
     27        * QueueStatusServer/app.yaml: To update app version.
     28
     29        * QueueStatusServer/handlers/processingtimesjson.py: Added.
     30
     31        * QueueStatusServer/main.py: Added a handler for processing-times-json.
     32
    1332014-10-10  Alexey Proskuryakov  <ap@apple.com>
    234
  • trunk/Tools/QueueStatusServer/app.yaml

    r174611 r174622  
    11application: webkit-queues
    2 version: 174611 # SVN revision of last major change
     2version: 174622 # SVN revision of last major change
    33runtime: python
    44api_version: 1
  • trunk/Tools/QueueStatusServer/main.py

    r174248 r174622  
    11# Copyright (C) 2009 Google Inc. All rights reserved.
     2# Copyright (C) 2014 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    3940from handlers.patch import Patch
    4041from handlers.patchstatus import PatchStatus
     42from handlers.processingtimesjson import ProcessingTimesJSON
    4143from handlers.queuecharts import QueueCharts
    4244from handlers.queuelengthjson import QueueLengthJSON
     
    8082    ('/update-svn-revision', UpdateSVNRevision),
    8183    ('/active-bots', ActiveBots),
     84    (r'/processing-times-json/(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)', ProcessingTimesJSON),
    8285]
    8386
Note: See TracChangeset for help on using the changeset viewer.