Class TaskStatistics
java.lang.Object
org.hawaiiframework.async.statistics.TaskStatistics
Statistics about a task.
It registers, in nano-seconds, the queue time, the execution time and the total time (queue time + execution time).
- Since:
- 2.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenqueue()Set the timestamp the task is offered for execution.Get the time (in nano seconds) the task was executing.Get the time (in nano seconds) the task was in the queue.Get the time (in nano seconds) the task took from start (offer / queue) to completion.voidSet the timestamp the task is actually run.voidSet the timestamp the task is finished running.
-
Constructor Details
-
TaskStatistics
public TaskStatistics()The constructor, sets the queue start time.
-
-
Method Details
-
enqueue
public void enqueue()Set the timestamp the task is offered for execution. -
startExecution
public void startExecution()Set the timestamp the task is actually run. -
stopExecution
public void stopExecution()Set the timestamp the task is finished running. -
getQueueTime
Get the time (in nano seconds) the task was in the queue.- Returns:
- the interval the task was queued.
-
getExecutionTime
Get the time (in nano seconds) the task was executing.- Returns:
- the interval the task was running.
-
getTotalTime
Get the time (in nano seconds) the task took from start (offer / queue) to completion.This is the same as queue time + execution time.
- Returns:
- the total time the task took to complete.
-