Title: [278455] trunk/Tools
Revision
278455
Author
[email protected]
Date
2021-06-04 07:19:18 -0700 (Fri, 04 Jun 2021)

Log Message

[ews] Speed up ews status bubble loading speed
https://bugs.webkit.org/show_bug.cgi?id=214821

Reviewed by Jonathan Bedard.

This change does a trade-off between accuracy of queue position vs status-bubble loading time.
This would reduce the calculations needed for queue position computation, but the position
might not be accurate if the queue has a backlog of more than 12 hours (which shouldn't be
the case normally). If the backlog is less than 12 hours, then the queue position will be accurate.

Also, this patch separates the logic of when to hide the status-bubble. Status-bubble will now be hidden
after 7 days of no build. However, if patch is waiting for more than 12 hours, but less than 7 days,
instead of computing the exact queue position, we do not display queue position.
* CISupport/ews-app/ews/views/statusbubble.py:
(StatusBubble):
(StatusBubble._build_bubble):
(StatusBubble._queue_position):

Modified Paths

Diff

Modified: trunk/Tools/CISupport/ews-app/ews/templates/statusbubble.html (278454 => 278455)


--- trunk/Tools/CISupport/ews-app/ews/templates/statusbubble.html	2021-06-04 14:04:35 UTC (rev 278454)
+++ trunk/Tools/CISupport/ews-app/ews/templates/statusbubble.html	2021-06-04 14:19:18 UTC (rev 278455)
@@ -29,6 +29,12 @@
 .status:hover {
     border-color: rgba(1, 1, 1, 0.7);
 }
+.cancelled {
+    text-decoration: line-through
+}
+.skipped {
+    text-decoration: line-through
+}
 .pass {
     background-color: #8FDF5F;
 }

Modified: trunk/Tools/CISupport/ews-app/ews/views/statusbubble.py (278454 => 278455)


--- trunk/Tools/CISupport/ews-app/ews/views/statusbubble.py	2021-06-04 14:04:35 UTC (rev 278454)
+++ trunk/Tools/CISupport/ews-app/ews/views/statusbubble.py	2021-06-04 14:19:18 UTC (rev 278455)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2020 Apple Inc. All rights reserved.
+# Copyright (C) 2018-2021 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -72,10 +72,12 @@
                      '^Validated commiter$', '^Validated commiter and reviewer$', '^Validated ChangeLog and Reviewer$',
                      '^Removed flags on bugzilla patch$', '^Checked patch status on other queues$', '^Identifier:.*$',
                      '^Updated branch information$', '^worker .* ready$']
-    DAYS_TO_CHECK = 1
+    DAYS_TO_CHECK_QUEUE_POSITION = 0.5
+    DAYS_TO_HIDE_BUBBLE = 7
     BUILDER_ICON = u'\U0001f6e0'
     TESTER_ICON = u'\U0001f9ea'
     BUILD_RETRY_MSG = 'retrying build'
