net.sf.sparql.benchmarking.stats
Interface OperationRun

All Superinterfaces:
Comparable<OperationRun>
All Known Implementing Classes:
AbstractOperationRun, OperationRunImpl, QueryRun, UpdateRun

public interface OperationRun
extends Comparable<OperationRun>

Represents statistics about a single run of an operation

Author:
rvesse

Field Summary
static long NOT_YET_RUN
          Constant used to indicate that an operation has not yet been run and thus the statistic retrieved is not available
static long UNKNOWN
          Constant used to indicate that an operation has some unknown statistic
 
Method Summary
 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.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

NOT_YET_RUN

static final long NOT_YET_RUN
Constant used to indicate that an operation has not yet been run and thus the statistic retrieved is not available

See Also:
Constant Field Values

UNKNOWN

static final long UNKNOWN
Constant used to indicate that an operation has some unknown statistic

See Also:
Constant Field Values
Method Detail

getRuntime

long getRuntime()
Gets the runtime in nanoseconds

Returns:
Runtime in nanoseconds

getResponseTime

long getResponseTime()
Gets the response time in nanoseconds

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 getRuntime() statistic.

Returns:
Response Time in nanoseconds

getResultCount

long getResultCount()
Gets the number of results returned for operations to which this is applicable

Returns:
Number of results

wasSuccessful

boolean wasSuccessful()
Returns whether this run represents a successful (i.e. non-error) run of the operation

Returns:
True if the run was successful

getErrorMessage

String getErrorMessage()
Gets the error message associated with the operation run, will be null if the operation ran successfully

Returns:
Error Message or null

getErrorCategory

int getErrorCategory()
Gets an integer identifying the category of error

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.

Returns:
Error category

getRunOrder

long getRunOrder()
Gets the global run order for this operation run

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.

Returns:
Global Order

setRunOrder

void setRunOrder(long order)
                 throws IllegalAccessError
Sets the global run order for this operation run

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

Parameters:
order - Order
Throws:
IllegalAccessError - Thrown if you try to set the run order after it has been set

getId

int getId()
Gets the ID for the operation (if known)

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.

Returns:
ID if known, UNKNOWN otherwise

setId

void setId(int id)
           throws IllegalAccessError
Sets the ID for the operation

Parameters:
id -
Throws:
IllegalAccessError


Copyright © 2014. All Rights Reserved.