net.sf.sparql.benchmarking.stats.impl
Class OperationStatsImpl

java.lang.Object
  extended by net.sf.sparql.benchmarking.stats.impl.OperationStatsImpl
All Implemented Interfaces:
OperationStats

public class OperationStatsImpl
extends Object
implements OperationStats

Basic implementation of operation statistics interface

Author:
rvesse

Constructor Summary
OperationStatsImpl()
           
 
Method Summary
 void add(OperationRun run)
          Adds information for the given run to the statistics
 void clear()
          Clears all run statistics
 long getActualAverageRuntime()
          Gets average runtime for the operation over all runs (arithmetic mean) based on the actual runtime
 double getActualOperationsPerHour()
          Calculates how many times this operation could be executed multi-threaded per hour based upon the OperationStats.getActualAverageRuntime()
 double getActualOperationsPerSecond()
          Calculates how many times this operation could be executed multi-threaded per second based upon the OperationStats.getActualAverageRuntime()
 long getActualRuntime()
          Gets the actual runtime for the operation over all runs (takes into account operations that run in parallel)
 long getAverageResponseTime()
          Gets the average response time over all runs (arithmetic mean) based on the total response time
 long getAverageResults()
          Gets the average number of results
 long getAverageRuntime()
          Gets the average runtime for the operation over all runs (arithmetic mean) based on the total runtime
 Map<Integer,List<OperationRun>> getCategorizedErrors()
          Gets the information for all errors grouped by category
 double getGeometricAverageRuntime()
          Gets the average runtime for the operation over all runs (geometric mean) based on the total runtime
 long getMaximumRuntime()
          Gets the maximum runtime for this operation over all runs
 long getMinimumRuntime()
          Gets the minimum runtime for this operation over all runs
 double getOperationsPerHour()
          Calculates how many times this operation could be executed single-threaded per hour based upon the average runtime of the operation
 double getOperationsPerSecond()
          Calculates how many times this operation could be executed single-threaded per second based upon the average runtime of the operation
 long getRunCount()
          Gets the number of runs for the operation
 Iterator<OperationRun> getRuns()
          Gets an iterator over the operation runs
 double getStandardDeviation()
          Gets the standard deviation for operation runtime
 ParallelTimer getTimer()
          Gets the parallel timer used to track actual runtime
 long getTotalErrors()
          Gets the total number of times this operation resulted in an error
 long getTotalResponseTime()
          Gets the total response time for the operations over all runs
 long getTotalResults()
          Gets the total number of results for this operation
 long getTotalRuntime()
          Gets the total runtime for the query over all runs
 double getVariance()
          Gets the variance for the operation runtimes
 void trim(int outliers)
          Trims the best and worst N runs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationStatsImpl

public OperationStatsImpl()
Method Detail

getRuns

public Iterator<OperationRun> getRuns()
Description copied from interface: OperationStats
Gets an iterator over the operation runs

Specified by:
getRuns in interface OperationStats
Returns:
Runs of the operation

getTotalRuntime

public long getTotalRuntime()
Description copied from interface: OperationStats
Gets the total runtime for the query over all runs

Specified by:
getTotalRuntime in interface OperationStats
Returns:
Total Runtime in nanoseconds

getTotalErrors

public long getTotalErrors()
Description copied from interface: OperationStats
Gets the total number of times this operation resulted in an error

Specified by:
getTotalErrors in interface OperationStats
Returns:
Total number of errors

getCategorizedErrors

public Map<Integer,List<OperationRun>> getCategorizedErrors()
Description copied from interface: OperationStats
Gets the information for all errors grouped by category

Specified by:
getCategorizedErrors in interface OperationStats
Returns:
Errors grouped by category

getActualRuntime

public long getActualRuntime()
Description copied from interface: OperationStats
Gets the actual runtime for the operation over all runs (takes into account operations that run in parallel)

Specified by:
getActualRuntime in interface OperationStats
Returns:
Actual Runtime in nanoseconds

getTotalResponseTime

public long getTotalResponseTime()
Description copied from interface: OperationStats
Gets the total response time for the operations over all runs

For non-streaming operations this will likely be equal to OperationStats.getTotalRuntime()

Specified by:
getTotalResponseTime in interface OperationStats
Returns:
Total response time

getAverageRuntime

public long getAverageRuntime()
Description copied from interface: OperationStats
Gets the average runtime for the operation over all runs (arithmetic mean) based on the total runtime

