public interface MeterRegistry
Container for metering instruments. Meters with the same name and type (DoubleCounter, etc) can
only be registered once.
TODO(stu): describe name, unit and description
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetDoubleAsyncCounter(String name) Retrieved a previously registeredDoubleAsyncCounter.getDoubleCounter(String name) Retrieved a previously registeredDoubleCounter.getDoubleGauge(String name) Retrieved a previously registeredDoubleGauge.getDoubleHistogram(String name) Retrieved a previously registeredDoubleHistogram.getDoubleUpDownCounter(String name) Retrieved a previously registeredDoubleUpDownCounter.getLongAsyncCounter(String name) Retrieved a previously registeredLongAsyncCounter.getLongCounter(String name) Retrieved a previously registeredLongCounter.getLongGauge(String name) Retrieved a previously registeredLongGauge.getLongHistogram(String name) Retrieved a previously registeredLongHistogram.getLongUpDownCounter(String name) Retrieved a previously registeredLongUpDownCounter.default DoubleAsyncCounterregisterDoubleAsyncCounter(String name, String description, String unit, Supplier<DoubleWithAttributes> observer) Register aDoubleAsyncCounterwith an asynchronous callback.registerDoubleCounter(String name, String description, String unit) Register aDoubleCounter.default DoubleGaugeregisterDoubleGauge(String name, String description, String unit, Supplier<DoubleWithAttributes> observer) Register aDoubleGauge.registerDoubleHistogram(String name, String description, String unit) Register aDoubleHistogram.registerDoublesAsyncCounter(String name, String description, String unit, Supplier<Collection<DoubleWithAttributes>> observer) Register aDoubleAsyncCounterwith an asynchronous callback.registerDoublesGauge(String name, String description, String unit, Supplier<Collection<DoubleWithAttributes>> observer) Register aDoubleGauge.registerDoubleUpDownCounter(String name, String description, String unit) Register aDoubleUpDownCounter.default LongAsyncCounterregisterLongAsyncCounter(String name, String description, String unit, Supplier<LongWithAttributes> observer) Register aLongAsyncCounterwith an asynchronous callback.registerLongCounter(String name, String description, String unit) Register aLongCounter.default LongGaugeregisterLongGauge(String name, String description, String unit, Supplier<LongWithAttributes> observer) Register aLongGauge.registerLongHistogram(String name, String description, String unit) Register aLongHistogram.registerLongsAsyncCounter(String name, String description, String unit, Supplier<Collection<LongWithAttributes>> observer) Register aLongAsyncCounterwith an asynchronous callback.registerLongsGauge(String name, String description, String unit, Supplier<Collection<LongWithAttributes>> observer) Register aLongGauge.registerLongUpDownCounter(String name, String description, String unit) Register aLongUpDownCounter.
-
Field Details
-
NOOP
Noop implementation for tests
-
-
Method Details
-
registerDoubleCounter
Register aDoubleCounter. The returned object may be reused.- Parameters:
name- name of the counterdescription- description of purposeunit- the unit (bytes, sec, hour)- Returns:
- the registered meter.
-
getDoubleCounter
Retrieved a previously registeredDoubleCounter.- Parameters:
name- name of the counter- Returns:
- the registered meter.
-
registerDoubleUpDownCounter
Register aDoubleUpDownCounter. The returned object may be reused.- Parameters:
name- name of the counterdescription- description of purposeunit- the unit (bytes, sec, hour)- Returns:
- the registered meter.
-
getDoubleUpDownCounter
Retrieved a previously registeredDoubleUpDownCounter.- Parameters:
name- name of the counter- Returns:
- the registered meter.
-
registerDoubleGauge
default DoubleGauge registerDoubleGauge(String name, String description, String unit, Supplier<DoubleWithAttributes> observer) Register aDoubleGauge. The returned object may be reused.- Parameters:
name- name of the gaugedescription- description of purposeunit- the unit (bytes, sec, hour)observer- callback to use. This is called once during reporting period. Must not throw an exception and must be safe to call from different threads.- Returns:
- the registered meter.
-
registerDoublesGauge
DoubleGauge registerDoublesGauge(String name, String description, String unit, Supplier<Collection<DoubleWithAttributes>> observer) Register aDoubleGauge. The returned object may be reused.- Parameters:
name- name of the gaugedescription- description of purposeunit- the unit (bytes, sec, hour)observer- callback to use. This is called once during reporting period. Must not throw an exception and must be safe to call from different threads.- Returns:
- the registered meter.
-
getDoubleGauge
Retrieved a previously registeredDoubleGauge.- Parameters:
name- name of the gauge- Returns:
- the registered meter.
-
registerDoubleHistogram
Register aDoubleHistogram. The returned object may be reused.- Parameters:
name- name of the histogramdescription- description of purposeunit- the unit (bytes, sec, hour)- Returns:
- the registered meter.
-
getDoubleHistogram
Retrieved a previously registeredDoubleHistogram.- Parameters:
name- name of the histogram- Returns:
- the registered meter.
-
registerLongCounter
Register aLongCounter. The returned object may be reused.- Parameters:
name- name of the counterdescription- description of purposeunit- the unit (bytes, sec, hour)- Returns:
- the registered meter.
-
registerLongAsyncCounter
default LongAsyncCounter registerLongAsyncCounter(String name, String description, String unit, Supplier<LongWithAttributes> observer) Register aLongAsyncCounterwith an asynchronous callback. The returned object may be reused.- Parameters:
name- name of the counterdescription- description of purposeunit- the unit (bytes, sec, hour)observer- a callback to provide a metric value upon observation (metric interval)
-
registerLongsAsyncCounter
LongAsyncCounter registerLongsAsyncCounter(String name, String description, String unit, Supplier<Collection<LongWithAttributes>> observer) Register aLongAsyncCounterwith an asynchronous callback. The returned object may be reused.- Parameters:
name- name of the counterdescription- description of purposeunit- the unit (bytes, sec, hour)observer- a callback to provide a metric values upon observation (metric interval)
-
getLongAsyncCounter
Retrieved a previously registeredLongAsyncCounter.- Parameters:
name- name of the counter- Returns:
- the registered meter.
-
registerDoubleAsyncCounter
default DoubleAsyncCounter registerDoubleAsyncCounter(String name, String description, String unit, Supplier<DoubleWithAttributes> observer) Register aDoubleAsyncCounterwith an asynchronous callback. The returned object may be reused.- Parameters:
name- name of the counterdescription- description of purposeunit- the unit (bytes, sec, hour)observer- a callback to provide a metric value upon observation (metric interval)
-
registerDoublesAsyncCounter
DoubleAsyncCounter registerDoublesAsyncCounter(String name, String description, String unit, Supplier<Collection<DoubleWithAttributes>> observer) Register aDoubleAsyncCounterwith an asynchronous callback. The returned object may be reused.- Parameters:
name- name of the counterdescription- description of purposeunit- the unit (bytes, sec, hour)observer- a callback to provide a metric values upon observation (metric interval)
-
getDoubleAsyncCounter
Retrieved a previously registeredDoubleAsyncCounter.- Parameters:
name- name of the counter- Returns:
- the registered meter.
-
getLongCounter
Retrieved a previously registeredLongCounter.- Parameters:
name- name of the counter- Returns:
- the registered meter.
-
registerLongUpDownCounter
Register aLongUpDownCounter. The returned object may be reused.- Parameters:
name- name of the counterdescription- description of purposeunit- the unit (bytes, sec, hour)- Returns:
- the registered meter.
-
getLongUpDownCounter
Retrieved a previously registeredLongUpDownCounter.- Parameters:
name- name of the counter- Returns:
- the registered meter.
-
registerLongGauge
default LongGauge registerLongGauge(String name, String description, String unit, Supplier<LongWithAttributes> observer) Register aLongGauge. The returned object may be reused.- Parameters:
name- name of the gaugedescription- description of purposeunit- the unit (bytes, sec, hour)observer- callback to use. This is called once during reporting period. Must not throw an exception and must be safe to call from different threads.- Returns:
- the registered meter.
-
registerLongsGauge
LongGauge registerLongsGauge(String name, String description, String unit, Supplier<Collection<LongWithAttributes>> observer) Register aLongGauge. The returned object may be reused.- Parameters:
name- name of the gaugedescription- description of purposeunit- the unit (bytes, sec, hour)observer- callback to use. This is called once during reporting period. Must not throw an exception and must be safe to call from different threads.- Returns:
- the registered meter.
-
getLongGauge
Retrieved a previously registeredLongGauge.- Parameters:
name- name of the gauge- Returns:
- the registered meter.
-
registerLongHistogram
Register aLongHistogram. The returned object may be reused.- Parameters:
name- name of the histogramdescription- description of purposeunit- the unit (bytes, sec, hour)- Returns:
- the registered meter.
-
getLongHistogram
Retrieved a previously registeredLongHistogram.- Parameters:
name- name of the histogram- Returns:
- the registered meter.
-