public class MeasurementUnit extends Object implements Serializable
ReportManager.newMeasurementUnit()
.Modifier and Type | Method and Description |
---|---|
void |
appendResult(String label,
Object value)
Appends a custom result.
|
boolean |
equals(Object obj) |
long |
getEnqueueTime()
Gets the time when the current sender request was enqueued.
|
Exception |
getFailure()
Gets the failure that happened during processing of this task.
|
long |
getIteration()
Gets the number of current iteration of this Measurement Unit.
|
double |
getLastTime()
Gets time of the last measurement (time period between calls to
startMeasure() and stopMeasure() in milliseconds. |
Object |
getResult(String label)
Gets a custom result for the given label.
|
Map<String,Object> |
getResults()
Gets immutable map with all the custom results.
|
double |
getServiceTime()
Gets the total service time between enqueuing the sender task and its completion.
|
long |
getStartTime()
Gets the start time of the measurement in nanoseconds.
|
long |
getStopTime()
Gets the stop time of the measurement in nanoseconds.
|
double |
getTotalTime()
Gets total time measured during all measurements done by this Measurement Unit (all time periods between calls to
startMeasure() and stopMeasure() in milliseconds. |
int |
hashCode() |
void |
setEnqueueTime(long enqueueTime)
Sets the time when the current sender request was enqueued.
|
void |
setFailure(Exception failure)
Sets the exception that happened during processing of this task to be remembered and reported.
|
boolean |
startedAfter(long ref)
Checks whether this measurement unit was first started after the specified time (Unix time in millis).
|
void |
startMeasure()
Starts measuring.
|
void |
stopMeasure()
Stops measuring.
|
static MeasurementUnit |
streamIn(ObjectInputStream in)
Reads the minimalistic serialization of Measurement Unit from the input stream.
|
void |
streamOut(ObjectOutputStream oos)
Writes this instance into output stream with a minimum data needed.
|
String |
toString() |
public void appendResult(String label, Object value)
label
- The label of the result.value
- The value of the result.public Map<String,Object> getResults()
public Object getResult(String label)
label
- The label of the custom result.public void startMeasure()
public void stopMeasure()
public double getTotalTime()
startMeasure()
and stopMeasure()
in milliseconds.public long getStartTime()
public long getStopTime()
public double getLastTime()
startMeasure()
and stopMeasure()
in milliseconds.public double getServiceTime()
public boolean startedAfter(long ref)
ref
- The reference time to compare to the start of the measurement.true
if this measurement unit was first started after the specified reference time.public long getIteration()
public Exception getFailure()
public void setFailure(Exception failure)
failure
- The exception that happened or null to clear the failure flag.public long getEnqueueTime()
public void setEnqueueTime(long enqueueTime)
enqueueTime
- The time when the current sender request was enqueued.public void streamOut(ObjectOutputStream oos) throws IOException
oos
- Stream to write the data to.IOException
- When there was an error writing the data.public static MeasurementUnit streamIn(ObjectInputStream in) throws ClassNotFoundException, IOException
in
- The stream to read the object data from.MeasurementUnit
.ClassNotFoundException
- When it is not possible to restore an unknown class from the data.IOException
- When there was an I/O error reading data.Copyright © 2010–2017 PerfCake Community. All rights reserved.