Class SampledCounterImpl

    • Constructor Detail

      • SampledCounterImpl

        public SampledCounterImpl​(long intervalInSeconds,
                                  int historySize,
                                  boolean resetOnSample,
                                  long initValue,
                                  boolean sampleNow)
        Constructor accepting raw config values.
        Parameters:
        intervalInSeconds - sampling interval in seconds
        historySize - size of history sample
        resetOnSample - true to reset value on sample
        initValue - initial value
        sampleNow - true to record smaple immediately
    • Method Detail

      • shutdown

        public void shutdown()
        Shutdown this counter
        Specified by:
        shutdown in interface SampledCounter
      • getTimerTask

        public java.util.TimerTask getTimerTask()
        Returns the timer task for this sampled counter
        Returns:
        the timer task for this sampled counter
      • getIntervalMillis

        public long getIntervalMillis()
        Returns the sampling thread interval in millis
        Returns:
        the sampling thread interval in millis
      • getAndReset

        public long getAndReset()
        Returns the current value of the counter and resets it to 0
        Specified by:
        getAndReset in interface SampledCounter
        Returns:
        current value of the counter