Finding the number of free executors

15 views
Skip to first unread message

Vinodhini Vijay

unread,
Oct 27, 2015, 2:03:57 AM10/27/15
to Jenkins Developers


Hello All,

Is there any way to find the number of free executors during a build?

While a build starts, the run method of the build object is called. Is there a way to find the number of free executors (when the control is inside the run method) currently available in the master or any specifc Slave node?

Thank you!

Baptiste Mathus

unread,
Oct 27, 2015, 2:21:03 AM10/27/15
to jenkin...@googlegroups.com
Hi,

Generally, with any of the Java IDE, you can easily browse the Jenkins API. Start with the Jenkins class.

In your case:

Jenkins.getActiveInstance().getMachines() => returns Machine[]
Then Machine.getExecutors() => returns Executor[]
Then Executor.isActive()

HTH
Cheers

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/7f8eb244-8b07-4fcc-9480-a14873c6c5ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
Reply all
Reply to author
Forward
0 new messages