public interface MetricCollector
MetricCollector
s.
The MetricCollector
interface is used throughout the library,
independent of the actual underlying implementation. See the
DefaultMetricCollector
for a real implementation and the
NoopMetricCollector
for a discarding collector that has no
runtime overhead.
Please note that the implementation is not expected to raise any kind of error if the metric does not exist. To keep the actual application code short, no extra checking needs to be done. If the counter has not been added before, the value should be discarded. An error message can be logged though.
Modifier and Type | Method and Description |
---|---|
void |
addCounter(java.lang.String name)
Add a Counter to the collector.
|
void |
addHistogram(java.lang.String name)
Add a Histogram to the Collector.
|
void |
addMeter(java.lang.String name)
Add a Meter to the Collector.
|
void |
decrementCounter(java.lang.String name)
Decrement a Counter by one.
|
void |
decrementCounter(java.lang.String name,
int amount)
Decrement a Counter by the given amount.
|
void |
incrementCounter(java.lang.String name)
Increment a Counter by one.
|
void |
incrementCounter(java.lang.String name,
int amount)
Increment a Counter by the given amount.
|
void |
markMeter(java.lang.String name)
Mark a checkpoint in the Meter.
|
void |
removeCounter(java.lang.String name)
Remove a Counter from the collector.
|
void |
removeHistogram(java.lang.String name)
Remove a Histogram from the Collector.
|
void |
removeMeter(java.lang.String name)
Remove a Meter from the Collector.
|
void |
updateHistogram(java.lang.String name,
int amount)
Update the Histogram with the given amount.
|
void addCounter(java.lang.String name)
name
- the name of the counter.void removeCounter(java.lang.String name)
name
- the name of the counter.void incrementCounter(java.lang.String name)
name
- the name of the counter.void incrementCounter(java.lang.String name, int amount)
name
- the name of the counter.amount
- the amount to increase.void decrementCounter(java.lang.String name)
name
- the name of the counter.void decrementCounter(java.lang.String name, int amount)
name
- the name of the counter.amount
- the amount to decrease.void addMeter(java.lang.String name)
name
- the name of the counter.void removeMeter(java.lang.String name)
name
- the name of the counter.void markMeter(java.lang.String name)
name
- the name of the counter.void addHistogram(java.lang.String name)
name
- the name of the counter.void removeHistogram(java.lang.String name)
name
- the name of the counter.void updateHistogram(java.lang.String name, int amount)
name
- the name of the counter.amount
- the amount to update.Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.