@NotThreadSafe public class PerformanceEvent extends BaseEvent
operation|starTime|stopTime|elapsedTime|operationSuccess|message where all times are given in
milliseconds, start and stop times are milliseconds since the epoch, and operation success is a 1 or 0.| Modifier and Type | Field and Description |
|---|---|
private long |
elapsedTime
Total elapsed time, in milliseconds, of the operation.
|
static String |
EVENT_TYPE
Type for a performance event.
|
private static String |
FIELD_SEPERATOR
Character used to separate the fields of the event.
|
private String |
operation
Identifier of the operation being timed.
|
private long |
startTime
System local time in milliseconds when the performance measurement started.
|
private long |
stopTime
System local time in milliseconds when the performance measurement stopped.
|
private boolean |
successfulOperation
Whether the operation completed successfully or failed.
|
| Constructor and Description |
|---|
PerformanceEvent(String operationId)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getElapsedTime()
Gets the total elapsed time, in milliseconds, of the operation.
|
String |
getOperation()
Gets the operation being timed.
|
long |
getStartTime()
Gets the system local time in milliseconds when the performance measurement started.
|
long |
getStopTime()
Gets the System local time in milliseconds when the performance measurement stopped.
|
String |
getType()
Gets the type of event.
|
boolean |
isOperationSuccessful()
Gets whether the operation was successful.
|
void |
startTime()
Records the timer of the operation.
|
void |
stopTime(boolean wasSuccess)
Records the completion time of the operation and whether the operation was successful.
|
String |
toString() |
getMessage, setMessagepublic static final String EVENT_TYPE
private static final String FIELD_SEPERATOR
private String operation
private boolean successfulOperation
private long startTime
private long stopTime
private long elapsedTime
public PerformanceEvent(String operationId)
operationId - unique ID of the operation, must never be null or emptypublic String getType()
public String getOperation()
public boolean isOperationSuccessful()
public void startTime()
public long getStartTime()
startTime() has not been called yetpublic void stopTime(boolean wasSuccess)
wasSuccess - whether the operation completed successfullypublic long getStopTime()
stopTime(boolean) has not been called yetpublic long getElapsedTime()
stopTime(boolean) has not been
called yetCopyright © 1999–2014. All rights reserved.