@Beta public class Counter extends Object
MetricReceiver.declareCounter(String)
or
MetricReceiver.declareCounter(String, Point)
.Modifier and Type | Field and Description |
---|---|
private Point |
defaultPosition |
private MetricReceiver |
metricReceiver |
private String |
name |
Constructor and Description |
---|
Counter(String name,
Point defaultPosition,
MetricReceiver receiver) |
Modifier and Type | Method and 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.
|
private final Point defaultPosition
private final String name
private final MetricReceiver metricReceiver
Counter(String name, Point defaultPosition, MetricReceiver receiver)
public void add()
public void add(long n)
n
- the amount by which to increase this counterpublic void add(Point p)
p
- the point in the metric space at which to increase this metric by 1public void add(long n, Point p)
n
- the amount by which to increase this counterp
- the point in the metric space at which to add to the metricpublic PointBuilder builder()
Copyright © 2018. All rights reserved.