Class ExecutionTimeBalancer
java.lang.Object
org.apache.tools.ant.ProjectComponent
com.carrotsearch.ant.tasks.junit4.balancers.ExecutionTimeBalancer
- All Implemented Interfaces:
SuiteBalancer, Cloneable
public class ExecutionTimeBalancer
extends org.apache.tools.ant.ProjectComponent
implements SuiteBalancer
A test suite balancer based on past execution times saved using
ExecutionTimesReport.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface SuiteBalancer
SuiteBalancer.Assignment -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JUnit4Owning task (logging).private List<org.apache.tools.ant.types.ResourceCollection> All included execution time dumps.private booleanFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.apache.tools.ant.types.ResourceCollection rc) Adds a resource collection with execution hints.assign(Collection<String> suiteNames, int slaves, long seed) Assign based on execution time history.voidSets the owner task (for logging mostly).voidsetVerbose(boolean verbose) Be verbose about estimated times etc.Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Field Details
-
resources
All included execution time dumps. -
owner
Owning task (logging). -
verbose
private boolean verbose- See Also:
-
-
Constructor Details
-
ExecutionTimeBalancer
public ExecutionTimeBalancer()
-
-
Method Details
-
setVerbose
public void setVerbose(boolean verbose) Be verbose about estimated times etc. -
add
public void add(org.apache.tools.ant.types.ResourceCollection rc) Adds a resource collection with execution hints. -
assign
Assign based on execution time history. The algorithm is a greedy heuristic assigning the longest remaining test to the slave with the shortest-completion time so far. This is not optimal but fast and provides a decent average assignment.- Specified by:
assignin interfaceSuiteBalancer- Returns:
- Returns an ordered list with assignments. Any suite name not present in the keys of the returned map will be assigned by following balancers (or randomly).
-
setOwner
Description copied from interface:SuiteBalancerSets the owner task (for logging mostly).- Specified by:
setOwnerin interfaceSuiteBalancer
-