public final class TaskStatistics
extends java.lang.Object
It registers, in nano-seconds, the queue time, the execution time and the total time (queue time + execution time).
Constructor and Description |
---|
TaskStatistics()
The constructor, sets the queue start time.
|
Modifier and Type | Method and Description |
---|---|
void |
enqueue()
Set the timestamp the task is offered for execution.
|
java.lang.Long |
getExecutionTime()
Get the time (in nano seconds) the task was executing.
|
java.lang.Long |
getQueueTime()
Get the time (in nano seconds) the task was in the queue.
|
java.lang.Long |
getTotalTime()
Get the time (in nano seconds) the task took from start (offer / queue) to completion.
|
void |
startExecution()
Set the timestamp the task is actually run.
|
void |
stopExecution()
Set the timestamp the task is finished running.
|
public TaskStatistics()
public void enqueue()
public void startExecution()
public void stopExecution()
public java.lang.Long getQueueTime()
public java.lang.Long getExecutionTime()
public java.lang.Long getTotalTime()
This is the same as queue time + execution time.