Specified by:
getAverageRuntime in interface OperationStats
Returns:
Arithmetic Average Runtime in nanoseconds

getAverageResponseTime

public long getAverageResponseTime()
Description copied from interface: OperationStats
Gets the average response time over all runs (arithmetic mean) based on the total response time

For non-streaming operations this will likely be equal to OperationStats.getAverageRuntime()

Specified by:
getAverageResponseTime in interface OperationStats
Returns:
Average Response Time in nanoseconds

getGeometricAverageRuntime

public double getGeometricAverageRuntime()
Description copied from interface: OperationStats
Gets the average runtime for the operation over all runs (geometric mean) based on the total runtime

Specified by:
getGeometricAverageRuntime in interface OperationStats
Returns:
Geometric Average Runtime in nanoseconds

getActualAverageRuntime

public long getActualAverageRuntime()
Description copied from interface: OperationStats
Gets average runtime for the operation over all runs (arithmetic mean) based on the actual runtime

Specified by:
getActualAverageRuntime in interface OperationStats
Returns:
Arithmetic Average runtime in nanoseconds

getMinimumRuntime

public long getMinimumRuntime()
Description copied from interface: OperationStats
Gets the minimum runtime for this operation over all runs

Specified by:
getMinimumRuntime in interface OperationStats
Returns:
Minimum Runtime in nanoseconds

getMaximumRuntime

public long getMaximumRuntime()
Description copied from interface: OperationStats
Gets the maximum runtime for this operation over all runs

Specified by:
getMaximumRuntime in interface OperationStats
Returns:
Maximum Runtime in nanoseconds

getVariance

public double getVariance()
Description copied from interface: OperationStats
Gets the variance for the operation runtimes

Specified by:
getVariance in interface OperationStats
Returns:
Runtime Variance in nanoseconds

getStandardDeviation

public double getStandardDeviation()
Description copied from interface: OperationStats
Gets the standard deviation for operation runtime

Specified by:
getStandardDeviation in interface OperationStats
Returns:
Runtime Standard Deviation in nanoseconds

getTotalResults

public long getTotalResults()
Description copied from interface: OperationStats
Gets the total number of results for this operation

Specified by:
getTotalResults in interface OperationStats
Returns:
Total number of results

getAverageResults

public long getAverageResults()
Description copied from interface: OperationStats
Gets the average number of results

Specified by:
getAverageResults in interface OperationStats
Returns:
Average number of results

getOperationsPerSecond

public double getOperationsPerSecond()
Description copied from interface: OperationStats
Calculates how many times this operation could be executed single-threaded per second based upon the average runtime of the operation

Specified by:
getOperationsPerSecond in interface OperationStats
Returns:
Operations per Second

getActualOperationsPerSecond

public double getActualOperationsPerSecond()
Description copied from interface: OperationStats
Calculates how many times this operation could be executed multi-threaded per second based upon the OperationStats.getActualAverageRuntime()

Specified by:
getActualOperationsPerSecond in interface OperationStats
Returns:
Actual Operations per Second

getOperationsPerHour

public double getOperationsPerHour()
Description copied from interface: OperationStats
Calculates how many times this operation could be executed single-threaded per hour based upon the average runtime of the operation

Specified by:
getOperationsPerHour in interface OperationStats
Returns:
Operations per Hour

getActualOperationsPerHour

public double getActualOperationsPerHour()
Description copied from interface: OperationStats
Calculates how many times this operation could be executed multi-threaded per hour based upon the OperationStats.getActualAverageRuntime()

Specified by:
getActualOperationsPerHour in interface OperationStats
Returns:
Actual Operations per Hour

clear

public void clear()
Description copied from interface: OperationStats
Clears all run statistics

Specified by:
clear in interface OperationStats

trim

public void trim(int outliers)
Description copied from interface: OperationStats
Trims the best and worst N runs

Specified by:
trim in interface OperationStats
Parameters:
outliers - Number of outliers to trim

getRunCount

public long getRunCount()
Description copied from interface: OperationStats
Gets the number of runs for the operation

Specified by:
getRunCount in interface OperationStats
Returns:
Number of runs

add

public void add(OperationRun run)
Description copied from interface: OperationStats
Adds information for the given run to the statistics

Specified by:
add in interface OperationStats
Parameters:
run - Run information

getTimer

public ParallelTimer getTimer()
Description copied from interface: OperationStats
Gets the parallel timer used to track actual runtime

Specified by:
getTimer in interface OperationStats
Returns:
Parallel timer


Copyright © 2014. All Rights Reserved.