Package org.jboss.windup.util
Class ExecutionStatistics
- java.lang.Object
-
- org.jboss.windup.util.ExecutionStatistics
-
public class ExecutionStatistics extends Object
ExecutionStatisticsprovides a simple system for storing the time taken to perform operations.Example usage:
ExecutionStatistics.get().begin("Process-01"); // ... your code to be timed goes here ExecutionStatistics.get().end("Process-01");- Author:
- Jesse Sightler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classExecutionStatistics.TimingData
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin(String key)Start timing an operation with the given identifier.voidend(String key)Complete timing the operation with the given identifier.static ExecutionStatisticsget()Gets the instance associated with the current thread.Map<String,ExecutionStatistics.TimingData>getExecutionInfo()voidmerge()Merge this ExecutionStatistics with all the statistics created within the child threads.static <T> TperformBenchmarked(String key, Task<T> operation)voidreset()Clears the current threadlocal as well as any current state.voidserializeTimingData(Path outputPath)Serializes the timing data to a "~" delimited file at outputPath.
-
-
-
Method Detail
-
get
public static ExecutionStatistics get()
Gets the instance associated with the current thread.
-
getExecutionInfo
public Map<String,ExecutionStatistics.TimingData> getExecutionInfo()
-
merge
public void merge()
Merge this ExecutionStatistics with all the statistics created within the child threads. All the child threads had to be created using Windup-specific ThreadFactory in order to contain a reference to the parent thread.
-
reset
public void reset()
Clears the current threadlocal as well as any current state.
-
serializeTimingData
public void serializeTimingData(Path outputPath)
Serializes the timing data to a "~" delimited file at outputPath.
-
begin
public void begin(String key)
Start timing an operation with the given identifier.
-
end
public void end(String key)
Complete timing the operation with the given identifier. If you had not previously started a timing operation with this identifier, then this will effectively be a noop.
-
-