Package io.narayana.perf
Class Measurement<T>
java.lang.Object
io.narayana.perf.Measurement<T>
- All Implemented Interfaces:
Serializable
- Author:
- M Musgrove Config and result data for running a work load (@link{Measurement#measure})
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMeasurement(int numberOfThreads, int numberOfCalls) Measurement(int numberOfThreads, int numberOfCalls, int batchSize) Measurement(long maxTestTime, int numberOfThreads, int numberOfCalls, int batchSize) Measurement(Measurement result) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel(boolean mayInterruptIfRunning) Cancel the measurement.voidCancel the measurement.intgetInfo()longintintintintintlonggetOne()doublelongvoidvoidincrementErrorCount(int delta) booleanbooleanbooleanbooleanbooleanmeasure(WorkerLifecycle<T> lifecycle, WorkerWorkload<T> workload) measure(WorkerWorkload<T> workload) voidsetContext(T value) voidsetException(Exception exception) voidvoidsetNumberOfErrors(int numberOfErrors) voidsetRegression(boolean regression) voidsetTotalMillis(long totalMillis) booleantoString()
-
Constructor Details
-
Measurement
public Measurement(int numberOfThreads, int numberOfCalls) -
Measurement
public Measurement(int numberOfThreads, int numberOfCalls, int batchSize) -
Measurement
public Measurement(long maxTestTime, int numberOfThreads, int numberOfCalls, int batchSize) -
Measurement
-
-
Method Details
-
isRegression
public boolean isRegression() -
isFailOnRegression
public boolean isFailOnRegression() -
shouldFail
public boolean shouldFail() -
setRegression
public void setRegression(boolean regression) -
setContext
-
getContext
-
getContexts
-
getNumberOfMeasurements
public int getNumberOfMeasurements() -
getNumberOfThreads
public int getNumberOfThreads() -
getNumberOfCalls
public int getNumberOfCalls() -
getBatchSize
public int getBatchSize() -
getTotalMillis
public long getTotalMillis() -
getOne
public long getOne() -
setTotalMillis
public void setTotalMillis(long totalMillis) -
getThroughput
public double getThroughput() -
getNumberOfErrors
public int getNumberOfErrors() -
setNumberOfErrors
public void setNumberOfErrors(int numberOfErrors) -
incrementErrorCount
public void incrementErrorCount() -
incrementErrorCount
public void incrementErrorCount(int delta) -
toString
-
setInfo
-
getInfo
-
cancel
public void cancel(boolean mayInterruptIfRunning) Cancel the measurement. A worker may cancel a measurement by invoking this method on the Measurement object it was passed in its @see Worker#doWork(T, int, Measurement) method- Parameters:
mayInterruptIfRunning- if false then any running calls to @see Worker#doWork will be allowed to finish before the the measurement is cancelled.
-
cancel
Cancel the measurement. A worker may cancel a measurement by invoking this method on the Measurement object it was passed in its @see Worker#doWork(T, int, Measurement) method- Parameters:
reason- the reason for the cancelationmayInterruptIfRunning- if false then any running calls to @see Worker#doWork will be allowed to finish before the the measurement is cancelled.
-
isCancelled
public boolean isCancelled() -
isMayInterruptIfRunning
public boolean isMayInterruptIfRunning() -
getMaxTestTime
public long getMaxTestTime()- Returns:
- max test time in milliseconds
-
getNumberOfWarmupCalls
public int getNumberOfWarmupCalls() -
isTimedOut
public boolean isTimedOut()- Returns:
- true if the measurement took longer than the maximum test time
getMaxTestTime()
-
measure
-
measure
-
setException
-
getException
-