Package com.xceptance.xlt.api.engine
Class AbstractCustomSampler
- java.lang.Object
-
- com.xceptance.xlt.api.engine.AbstractCustomSampler
-
public abstract class AbstractCustomSampler extends java.lang.ObjectTheAbstractCustomSamplerprovides the common functionality of custom samplers.
-
-
Constructor Summary
Constructors Constructor Description AbstractCustomSampler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract doubleexecute()Execute the sampler.longgetInterval()Get the execution interval.java.lang.StringgetName()Get the sampler name.java.util.PropertiesgetProperties()Get properties of this sampler.voidinitialize()Executed once at the start of the sampler.voidsetInterval(long interval)Set the execution interval.voidsetInterval(java.lang.String interval)Set the execution interval.voidsetName(java.lang.String name)Set the sampler name.voidsetProperties(java.util.Properties properties)Set properties of this sampler.voidshutdown()Executed once when the sampler get shut down.
-
-
-
Method Detail
-
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(String)
-
setInterval
public void setInterval(java.lang.String interval)
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
public void setName(java.lang.String name)
Set the sampler name. Setting the name after the sampler has started will have no effect.- Parameters:
name- sampler name
-
getName
public java.lang.String getName()
Get the sampler name.- Returns:
- sampler name
-
getProperties
public java.util.Properties getProperties()
Get properties of this sampler.- Returns:
- all properties
-
setProperties
public void setProperties(java.util.Properties properties)
Set properties of this sampler.- Parameters:
properties- properties for that sampler
-
-