Package com.xceptance.xlt.api.engine
Class AbstractCustomSampler
java.lang.Object
com.xceptance.xlt.api.engine.AbstractCustomSampler
The
AbstractCustomSampler provides the common functionality of custom samplers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract doubleexecute()Execute the sampler.longGet the execution interval.getName()Get the sampler name.Get properties of this sampler.voidExecuted once at the start of the sampler.voidsetInterval(long interval) Set the execution interval.voidsetInterval(String interval) Set the execution interval.voidSet the sampler name.voidsetProperties(Properties properties) Set properties of this sampler.voidshutdown()Executed once when the sampler get shut down.
-
Constructor Details
-
AbstractCustomSampler
public AbstractCustomSampler()
-
-
Method Details
-
initialize
public void initialize()Executed once at the start of the sampler. -
execute
public abstract double execute()Execute the sampler. -
shutdown
public void shutdown()Executed once when the sampler get shut down. -
setInterval
public void setInterval(long interval) Set the execution interval.- Parameters:
interval- positive interval value in milliseconds (0 or higher)- See Also:
-
setInterval
Set the execution interval. If using the convenience approach to set time periods (for example with "3h 5m 7s") in XLT the resulting number of milliseconds is computed internally.- Parameters:
interval- the milliseconds as insetInterval(long)or a time period as with the convenient way
-
getInterval
public long getInterval()Get the execution interval.- Returns:
- the execution interval
-
setName
Set the sampler name. Setting the name after the sampler has started will have no effect.- Parameters:
name- sampler name
-
getName
Get the sampler name.- Returns:
- sampler name
-
getProperties
Get properties of this sampler.- Returns:
- all properties
-
setProperties
Set properties of this sampler.- Parameters:
properties- properties for that sampler
-