Class Counter

java.lang.Object
com.aerospike.client.metrics.Counter

public class Counter extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    A Counter is a container for a namespace-aggregate map of AtomicLong counters
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    getCountByNS(String namespace)
    Get the counter's count for the provided namespace
    long
    Get the counter's total, which is the sum of the counter across all namespaces
    void
    Increment the counter by 1 for the given namespace
    void
    increment(String ns, long count)
    Increment the counter by the provided count amount for the given namespace

    Methods inherited from class java.lang.Object

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

    • Counter

      public Counter()
      A Counter is a container for a namespace-aggregate map of AtomicLong counters
  • Method Details

    • increment

      public void increment(String ns)
      Increment the counter by 1 for the given namespace
      Parameters:
      ns - - the namespace for the counter
    • increment

      public void increment(String ns, long count)
      Increment the counter by the provided count amount for the given namespace
      Parameters:
      ns - - the namespace for the counter
      count - - the amount by which to increment the counter
    • getTotal

      public long getTotal()
      Get the counter's total, which is the sum of the counter across all namespaces
      Returns:
      the total
    • getCountByNS

      public long getCountByNS(String namespace)
      Get the counter's count for the provided namespace
      Parameters:
      namespace - the namespace for which we want the count
      Returns:
      the count for the namespace