public class InjectorMonitor extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
InjectorMonitor.TaskInfo
Inner class to hold data about one task executed within the CWI Monitor.
|
| Constructor and Description |
|---|
InjectorMonitor()
Construct a new CWI monitor.
|
InjectorMonitor(String id)
Construct a new CWI monitor with the given id.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLastTaskTimeMillis()
Return the time taken by the last task.
|
int |
getTaskCount()
Return the number of tasks timed.
|
InjectorMonitor.TaskInfo[] |
getTaskInfo()
Return an array of the data for tasks performed.
|
long |
getTotalTimeMillis()
Return the total time in milliseconds for all tasks.
|
double |
getTotalTimeSeconds()
Return the total time in seconds for all tasks.
|
boolean |
isRunning()
Return whether the CWI monitor is currently running.
|
String |
prettyPrint()
Return a string with a table describing all tasks performed.
|
void |
setKeepTaskList(boolean keepTaskList)
Determine whether the TaskInfo array is built over time.
|
String |
shortSummary()
Return a short description of the total running time.
|
void |
start()
Start an unnamed task.
|
void |
start(String taskName)
Start a named task.
|
void |
stop()
Stop the current task.
|
String |
toString()
Return an informative string describing all tasks performed
For custom reporting, call
getTaskInfo() and use the task info directly. |
public InjectorMonitor()
public InjectorMonitor(String id)
id - identifier for this CWI monitor.
Handy when we have output from multiple CWI monitors
and need to distinguish between them.public void setKeepTaskList(boolean keepTaskList)
public void start()
throws IllegalStateException
stop()
or timing methods are called without invoking this method.IllegalStateExceptionstop()public void start(String taskName) throws IllegalStateException
stop()
or timing methods are called without invoking this method.taskName - the name of the task to startIllegalStateExceptionstop()public void stop()
throws IllegalStateException
start() / stop() methods.IllegalStateExceptionstart()public boolean isRunning()
public long getLastTaskTimeMillis()
throws IllegalStateException
IllegalStateExceptionpublic long getTotalTimeMillis()
public double getTotalTimeSeconds()
public int getTaskCount()
public InjectorMonitor.TaskInfo[] getTaskInfo()
public String shortSummary()
public String prettyPrint()
Copyright © 2003–2017 eXo Platform SAS. All rights reserved.