- All Superinterfaces:
MetricRegistry
- All Known Implementing Classes:
AbstractRegistry
Helidon Metric registry.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.microprofile.metrics.MetricRegistry
MetricRegistry.Type -
Method Summary
Modifier and TypeMethodDescriptionbooleanempty()Whether this registry is empty, or contains any metrics.booleanWhether a metric is enabled.Returns anOptionalfor an entry containing a metric ID and the corresponding metric matching the specified metric name.Metric instance for a metric ID.Returns a list of metric ID/metric pairs which match the provided metric name.metricIdsByName(String name) Get all metric IDs for a specified name.metricsByName(String name) Get all metrics by a specified name.stream()Steam all metrics from this registry.type()Registry type.Methods inherited from interface org.eclipse.microprofile.metrics.MetricRegistry
concurrentGauge, concurrentGauge, concurrentGauge, concurrentGauge, concurrentGauge, counter, counter, counter, counter, counter, gauge, gauge, gauge, gauge, gauge, gauge, getConcurrentGauge, getConcurrentGauges, getConcurrentGauges, getCounter, getCounters, getCounters, getGauge, getGauges, getGauges, getHistogram, getHistograms, getHistograms, getMetadata, getMetadata, getMeter, getMeters, getMeters, getMetric, getMetricIDs, getMetrics, getMetrics, getMetrics, getNames, getSimpleTimer, getSimpleTimers, getSimpleTimers, getTimer, getTimers, getTimers, getType, histogram, histogram, histogram, histogram, histogram, meter, meter, meter, meter, meter, register, register, register, remove, remove, removeMatching, simpleTimer, simpleTimer, simpleTimer, simpleTimer, simpleTimer, timer, timer, timer, timer, timer
-
Method Details
-
enabled
Whether a metric is enabled. Metrics can be disabled by name (disables all IDs associated with that name).- Parameters:
metricName- name to look for- Returns:
- whether the metric is enabled
-
stream
Stream<MetricInstance> stream()Steam all metrics from this registry.- Returns:
- stream of metric instances and their IDs
-
find
Returns anOptionalfor an entry containing a metric ID and the corresponding metric matching the specified metric name.If multiple metrics match the name (because of tags), the returned metric is, preferentially, the one (if any) with no tags. If all metrics registered under the specified name have tags, then the method returns the metric which was registered earliest
- Parameters:
metricName- name of the metric of interest- Returns:
Optionalof a map entry containing the metric ID and the metric selected
-
list
Returns a list of metric ID/metric pairs which match the provided metric name.- Parameters:
metricName- name of the metric of interest- Returns:
- List of entries indicating metrics with the specified name; empty of no matches
-
empty
boolean empty()Whether this registry is empty, or contains any metrics.- Returns:
trueif this registry is empty
-
type
String type()Registry type.- Returns:
- type
-
metricIdsByName
Get all metric IDs for a specified name.- Parameters:
name- name to look for- Returns:
- metric IDs for the name (may have more than one, as tags may be used)
-
metricsByName
Get all metrics by a specified name.- Parameters:
name- name to look for- Returns:
- all metrics (and associated metadata) if exist
-
getMetric
Metric instance for a metric ID.- Specified by:
getMetricin interfaceMetricRegistry- Parameters:
metricID- lookup key, notnull- Returns:
- metric instance
-