Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import java.util.concurrent.TimeUnit;
def c = 0;
def w = TimeUnit.DAYS.toMillis(3)
def threshold = new Date().time - w
Jenkins.instance.getAllItems(Job.class).each { j ->
for (b=j.lastBuild; b!=null; b=b.previousBuild) {
if (b.timeInMillis<threshold) break;
c += b.duration;
// println "${j.displayName} ${b.displayName}";
}
}
println c/w
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.