@ThreadSafe public interface Meter
There are two ways to record measurements:
TODO: Update comment.
| Modifier and Type | Method and Description |
|---|---|
LabelSet |
createLabelSet(Map<String,String> labels)
Returns a new
LabelSet with labels built from the keys and values in the provided Map. |
LabelSet |
createLabelSet(String... keyValuePairs)
Returns a new
LabelSet with the given labels. |
DoubleCounter.Builder |
doubleCounterBuilder(String name)
Returns a builder for a
DoubleCounter. |
DoubleMeasure.Builder |
doubleMeasureBuilder(String name)
Returns a new builder for a
DoubleMeasure. |
DoubleObserver.Builder |
doubleObserverBuilder(String name)
Returns a new builder for a
DoubleObserver. |
LongCounter.Builder |
longCounterBuilder(String name)
Returns a builder for a
LongCounter. |
LongMeasure.Builder |
longMeasureBuilder(String name)
Returns a new builder for a
LongMeasure. |
LongObserver.Builder |
longObserverBuilder(String name)
Returns a new builder for a
LongObserver. |
BatchRecorder |
newBatchRecorder(String... keyValuePairs)
Utility method that allows users to atomically record measurements to a set of Measures with a
common set of labels.
|
DoubleCounter.Builder doubleCounterBuilder(String name)
DoubleCounter.name - the name of the metric. Should be a ASCII string with a length no greater than 255
characters.DoubleCounter.Builder.NullPointerException - if name is null.IllegalArgumentException - if different metric with the same name already registered.IllegalArgumentException - if the name does not match the requirements.LongCounter.Builder longCounterBuilder(String name)
LongCounter.name - the name of the metric. Should be a ASCII string with a length no greater than 255
characters.LongCounter.Builder.NullPointerException - if name is null.IllegalArgumentException - if different metric with the same name already registered.IllegalArgumentException - if the name does not match the requirements.DoubleMeasure.Builder doubleMeasureBuilder(String name)
DoubleMeasure.name - Name of measure, as a String. Should be a ASCII string with a length no
greater than 255 characters.DoubleMeasure.NullPointerException - if name is null.IllegalArgumentException - if different metric with the same name already registered.IllegalArgumentException - if the name does not match the requirements.LongMeasure.Builder longMeasureBuilder(String name)
LongMeasure.name - Name of measure, as a String. Should be a ASCII string with a length no
greater than 255 characters.LongMeasure.NullPointerException - if name is null.IllegalArgumentException - if different metric with the same name already registered.IllegalArgumentException - if the name does not match the requirements.DoubleObserver.Builder doubleObserverBuilder(String name)
DoubleObserver.name - Name of observer, as a String. Should be a ASCII string with a length no
greater than 255 characters.DoubleObserver.NullPointerException - if name is null.IllegalArgumentException - if different metric with the same name already registered.IllegalArgumentException - if the name does not match the requirements.LongObserver.Builder longObserverBuilder(String name)
LongObserver.name - Name of observer, as a String. Should be a ASCII string with a length no
greater than 255 characters.LongObserver.NullPointerException - if name is null.IllegalArgumentException - if different metric with the same name already registered.IllegalArgumentException - if the name does not match the requirements.BatchRecorder newBatchRecorder(String... keyValuePairs)
keyValuePairs - The set of labels to associate with this recorder and all it's recordings.MeasureBatchRecorder that can be use to atomically record a set of
measurements associated with different Measures.LabelSet createLabelSet(String... keyValuePairs)
LabelSet with the given labels.
The arguments must are in key, value pairs, so an even number of arguments are required.
If no arguments are provided, the resulting LabelSet will be the empty one.
keyValuePairs - pairs of keys and values for the labels.LabelSet with the given labels.IllegalArgumentException - if there aren't an even number of arguments.LabelSet createLabelSet(Map<String,String> labels)
LabelSet with labels built from the keys and values in the provided Map.labels - The key-value pairs to turn into labels.LabelSet with the given labels.NullPointerException - if the map is null.