Class ExecutionTimesReport
java.lang.Object
com.carrotsearch.ant.tasks.junit4.listeners.ExecutionTimesReport
- All Implemented Interfaces:
AggregatedEventListener
A report listener that emits per-suite execution times information useful
for load balancing tests across JVMs.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
mergeHints
(InputStream is, Map<String, List<Long>> hints) Read hints from a file and merge with the given hints map.mergeHints
(Collection<org.apache.tools.ant.types.ResourceCollection> resources, Collection<String> suiteNames) Read hints from all resources in a collection, retainingsuiteNames
.void
Write back to hints file.void
Remember execution time for all executed suites.Read hints from a file.void
Hints file (key-value pairs).void
setHistoryLength
(int length) How many execution times to store per-suite? The history must be larger than 0.void
Link to the container.static void
Writes back hints file.
-
Field Details
-
DEFAULT_HISTORY_LENGTH
public static final int DEFAULT_HISTORY_LENGTH- See Also:
-
hintsFile
The file where suite hints are stored/ updated. -
hints
Execution time hints. Key: suite name, value: execution times. -
historyLength
private int historyLength- See Also:
-
outer
Outer task.
-
-
Constructor Details
-
ExecutionTimesReport
public ExecutionTimesReport()
-
-
Method Details
-
setFile
Hints file (key-value pairs). -
setHistoryLength
public void setHistoryLength(int length) How many execution times to store per-suite? The history must be larger than 0. -
onSuiteResult
Remember execution time for all executed suites. -
onEnd
Write back to hints file. -
setOuter
Description copied from interface:AggregatedEventListener
Link to the container. Listener can throwBuildException
if parameter validation doesn't succeed, for example.- Specified by:
setOuter
in interfaceAggregatedEventListener
- Throws:
org.apache.tools.ant.BuildException
-
readHints
Read hints from a file.- Throws:
IOException
-
mergeHints
Read hints from a file and merge with the given hints map.- Throws:
IOException
-
writeHints
Writes back hints file.- Throws:
IOException
-
mergeHints
public static Map<String,List<Long>> mergeHints(Collection<org.apache.tools.ant.types.ResourceCollection> resources, Collection<String> suiteNames) Read hints from all resources in a collection, retainingsuiteNames
. IfsuiteNames
is null, everything is retained.
-