Class SlavesHolder
java.lang.Object
hudson.slaves.ComputerListener
org.jenkinsci.plugins.jqsmonitoring.slaves.SlavesHolder
- All Implemented Interfaces:
ExtensionPoint
Holds all information about the slaves in the current jenkins instance.
- Author:
- yboev
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Method Summary
Modifier and TypeMethodDescriptiongetApi()REST API.Return the color assotiated with this slave .static SlavesHolderReturn the instance for this class(Singleton).getLastBuild(Slave slave) Return the last build for a given slave.intReturn number of offline slaves.intReturn number of online slaves.intThe number of slaves.List with all slaves.Returns the url for a certain slave.voidMethods inherited from class hudson.slaves.ComputerListener
all, onIdle, onLaunchFailure, onOffline, onOffline, onOnline, onOnline, onTemporarilyOffline, onTemporarilyOnline, preLaunch, preOnline, register, unregister
-
Method Details
-
getInstance
Return the instance for this class(Singleton).- Returns:
- the instance.
-
getApi
REST API.- Returns:
- the api.
-
onConfigurationChange
public void onConfigurationChange()- Overrides:
onConfigurationChangein classComputerListener
-
getSlaves
List with all slaves.- Returns:
- the list.
-
getNumberOfSlaves
@Exported public int getNumberOfSlaves()The number of slaves.- Returns:
- the number as int.
-
getUrl
Returns the url for a certain slave.- Parameters:
slave- the slave.- Returns:
- the url of the given slave.
-
getLastBuild
Return the last build for a given slave.- Parameters:
slave- the slave.- Returns:
- the last build of the given slave as String.
-
getNumberOfOnlineSlaves
@Exported public int getNumberOfOnlineSlaves()Return number of online slaves.- Returns:
- number of online slaves as int.
-
getNumberOfOfflineSlaves
@Exported public int getNumberOfOfflineSlaves()Return number of offline slaves.- Returns:
- number of offline slaves as int.
-
getColor
Return the color assotiated with this slave . red - offline orange - all executors busy green - free executor- Parameters:
s- the slave.- Returns:
- the color as String.
-