Class Counter

java.lang.Object
io.dropwizard.metrics5.Counter
All Implemented Interfaces:
Counting, Metric

public class Counter extends Object implements Metric, Counting
An incrementing and decrementing counter metric.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dec()
    Decrement the counter by one.
    void
    dec(long n)
    Decrement the counter by n.
    long
    Returns the counter's current value.
    void
    inc()
    Increment the counter by one.
    void
    inc(long n)
    Increment the counter by n.

    Methods inherited from class java.lang.Object

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

    • Counter

      public Counter()
  • Method Details

    • inc

      public void inc()
      Increment the counter by one.
    • inc

      public void inc(long n)
      Increment the counter by n.
      Parameters:
      n - the amount by which the counter will be increased
    • dec

      public void dec()
      Decrement the counter by one.
    • dec

      public void dec(long n)
      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 Counting
      Returns:
      the counter's current value