public abstract class AbstractOperationRun extends Object implements OperationRun
NOT_YET_RUN, UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
AbstractOperationRun(long runtime,
long resultCount)
Creates an operation run which represents the results of running an
operation
|
protected |
AbstractOperationRun(long runtime,
long responseTime,
long resultCount)
Creates an operation run which represents the results of running an
operation
|
protected |
AbstractOperationRun(String error,
int errorCategory,
long runtime)
Creates a operation run which represents that the running of an operation
resulted in an error
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(OperationRun other)
Compares a run to another
|
int |
getErrorCategory()
Gets an integer identifying the category of error
|
String |
getErrorMessage()
Gets the error message associated with the operation run, will be null if
the operation ran successfully
|
int |
getId()
Gets the ID for the operation (if known)
|
long |
getResponseTime()
Gets the response time in nanoseconds
|
long |
getResultCount()
Gets the number of results returned for operations to which this is
applicable
|
long |
getRunOrder()
Gets the global run order for this operation run
|
long |
getRuntime()
Gets the runtime in nanoseconds
|
void |
setId(int id)
Sets the ID for the operation
|
void |
setRunOrder(long order)
Sets the global run order for this operation run
|
boolean |
wasSuccessful()
Returns whether this run represents a successful (i.e.
|
protected AbstractOperationRun(String error, int errorCategory, long runtime)
error
- Error Messageruntime
- Runtime, this is the amount of time elapsed until the
error/timeout was reachedprotected AbstractOperationRun(long runtime, long resultCount)
runtime
- RuntimeresultCount
- Result Countprotected AbstractOperationRun(long runtime, long responseTime, long resultCount)
runtime
- RuntimeresponseTime
- Response TimeresultCount
- Result Countpublic long getRuntime()
OperationRun
getRuntime
in interface OperationRun
public long getResponseTime()
OperationRun
Response Time is an additional metric which currently is only calculated
for certain operations. This metric is the time taken for the first
results of the operation to become available so where the operation
receives a streamed response this may be much smaller than the
OperationRun.getRuntime()
statistic.
getResponseTime
in interface OperationRun
public long getResultCount()
OperationRun
getResultCount
in interface OperationRun
public boolean wasSuccessful()
OperationRun
wasSuccessful
in interface OperationRun
public String getErrorMessage()
OperationRun
getErrorMessage
in interface OperationRun
public int getErrorCategory()
OperationRun
Some basic categories are provided by ErrorCategories
and the
return type of this method is explicitly an int
rather than some
category enum
in order to allow users of the API to define their
own error categories for their custom operations.
getErrorCategory
in interface OperationRun
public long getRunOrder()
OperationRun
This is the order the operation was run in relative to all other operations run in the benchmark and is primarily useful when looking at the results of multi-threaded benchmarks.
getRunOrder
in interface OperationRun
public void setRunOrder(long order) throws IllegalAccessError
OperationRun
Intended for use by OperationRunner
implementations to allow them
to record the run order of this operation relative to all other
operations run, this is primarily useful when tracking multi-threaded
runs. Trying to set this once it has been set will lead to an
IllegalAccessError
setRunOrder
in interface OperationRun
order
- OrderIllegalAccessError
- Thrown if you try to set the run order after it has been setpublic int getId()
OperationRun
This ID can be used to link the operation run back to an operation in the
originating operation mix, this can be useful when using
OperationMixRunner
implementations which may run the same
operation multiple times in a single mix run or may not necessarily run
all operations every time.
getId
in interface OperationRun
OperationRun.UNKNOWN
otherwisepublic void setId(int id) throws IllegalAccessError
OperationRun
setId
in interface OperationRun
IllegalAccessError
public int compareTo(OperationRun other)
Used for sorting the runs so outliers can be trimmed
compareTo
in interface Comparable<OperationRun>
Copyright © 2015. All rights reserved.