Class SampledRateCounterImpl

    • Constructor Detail

      • SampledRateCounterImpl

        public SampledRateCounterImpl​(SampledRateCounterConfig config)
        Constructor accepting the config
        Parameters:
        config -
    • Method Detail

      • setValue

        public void setValue​(long numerator,
                             long denominator)
        Sets the values of the numerator and denominator to the passed values
        Specified by:
        setValue in interface SampledRateCounter
      • increment

        public void increment​(long numerator,
                              long denominator)
        Increments the numerator and denominator by the passed values
        Specified by:
        increment in interface SampledRateCounter
      • decrement

        public void decrement​(long numerator,
                              long denominator)
        Decrements the numerator and denominator by the passed values
        Specified by:
        decrement in interface SampledRateCounter
      • setDenominatorValue

        public void setDenominatorValue​(long newValue)
        Sets the value of the denominator to the passed value
        Specified by:
        setDenominatorValue in interface SampledRateCounter
      • setNumeratorValue

        public void setNumeratorValue​(long newValue)
        Sets the value of the numerator to the passed value
        Specified by:
        setNumeratorValue in interface SampledRateCounter
      • getValue

        public long getValue()
        Gets current value of the counter
        Specified by:
        getValue in interface Counter
        Overrides:
        getValue in class CounterImpl
        Returns:
        current value of the counter
      • getAndSet

        public long getAndSet​(long newValue)
        throws UnsupportedOperationException
        Specified by:
        getAndSet in interface Counter
        Overrides:
        getAndSet in class CounterImpl
        Returns:
        Returns the old value
      • setValue

        public void setValue​(long newValue)
        throws UnsupportedOperationException
        Specified by:
        setValue in interface Counter
        Overrides:
        setValue in class CounterImpl
      • decrement

        public long decrement()
        throws UnsupportedOperationException
        Specified by:
        decrement in interface Counter
        Overrides:
        decrement in class CounterImpl
        Returns:
        the value after decrementing
      • decrement

        public long decrement​(long amount)
        throws UnsupportedOperationException
        Specified by:
        decrement in interface Counter
        Overrides:
        decrement in class CounterImpl
        Returns:
        the value of the counter after decrementing
      • getMaxValue

        public long getMaxValue()
        throws UnsupportedOperationException
      • getMinValue

        public long getMinValue()
        throws UnsupportedOperationException
      • increment

        public long increment()
        throws UnsupportedOperationException
        Specified by:
        increment in interface Counter
        Overrides:
        increment in class CounterImpl
        Returns:
        the value after incrementing
      • increment

        public long increment​(long amount)
        throws UnsupportedOperationException
        Specified by:
        increment in interface Counter
        Overrides:
        increment in class CounterImpl
        Returns:
        the value of the counter after incrementing