Skip to content
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

Merged
merged 1 commit into from Mar 11, 2017

Conversation

5 participants
@jglick
Copy link
Member

commented Mar 9, 2017

Logging improvements useful in the course of developing a fix for JENKINS-42556.

@reviewbybees

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()});

This comment has been minimized.

Copy link
@jglick

jglick Mar 9, 2017

Author Member

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)) {

This comment has been minimized.

Copy link
@jglick

jglick Mar 9, 2017

Author Member

Avoid computing getFullDisplayName if we do not have to.

This comment has been minimized.

Copy link
@jglick

jglick Mar 9, 2017

Author Member

Note that there are more cases of this optimization that could be done; I just picked some sample cases.

This comment has been minimized.

Copy link
@jglick
@@ -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;

This comment has been minimized.

Copy link
@jglick

jglick Mar 9, 2017

Author Member

I recommended @christ66 do this in #1863 but he did not. Turns out this had a far worse consequence than wasting a bit of CPU time, which will become clearer in another PR.

@reviewbybees

This comment has been minimized.

Copy link

commented Mar 9, 2017

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.

@aheritier

This comment has been minimized.

Copy link
Member

commented Mar 9, 2017

🐝

@oleg-nenashev
Copy link
Member

left a comment

🐝

@oleg-nenashev

This comment has been minimized.

Copy link
Member

commented Mar 11, 2017

@reviewbybees done. I consider merging it since any performance optimization of the queue is useful

@daniel-beck daniel-beck merged commit 13d85fb into jenkinsci:master Mar 11, 2017

2 checks passed

Jenkins This pull request looks good
Details
continuous-integration/jenkins/pr-head This commit looks good
Details

@jglick jglick deleted the jglick:Queue-logging-JENKINS-42556 branch Mar 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.