Wednesday, May 17, 2017

Jenkins groovy script to list busy nodes

The below code is intended to be run in Jenkins script console

def busy = [];
busy = hudson.model.Hudson.instance.slaves.findAll { it.getComputer().countBusy() > 0 }
out.println("Busy nodes: "+busy.collect { it.nodeName }.join(", "))

No comments: