public class PerformanceTestDescriptor
extends java.lang.Object
Users are strongly encouraged to call the setter methods, rather than accessing the fields directly. The fields may be made protected in a future release.
The following fields are compulsory:
job(Runnable)
duration(Duration)
or iterations(int)
PerformanceTestUtils#run(PerformanceTestDescriptor)
.Modifier and Type | Field and Description |
---|---|
Duration |
abortIfIterationLongerThan |
java.util.concurrent.CountDownLatch |
completionLatch |
Duration |
completionLatchTimeout |
Duration |
duration |
boolean |
histogram |
java.lang.Integer |
iterations |
java.lang.Runnable |
job |
Duration |
logInterval |
java.lang.Double |
minAcceptablePerSecond |
int |
numConcurrentJobs |
MeasurementResultPersister |
persister |
java.lang.Runnable |
postJob |
java.lang.Runnable |
postWarmup |
java.lang.Runnable |
preJob |
Duration |
sampleCpuInterval |
boolean |
sealed |
java.lang.String |
summary |
Duration |
warmup |
java.lang.Integer |
warmupIterations |
Constructor and Description |
---|
PerformanceTestDescriptor() |
Modifier and Type | Method and Description |
---|---|
PerformanceTestDescriptor |
abortIfIterationLongerThan(Duration val) |
PerformanceTestDescriptor |
completionLatch(java.util.concurrent.CountDownLatch val)
If non-null, the performance test will wait for this latch before stopping the timer.
|
PerformanceTestDescriptor |
completionLatchTimeout(Duration val)
The maximum length of time to wait for the
completionLatch(CountDownLatch) , after
executing the designated number of jobs. |
static PerformanceTestDescriptor |
create() |
static PerformanceTestDescriptor |
create(java.lang.String summary) |
PerformanceTestDescriptor |
duration(Duration val)
The length of time to repeatedly execute the job for, when measuring the performance.
|
PerformanceTestDescriptor |
histogram(boolean val)
Whether to collect a histogram of the individual job times.
|
PerformanceTestDescriptor |
iterations(int val)
See
duration(Duration) . |
PerformanceTestDescriptor |
job(java.util.concurrent.Callable<?> val)
See
job(Runnable) |
PerformanceTestDescriptor |
job(java.lang.Runnable val)
The job to be repeatedly executed.
|
PerformanceTestDescriptor |
logInterval(Duration val)
How often to log progress (e.g.
|
PerformanceTestDescriptor |
minAcceptablePerSecond(java.lang.Double val)
If non-null, the measured jobs-per-second will be compared against this number.
|
PerformanceTestDescriptor |
numConcurrentJobs(int val)
The number of concurrent jobs to execute.
|
PerformanceTestDescriptor |
postJob(java.lang.Runnable val)
To be run each time after the job (pausing the timer while this is run).
|
PerformanceTestDescriptor |
postWarmup(java.lang.Runnable val)
To be run once, after the warmup.
|
PerformanceTestDescriptor |
preJob(java.lang.Runnable val)
To be run each time before the job (pausing the timer while this is run).
|
PerformanceTestDescriptor |
sampleCpuInterval(Duration val)
How often to calculate + record the fraction of CPU being used.
|
void |
seal() |
PerformanceTestDescriptor |
summary(java.lang.String val) |
java.lang.String |
toString() |
PerformanceTestDescriptor |
warmup(Duration val)
The length of time to repeatedly execute the job for, before doing the proper performance
test.
|
PerformanceTestDescriptor |
warmupIterations(int val)
See
warmup(Duration) . |
public java.lang.String summary
public Duration warmup
public java.lang.Integer warmupIterations
public Duration duration
public java.lang.Integer iterations
public int numConcurrentJobs
public Duration abortIfIterationLongerThan
public java.lang.Runnable job
public java.lang.Runnable preJob
public java.lang.Runnable postJob
public java.lang.Runnable postWarmup
public java.util.concurrent.CountDownLatch completionLatch
public Duration completionLatchTimeout
public java.lang.Double minAcceptablePerSecond
public Duration sampleCpuInterval
public Duration logInterval
public boolean histogram
public MeasurementResultPersister persister
public boolean sealed
public static PerformanceTestDescriptor create()
public static PerformanceTestDescriptor create(java.lang.String summary)
public PerformanceTestDescriptor summary(java.lang.String val)
public PerformanceTestDescriptor warmup(Duration val)
warmup(Duration)
or warmupIterations(int)
should be
set - if neither is set, the warmup defaults to one tenth of the test duration.public PerformanceTestDescriptor warmupIterations(int val)
warmup(Duration)
.public PerformanceTestDescriptor duration(Duration val)
duration(Duration)
or iterations(int)
should be
set.public PerformanceTestDescriptor iterations(int val)
duration(Duration)
.public PerformanceTestDescriptor numConcurrentJobs(int val)
preJob(Runnable)
or postJob(Runnable)
,
then those pre/post hooks will be called before/after the concurrent jobs are all done.public PerformanceTestDescriptor abortIfIterationLongerThan(Duration val)
public PerformanceTestDescriptor job(java.lang.Runnable val)
public PerformanceTestDescriptor job(java.util.concurrent.Callable<?> val)
job(Runnable)
public PerformanceTestDescriptor preJob(java.lang.Runnable val)
public PerformanceTestDescriptor postJob(java.lang.Runnable val)
public PerformanceTestDescriptor postWarmup(java.lang.Runnable val)
public PerformanceTestDescriptor completionLatch(java.util.concurrent.CountDownLatch val)
public PerformanceTestDescriptor completionLatchTimeout(Duration val)
completionLatch(CountDownLatch)
, after
executing the designated number of jobs. If the latch has not completed within this time,
then the test will fail.public PerformanceTestDescriptor minAcceptablePerSecond(java.lang.Double val)
public PerformanceTestDescriptor histogram(boolean val)
public PerformanceTestDescriptor logInterval(Duration val)
public PerformanceTestDescriptor sampleCpuInterval(Duration val)
public void seal()
public java.lang.String toString()
toString
in class java.lang.Object