Package net.spy.memcached.metrics
Interface MetricCollector
-
- All Known Implementing Classes:
AbstractMetricCollector,DefaultMetricCollector,NoopMetricCollector
public interface MetricCollectorDefines a common API for allMetricCollectors.The
MetricCollectorinterface is used throughout the library, independent of the actual underlying implementation. See theDefaultMetricCollectorfor a real implementation and theNoopMetricCollectorfor 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCounter(java.lang.String name)Add a Counter to the collector.voidaddHistogram(java.lang.String name)Add a Histogram to the Collector.voidaddMeter(java.lang.String name)Add a Meter to the Collector.voiddecrementCounter(java.lang.String name)Decrement a Counter by one.voiddecrementCounter(java.lang.String name, int amount)Decrement a Counter by the given amount.voidincrementCounter(java.lang.String name)Increment a Counter by one.voidincrementCounter(java.lang.String name, int amount)Increment a Counter by the given amount.voidmarkMeter(java.lang.String name)Mark a checkpoint in the Meter.voidremoveCounter(java.lang.String name)Remove a Counter from the collector.voidremoveHistogram(java.lang.String name)Remove a Histogram from the Collector.voidremoveMeter(java.lang.String name)Remove a Meter from the Collector.voidupdateHistogram(java.lang.String name, int amount)Update the Histogram with the given amount.
-
-
-
Method Detail
-
addCounter
void addCounter(java.lang.String name)
Add a Counter to the collector.- Parameters:
name- the name of the counter.
-
removeCounter
void removeCounter(java.lang.String name)
Remove a Counter from the collector.- Parameters:
name- the name of the counter.
-
incrementCounter
void incrementCounter(java.lang.String name)
Increment a Counter by one.- Parameters:
name- the name of the counter.
-
incrementCounter
void incrementCounter(java.lang.String name, int amount)Increment a Counter by the given amount.- Parameters:
name- the name of the counter.amount- the amount to increase.
-
decrementCounter
void decrementCounter(java.lang.String name)
Decrement a Counter by one.- Parameters:
name- the name of the counter.
-
decrementCounter
void decrementCounter(java.lang.String name, int amount)Decrement a Counter by the given amount.- Parameters:
name- the name of the counter.amount- the amount to decrease.
-
addMeter
void addMeter(java.lang.String name)
Add a Meter to the Collector.- Parameters:
name- the name of the counter.
-
removeMeter
void removeMeter(java.lang.String name)
Remove a Meter from the Collector.- Parameters:
name- the name of the counter.
-
markMeter
void markMeter(java.lang.String name)
Mark a checkpoint in the Meter.- Parameters:
name- the name of the counter.
-
addHistogram
void addHistogram(java.lang.String name)
Add a Histogram to the Collector.- Parameters:
name- the name of the counter.
-
removeHistogram
void removeHistogram(java.lang.String name)
Remove a Histogram from the Collector.- Parameters:
name- the name of the counter.
-
updateHistogram
void updateHistogram(java.lang.String name, int amount)Update the Histogram with the given amount.- Parameters:
name- the name of the counter.amount- the amount to update.
-
-