Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-21119] Extend loggning to show assigned priority
* Refactored to include more information in the ItemCache. * Refactored to use specific transition methods rather than setter. * Added ItemTransitionLogger to log events in the Queue.
- Loading branch information
Showing
6 changed files
with
125 additions
and
33 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
src/main/java/jenkins/advancedqueue/ItemTransitionLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2013, Magnus Sandberg | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package jenkins.advancedqueue; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import jenkins.advancedqueue.sorter.ItemInfo; | ||
|
||
/** | ||
* @author Magnus Sandberg | ||
* @since 2.4 | ||
*/ | ||
public class ItemTransitionLogger { | ||
|
||
private final static Logger LOGGER = Logger.getLogger("PrioritySorter.Queue.Items"); | ||
|
||
static public void logNewItem(ItemInfo info) { | ||
LOGGER.fine("New Item: " + info.toString()); | ||
} | ||
|
||
static public void logBlockedItem(ItemInfo info) { | ||
LOGGER.fine("Blocking: " + info.toString()); | ||
} | ||
|
||
static public void logBuilableItem(ItemInfo info) { | ||
LOGGER.fine("Buildable: " + info.toString()); | ||
} | ||
|
||
static public void logStartedItem(ItemInfo info) { | ||
LOGGER.fine("Starting: " + info.toString()); | ||
} | ||
|
||
static public void logCanceledItem(ItemInfo info) { | ||
LOGGER.fine("Canceling: " + info.toString()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/jenkins/advancedqueue/PriorityConfigurationCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package jenkins.advancedqueue; | ||
|
||
import jenkins.advancedqueue.priority.PriorityStrategy; | ||
|
||
public interface PriorityConfigurationCallback { | ||
|
||
PriorityConfigurationCallback setPrioritySelection(int priority); | ||
|
||
PriorityConfigurationCallback setPrioritySelection(int priority, int jobGroupId); | ||
PriorityConfigurationCallback setPrioritySelection(int priority, int jobGroupId, PriorityStrategy reason); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters