Package com.yahoo.metrics.simple
Class Counter
- java.lang.Object
-
- com.yahoo.metrics.simple.Counter
-
@Beta public class Counter extends java.lang.Object
A counter metric. Create a counter by declaring it withMetricReceiver.declareCounter(String)
orMetricReceiver.declareCounter(String, Point)
.- Author:
- steinar
-
-
Method Summary
All Methods Instance Methods Concrete Methods 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
add(Point p)
Increase this metric at the given point by 1.PointBuilder
builder()
Create a PointBuilder with default dimension values as given when this counter was declared.
-
-
-
Method Detail
-
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 counterp
- 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
-
-