Class AbstractCustomSampler


  • public abstract class AbstractCustomSampler
    extends java.lang.Object
    The AbstractCustomSampler provides the common functionality of custom samplers.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract double execute()
      Execute the sampler.
      long getInterval()
      Get the execution interval.
      java.lang.String getName()
      Get the sampler name.
      java.util.Properties getProperties()
      Get properties of this sampler.
      void initialize()
      Executed once at the start of the sampler.
      void setInterval​(long interval)
      Set the execution interval.
      void setInterval​(java.lang.String interval)
      Set the execution interval.
      void setName​(java.lang.String name)
      Set the sampler name.
      void setProperties​(java.util.Properties properties)
      Set properties of this sampler.
      void shutdown()
      Executed once when the sampler get shut down.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractCustomSampler

        public AbstractCustomSampler()
    • 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 in setInterval(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