Class SampledCounterConfig

    • Constructor Summary

      Constructors 
      Constructor Description
      SampledCounterConfig​(int intervalSecs, int historySize, boolean isResetOnSample, long initialValue)
      Make a new timed counter config (duh)
    • Constructor Detail

      • SampledCounterConfig

        public SampledCounterConfig​(int intervalSecs,
                                    int historySize,
                                    boolean isResetOnSample,
                                    long initialValue)
        Make a new timed counter config (duh)
        Parameters:
        intervalSecs - the interval (in seconds) between sampling
        historySize - number of counter samples that will be retained in memory
        isResetOnSample - true if the counter should be reset to 0 upon each sample
    • Method Detail

      • getHistorySize

        public int getHistorySize()
        Returns the history size
        Returns:
        The history size
      • getIntervalSecs

        public int getIntervalSecs()
        Returns the interval time (seconds)
        Returns:
        Interval of the sampling thread in seconds
      • isResetOnSample

        public boolean isResetOnSample()
        Returns true if counters created from this config will reset on each sample
        Returns:
        true if values are reset to the initial value after each sample
      • createCounter

        public Counter createCounter()
        Creates and returns a Counter based on the initial value
        Overrides:
        createCounter in class CounterConfig
        Returns:
        The counter created by this config