Class Counter

java.lang.Object
com.yahoo.metrics.simple.Counter

public class Counter extends Object
A counter metric. Create a counter by declaring it with MetricReceiver.declareCounter(String) or MetricReceiver.declareCounter(String, Point).
Author:
steinar
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add()
    Increase the dimension-less/zero-point value of this counter by 1.
    void
    add(long n)
    Add to the dimension-less/zero-point value of this counter.
    void
    add(long n, Point p)
    Add to this metric at the given point.
    void
    Increase this metric at the given point by 1.
    Create a PointBuilder with default dimension values as given when this counter was declared.

    Methods inherited from class java.lang.Object

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

    • add

      public void add()
      Increase the dimension-less/zero-point value of this counter by 1.
    • add

      public void add(long n)
      Add to the dimension-less/zero-point value of this counter.
      Parameters:
      n - the amount by which to increase this counter
    • add

      public void add(Point p)
      Increase this metric at the given point by 1.
      Parameters:
      p - the point in the metric space at which to increase this metric by 1
    • add

      public void add(long n, Point p)
      Add to this metric at the given point.
      Parameters:
      n - the amount by which to increase this counter
      p - the point in the metric space at which to add to the metric
    • builder

      public PointBuilder builder()
      Create a PointBuilder with default dimension values as given when this counter was declared.
      Returns:
      a PointBuilder reflecting the default dimension values of this counter