public class RampUpDownGenerator extends DefaultMessageGenerator
The generating starts with the number of threads set to the value of the preThreadCount
property.
It continues to execute for the duration set by the preDuration
property.
The period is called the PRE
phase.
When PRE
phase ends,
the RAMP UP
phase starts.
In the RAMP UP
phase
the number of threads is changed by the value of the rampUpStep
property
each period set by the rampUpStepPeriod
until it reaches the number of threads
set by the value of the mainThreadCount
property.
In that moment MAIN
phase starts
and the execution continues for the duration set by the mainDuration
property,
after which the RAMP DOWN
phase starts.
In the RAMP DOWN
phase
the number of threads is again changed but this time in the opposite direction than
in the RAMP UP
phase.
It changes by the value of the rampDownStep
property each period specified
by the rampDownStepPeriod
property until the final number of threads is reached.
By that moment the final phase called POST
starts.
The POST
phase ends by the end of the scenario execution.
The outer borders of the number of threads and the duration is set by the maximum number of threads
specified by the threads
attribute of the generator and by the maximum duration set by the run
element.
Constructor and Description |
---|
RampUpDownGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
generate()
Generates the messages.
|
long |
getMainDuration()
Gets a duration period for which the
MAIN phase lasts. |
int |
getMainThreadCount()
Gets a maximal number of threads - the number of threads used in the
MAIN phase. |
int |
getPostThreadCount()
Gets a final number of threads - the number of threads in the
POST phase. |
long |
getPreDuration()
Gets duration period of the
PRE phase,
before the RAMP UP phase starts. |
int |
getPreThreadCount()
Gets an initial number of threads - the number of threads in the
PRE phase. |
int |
getRampDownStep()
Gets a number by which the number of threads is changed in the
RAMP DOWN phase. |
long |
getRampDownStepPeriod()
Gets a duration period after which the number of threads is changed in
RAMP DOWN phase. |
int |
getRampUpStep()
Gets a number by which the number of threads is changed in the
RAMP UP phase. |
long |
getRampUpStepPeriod()
Gets a duration period after which the number of threads is changed in
RAMP UP phase. |
void |
init(MessageSenderManager messageSenderManager,
List<MessageTemplate> messageStore)
Initializes the generator.
|
RampUpDownGenerator |
setMainDuration(long mainDuration)
Sets a duration period for which the
MAIN phase lasts. |
RampUpDownGenerator |
setMainThreadCount(int mainThreadCount)
Sets a maximal number of threads - the number of threads used in the
MAIN phase. |
RampUpDownGenerator |
setPostThreadCount(int postThreadCount)
Sets a final number of threads - the number of threads in the
POST phase. |
RampUpDownGenerator |
setPreDuration(long preDuration)
Sets duration period of the
PRE phase,
before the RAMP UP phase starts. |
RampUpDownGenerator |
setPreThreadCount(int preThreadCount)
Sets a final number of threads - the number of threads in the
PRE phase. |
RampUpDownGenerator |
setRampDownStep(int rampDownStep)
Sets a number by which the number of threads is changed in the
RAMP DOWN phase. |
RampUpDownGenerator |
setRampDownStepPeriod(long rampDownStepPeriod)
Sets a duration period after which the number of threads is changed in
RAMP DOWN phase. |
RampUpDownGenerator |
setRampUpStep(int rampUpStep)
Sets a number by which the number of threads is changed in the
RAMP UP phase. |
RampUpDownGenerator |
setRampUpStepPeriod(long rampUpStepPeriod)
Sets a duration period after which the number of threads is changed in
RAMP UP phase. |
getDuration, getMonitoringPeriod, getSenderTaskQueueSize, getShutdownPeriod, setMonitoringPeriod, setReportManager, setSenderTaskQueueSize, setShutdownPeriod
close, getActiveThreadsCount, getTasksInQueue, getThreads, interrupt, isFailFast, setCorrelator, setRunInfo, setSequenceManager, setThreads, setValidationManager
public void init(MessageSenderManager messageSenderManager, List<MessageTemplate> messageStore) throws PerfCakeException
AbstractMessageGenerator
AbstractMessageGenerator.messageSenderManager
is initialized as well.init
in interface MessageGenerator
init
in class AbstractMessageGenerator
messageSenderManager
- Message sender manager.messageStore
- Message store where the messages are taken from.PerfCakeException
- When it was not possible to initialize the generator.public void generate() throws Exception
AbstractMessageGenerator
generate
in interface MessageGenerator
generate
in class DefaultMessageGenerator
Exception
- When it was not possible to generate the messages.public int getPreThreadCount()
PRE
phase.public RampUpDownGenerator setPreThreadCount(int preThreadCount)
PRE
phase.preThreadCount
- The initial number of threads.public int getPostThreadCount()
POST
phase.public RampUpDownGenerator setPostThreadCount(int postThreadCount)
POST
phase.postThreadCount
- The final number of threads.public long getPreDuration()
PRE
phase,
before the RAMP UP
phase starts.run
type.public RampUpDownGenerator setPreDuration(long preDuration)
PRE
phase,
before the RAMP UP
phase starts.preDuration
- PRE phase duration period in the units of run
type.public int getRampUpStep()
RAMP UP
phase.public RampUpDownGenerator setRampUpStep(int rampUpStep)
RAMP UP
phase.rampUpStep
- The size of the step.public long getRampUpStepPeriod()
RAMP UP
phase.run
type.public RampUpDownGenerator setRampUpStepPeriod(long rampUpStepPeriod)
RAMP UP
phase.rampUpStepPeriod
- The RAMP UP step duration period in a units of run
type.public int getRampDownStep()
RAMP DOWN
phase.public RampUpDownGenerator setRampDownStep(int rampDownStep)
RAMP DOWN
phase.rampDownStep
- The size of the step.public long getRampDownStepPeriod()
RAMP DOWN
phase.run
type.public RampUpDownGenerator setRampDownStepPeriod(long rampDownStepPeriod)
RAMP DOWN
phase.rampDownStepPeriod
- The RAMP DOWN step duration period in a units of run
type.public long getMainDuration()
MAIN
phase lasts.run
type.public RampUpDownGenerator setMainDuration(long mainDuration)
MAIN
phase lasts.mainDuration
- The MAIN phase duration period in the units of run
type.public int getMainThreadCount()
MAIN
phase.public RampUpDownGenerator setMainThreadCount(int mainThreadCount)
MAIN
phase.mainThreadCount
- The maximal number of threads.Copyright © 2010–2017 PerfCake Community. All rights reserved.