Skip to content
Permalink
Browse files

[FIXED JENKINS-18895] MavenModuleSetBuild.getResult is expensive.

Originally-Committed-As: d1d524863cbb2f1f443fc4bf7c25933b7a31b85d
  • Loading branch information
jglick committed Jul 29, 2013
1 parent 4157033 commit c2b59479268ff3aae415453ca55256e71ae676f2
Showing with 10 additions and 2 deletions.
  1. +10 −2 test/src/main/java/org/jvnet/hudson/test/RunLoadCounter.java
@@ -50,12 +50,16 @@

/**
* Prepares a new project to be measured.
* Call this <em>before</em> starting builds.
* Usually called before starting builds, but may also be called retroactively.
* @param project a project of any kind
* @throws IOException if preparations fail
*/
public static void prepare(AbstractProject<?,?> project) throws IOException {
project.getPublishersList().add(new MarkerAdder());
for (AbstractBuild<?,?> build : project._getRuns()) {
Marker.add(build);
build.save();
}
}

/**
@@ -97,6 +101,10 @@ private RunLoadCounter() {}
@Restricted(NoExternalUse.class)
public static final class Marker implements RunAction {

static void add(AbstractBuild<?,?> build) {
build.addAction(new Marker(build.getParent().getFullName(), build.getNumber()));
}

private final String project;
private final int build;

@@ -137,7 +145,7 @@ private RunLoadCounter() {}
public static final class MarkerAdder extends Notifier {

@Override public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
build.addAction(new Marker(build.getParent().getFullName(), build.getNumber()));
Marker.add(build);
return true;
}

0 comments on commit c2b5947

Please sign in to comment.