fr.jcgay.maven.profiler.reporting.template.Project Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-profiler Show documentation
Show all versions of maven-profiler Show documentation
Log Maven mojos execution time
package fr.jcgay.maven.profiler.reporting.template;
import com.google.common.base.Stopwatch;
import org.apache.maven.plugin.MojoExecution;
import java.util.ArrayList;
import java.util.List;
public class Project {
private final String name;
private final Stopwatch time;
private final List> mojosWithTime = new ArrayList>();
public Project(String name, Stopwatch time) {
this.name = name;
this.time = time;
}
public void addMojoTime(EntryAndTime mojoWithTime) {
mojosWithTime.add(mojoWithTime);
}
public String getName() {
return name;
}
public List> getMojosWithTime() {
return mojosWithTime;
}
public Stopwatch getTime() {
return time;
}
public String getMillisTimeStamp() {
return String.valueOf(time.elapsedMillis()) + " ms";
}
@Override
public String toString() {
return String.format("{%s, %s, totalMojos = %d}", name, getMillisTimeStamp(), mojosWithTime.size());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy