Changeset 162358 in webkit


Ignore:
Timestamp:
Jan 20, 2014 10:37:49 AM (10 years ago)
Author:
ap@apple.com
Message:

EWS should provide better information to Dashboard via JSON
https://bugs.webkit.org/show_bug.cgi?id=127265

Reviewed by Ryosuke Niwa.

  • QueueStatusServer/app.yaml: Updated version.
  • QueueStatusServer/main.py:
  • QueueStatusServer/handlers/queuelengthjson.py:

Added a way to cheaply get only the queue length, which is all the dashboard
needs unless a popover is opened.

  • QueueStatusServer/handlers/queuestatusjson.py: Updated to return more information

that we will need. Changed some field names to be more meaningful. Fixed bot listing
to understand that a bot can be reprurposed and used in a different queue.

Location:
trunk/Tools
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r162357 r162358  
     12014-01-20  Alexey Proskuryakov  <ap@apple.com>
     2
     3        EWS should provide better information to Dashboard via JSON
     4        https://bugs.webkit.org/show_bug.cgi?id=127265
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * QueueStatusServer/app.yaml: Updated version.
     9
     10        * QueueStatusServer/main.py:
     11        * QueueStatusServer/handlers/queuelengthjson.py:
     12        Added a way to cheaply get only the queue length, which is all the dashboard
     13        needs unless a popover is opened.
     14
     15        * QueueStatusServer/handlers/queuestatusjson.py: Updated to return more information
     16        that we will need. Changed some field names to be more meaningful. Fixed bot listing
     17        to understand that a bot can be reprurposed and used in a different queue.
     18
    1192014-01-20  Alexey Proskuryakov  <ap@apple.com>
    220
  • trunk/Tools/QueueStatusServer/app.yaml

    r162289 r162358  
    11application: webkit-queues
    2 version: 162287 # Bugzilla bug ID of last major change
     2version: 162358 # Bugzilla bug ID of last major change
    33runtime: python
    44api_version: 1
  • trunk/Tools/QueueStatusServer/handlers/queuestatusjson.py

    r161098 r162358  
    1 # Copyright (C) 2013 Apple. All rights reserved.
     1# Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    4646        rows = []
    4747        for item_id in queued_items.item_ids:
    48             statuses = QueueStatus.all().filter('queue_name =', queue.name()).filter('active_patch_id =', item_id).order('-date').fetch(1)
    49             status = statuses[0].message if statuses else ""
     48            patchStatusQuery = QueueStatus.all().filter('queue_name =', queue.name()).filter('active_patch_id =', item_id).order('-date')
     49            statuses = patchStatusQuery.fetch(1)
     50            message = None
     51            message_time = None
     52            bug_id = None
     53            results_url = None
     54            if statuses:
     55                message = statuses[0].message
     56                message_time = statuses[0].date
     57                bug_id = statuses[0].active_bug_id
     58                results_url = self.request.host_url + "/results/" + str(statuses[0].key().id()) if statuses[0].results_file else None
     59
    5060            rows.append({
    5161                "attachment_id": item_id,
     62                "bug_id": bug_id,
    5263                "active": active_items and active_items.time_for_item(item_id) != None,
    53                 "status": status,
     64                "active_since": active_items and active_items.time_for_item(item_id),
     65                "latest_message": message,
     66                "latest_message_time": message_time,
     67                "message_count": patchStatusQuery.count(),
    5468                "status_page": self.request.host_url + "/patch/" + str(item_id),
     69                "latest_results": results_url,
    5570            })
    5671        return rows
    5772
    5873    def _bots(self, queue):
     74        # First, collect all bots that ever served this queue.
    5975        bot_id_statuses = QueueStatus.all(projection=['bot_id'], distinct=True).filter('queue_name =', queue.name()).fetch(500)
    6076        bot_ids = list(entry.bot_id for entry in bot_id_statuses)
     
    6278        for bot_id in bot_ids:
    6379            status = QueueStatus.all().filter('bot_id =', bot_id).order('-date').get()
     80
     81            if status.queue_name != queue.name():
     82                # The bot got re-purposed, and is serving a different queue now.
     83                continue
     84
    6485            result.append({
    6586                "bot_id": bot_id,
     
    6788                "latest_message": status.message,
    6889                "latest_message_time": status.date,
     90                "latest_message_bug_id": status.active_bug_id,
     91                "latest_message_patch_id": status.active_patch_id,
    6992                "latest_output": self.request.host_url + "/results/" + str(status.key().id()) if status.results_file else None,
    70                 "active_bug_id": status.active_bug_id,
    71                 "active_patch_id": status.active_patch_id,
    7293            })
    7394        return result
     
    86107        status = {
    87108            "status_page": self.request.host_url + "/queue-status/" + queue_name,
     109            "charts_page": self.request.host_url + "/queue-charts/" + queue_name,
    88110            "queue": self._rows_for_work_items(queue),
    89111            "bots": self._bots(queue),
  • trunk/Tools/QueueStatusServer/main.py

    r161062 r162358  
    4141from handlers.patchstatus import PatchStatus
    4242from handlers.queuecharts import QueueCharts
     43from handlers.queuelengthjson import QueueLengthJSON
    4344from handlers.queuestatus import QueueStatus
    4445from handlers.queuestatusjson import QueueStatusJSON
     
    6970    (r'/svn-revision/(.*)', SVNRevision),
    7071    (r'/queue-charts/(.*)', QueueCharts),
     72    (r'/queue-length-json/(.*)', QueueLengthJSON),
    7173    (r'/queue-status/(.*)/bots/(.*)', QueueStatus),
    7274    (r'/queue-status/(.*)', QueueStatus),
Note: See TracChangeset for help on using the changeset viewer.