-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-42556] Improved logging for Queue #2791
[JENKINS-42556] Improved logging for Queue #2791
Conversation
snapshot = new Snapshot(waitingList, blockedProjects, buildables, pendings); | ||
Snapshot revised = new Snapshot(waitingList, blockedProjects, buildables, pendings); | ||
if (LOGGER.isLoggable(Level.FINEST)) { | ||
LOGGER.log(Level.FINEST, "{0} → {1}; leftItems={2}", new Object[] {snapshot, revised, leftItems.asMap()}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally handy to know when the state of the queue changes, for whatever reason.
@@ -1443,9 +1447,11 @@ public void maintain() { | |||
} | |||
// pending -> buildable | |||
for (BuildableItem p: lostPendings) { | |||
LOGGER.log(Level.FINE, | |||
if (LOGGER.isLoggable(Level.FINE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid computing getFullDisplayName
if we do not have to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that there are more cases of this optimization that could be done; I just picked some sample cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1464,7 +1470,7 @@ public void maintain() { | |||
Collections.sort(blockedItems, QueueSorter.DEFAULT_BLOCKED_ITEM_COMPARATOR); | |||
} | |||
for (BlockedItem p : blockedItems) { | |||
String taskDisplayName = p.task.getFullDisplayName(); | |||
String taskDisplayName = LOGGER.isLoggable(Level.FINEST) ? p.task.getFullDisplayName() : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
🐝 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐝
@reviewbybees done. I consider merging it since any performance optimization of the queue is useful |
Logging improvements useful in the course of developing a fix for JENKINS-42556.
@reviewbybees