+    UNKNOWN_QUEUE_POSITION = '?'
 
     def _build_bubble(self, patch, queue, hide_icons=False):
         bubble = {
@@ -100,9 +102,10 @@
         if not build:
             bubble['state'] = 'none'
             queue_position = self._queue_position(patch, queue, self._get_parent_queue(queue))
-            bubble['queue_position'] = queue_position
             if not queue_position:
                 return None
+            if queue_position != StatusBubble.UNKNOWN_QUEUE_POSITION:
+                bubble['queue_position'] = queue_position
             if self._get_parent_queue(queue):
                 queue = self._get_parent_queue(queue)
             queue_full_name = Buildbot.queue_name_by_shortname_mapping.get(queue)
@@ -129,7 +132,7 @@
                 bubble['url'] = 'https://{}/#/builders/{}'.format(config.BUILDBOT_SERVER_HOST, queue_full_name)
         elif build.result == Buildbot.SUCCESS:
             if is_parent_build:
-                if patch.created < (timezone.now() - datetime.timedelta(days=StatusBubble.DAYS_TO_CHECK)):
+                if patch.created < (timezone.now() - datetime.timedelta(days=StatusBubble.DAYS_TO_HIDE_BUBBLE)):
                     # Do not display bubble for old patch for which no build has been reported on given queue.
                     # Most likely the patch would never be processed on this queue, since either the queue was
                     # added after the patch was submitted, or build request for that patch was cancelled.
@@ -162,7 +165,7 @@
             if StatusBubble.BUILD_RETRY_MSG in bubble['details_message']:
                 bubble['state'] = 'provisional-fail'
         elif build.result == Buildbot.SKIPPED:
-            bubble['state'] = 'none'
+            bubble['state'] = 'skipped'
             bubble['details_message'] = 'The patch is no longer eligible for processing.'
             if re.search(r'Bug .* is already closed', build.state_string):
                 bubble['details_message'] += ' Bug was already closed when EWS attempted to process it.'
@@ -182,7 +185,7 @@
             bubble['state'] = 'provisional-fail'
             bubble['details_message'] = 'Build is being retried. Recent messages:' + self._steps_messages_from_multiple_builds(builds)
         elif build.result == Buildbot.CANCELLED:
-            bubble['state'] = 'none'
+            bubble['state'] = 'cancelled'
             bubble['details_message'] = 'Build was cancelled. Recent messages:' + self._steps_messages_from_multiple_builds(builds)
         else:
             bubble['state'] = 'error'
@@ -295,14 +298,20 @@
 
     def _queue_position(self, patch, queue, parent_queue=None):
         # FIXME: Handle retried builds and cancelled build-requests as well.
-        from_timestamp = timezone.now() - datetime.timedelta(days=StatusBubble.DAYS_TO_CHECK)
+        from_timestamp = timezone.now() - datetime.timedelta(days=StatusBubble.DAYS_TO_CHECK_QUEUE_POSITION)
+        hide_from_timestamp = timezone.now() - datetime.timedelta(days=StatusBubble.DAYS_TO_HIDE_BUBBLE)
 
-        if patch.created < from_timestamp:
+        if patch.created < hide_from_timestamp:
             # Do not display bubble for old patch for which no build has been reported on given queue.
             # Most likely the patch would never be processed on this queue, since either the queue was
             # added after the patch was submitted, or build request for that patch was cancelled.
             return None
 
+        if patch.created < from_timestamp:
+            # This means patch has been waiting on given queue for long time, but not long enough to hide the status-bubble.
+            # Instead of calculating exact queue position (which might be slow), we display a fixed high queue position.
+            return StatusBubble.UNKNOWN_QUEUE_POSITION
+
         sent = 'sent_to_commit_queue' if queue == 'commit' else 'sent_to_buildbot'
         previously_sent_patches = set(Patch.objects
                                           .filter(created__gte=from_timestamp)

Modified: trunk/Tools/ChangeLog (278454 => 278455)


--- trunk/Tools/ChangeLog	2021-06-04 14:04:35 UTC (rev 278454)
+++ trunk/Tools/ChangeLog	2021-06-04 14:19:18 UTC (rev 278455)
@@ -1,3 +1,23 @@
+2021-06-04  Aakash Jain  <[email protected]>
+
+        [ews] Speed up ews status bubble loading speed
+        https://bugs.webkit.org/show_bug.cgi?id=214821
+
+        Reviewed by Jonathan Bedard.
+
+        This change does a trade-off between accuracy of queue position vs status-bubble loading time.
+        This would reduce the calculations needed for queue position computation, but the position
+        might not be accurate if the queue has a backlog of more than 12 hours (which shouldn't be
+        the case normally). If the backlog is less than 12 hours, then the queue position will be accurate.
+
+        Also, this patch separates the logic of when to hide the status-bubble. Status-bubble will now be hidden
+        after 7 days of no build. However, if patch is waiting for more than 12 hours, but less than 7 days,
+        instead of computing the exact queue position, we do not display queue position.
+        * CISupport/ews-app/ews/views/statusbubble.py:
+        (StatusBubble):
+        (StatusBubble._build_bubble):
+        (StatusBubble._queue_position):
+
 2021-06-04  Jonathan Bedard  <[email protected]>
 
         [run-webkit-tests] Use webkitcorepy's TaskPool
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to