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()
OperationRungetRuntime in interface OperationRunpublic 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 OperationRunpublic long getResultCount()
OperationRungetResultCount in interface OperationRunpublic boolean wasSuccessful()
OperationRunwasSuccessful in interface OperationRunpublic String getErrorMessage()
OperationRungetErrorMessage in interface OperationRunpublic 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 OperationRunpublic long getRunOrder()
OperationRunThis 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 OperationRunpublic 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 OperationRunorder - 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 OperationRunOperationRun.UNKNOWN otherwisepublic void setId(int id)
throws IllegalAccessError
OperationRun
setId in interface OperationRunIllegalAccessErrorpublic int compareTo(OperationRun other)
Used for sorting the runs so outliers can be trimmed
compareTo in interface Comparable<OperationRun>Copyright © 2015. All rights reserved.