Class CounterImpl

  • All Implemented Interfaces:
    org.eclipse.microprofile.metrics.Counter, org.eclipse.microprofile.metrics.Counting, org.eclipse.microprofile.metrics.Metric

    @Vetoed
    public class CounterImpl
    extends Object
    implements org.eclipse.microprofile.metrics.Counter
    An incrementing and decrementing counter metric.
    • Constructor Detail

      • CounterImpl

        public CounterImpl()
    • Method Detail

      • inc

        public void inc()
        Increment the counter by one.
        Specified by:
        inc in interface org.eclipse.microprofile.metrics.Counter
      • inc

        public void inc​(long n)
        Increment the counter by n.
        Specified by:
        inc in interface org.eclipse.microprofile.metrics.Counter
        Parameters:
        n - the amount by which the counter will be increased
      • dec

        @Deprecated
        public void dec()
        Deprecated.
        since Payara 5.193; removed in MP Metrics 2.0
        Decrement the counter by one.
      • dec

        @Deprecated
        public void dec​(long n)
        Deprecated.
        since Payara 5.193; removed in MP Metrics 2.0
        Decrement the counter by n.
        Parameters:
        n - the amount by which the counter will be decreased
      • getCount

        public long getCount()
        Returns the counter's current value.
        Specified by:
        getCount in interface org.eclipse.microprofile.metrics.Counter
        Specified by:
        getCount in interface org.eclipse.microprofile.metrics.Counting
        Returns:
        the counter's current value