Module io.helidon.metrics.api
Package io.helidon.metrics.api
Class AbstractRegistry<M extends HelidonMetric>
- java.lang.Object
- 
- org.eclipse.microprofile.metrics.MetricRegistry
- 
- io.helidon.metrics.api.AbstractRegistry<M>
 
 
- 
- Type Parameters:
- M- general type of metric implementation supported by an implementation of this class (e.g.,- HelidonMetric
 - Direct Known Subclasses:
- Registry
 
 public abstract class AbstractRegistry<M extends HelidonMetric> extends MetricRegistry Common behavior for any category (e.g., full-featured or no-op) metrics registry.This class provides the bookkeeping for tracking the metrics which are created and registered along with their IDs and metadata. Concrete subclasses create new instances of the various types of metrics (counter, timer, etc.). 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.eclipse.microprofile.metrics.MetricRegistryMetricRegistry.Type
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractRegistry(MetricRegistry.Type type, Class<M> metricClass, RegistrySettings registrySettings)Create a registry of a certain type.
 - 
Method Summary- 
Methods inherited from class org.eclipse.microprofile.metrics.MetricRegistryname, name
 
- 
 
- 
- 
- 
Constructor Detail- 
AbstractRegistryprotected AbstractRegistry(MetricRegistry.Type type, Class<M> metricClass, RegistrySettings registrySettings) Create a registry of a certain type.- Parameters:
- type- Registry type.
- metricClass- class of the specific metric type this registry manages
- registrySettings- settings for configuring the registry
 
 
- 
 - 
Method Detail- 
isMarkedAsDeletedpublic static boolean isMarkedAsDeleted(Metric metric) Indicates whether the specific metrics has been marked as deleted.- Parameters:
- metric- the metric to check
- Returns:
- true if it's a Helidon metric and has been marked as deleted; false otherwise
 
 - 
isMetricEnabledprotected abstract boolean isMetricEnabled(String metricName) 
 - 
registerpublic <T extends Metric> T register(String name, T metric) throws IllegalArgumentException - Specified by:
- registerin class- MetricRegistry
- Throws:
- IllegalArgumentException
 
 - 
registerpublic <T extends Metric> T register(Metadata metadata, T metric) throws IllegalArgumentException - Specified by:
- registerin class- MetricRegistry
- Throws:
- IllegalArgumentException
 
 - 
registerpublic <T extends Metric> T register(Metadata metadata, T metric, Tag... tags) throws IllegalArgumentException - Specified by:
- registerin class- MetricRegistry
- Throws:
- IllegalArgumentException
 
 - 
counterpublic Counter counter(String name) - Specified by:
- counterin class- MetricRegistry
 
 - 
counterpublic Counter counter(Metadata metadata) - Specified by:
- counterin class- MetricRegistry
 
 - 
counterpublic Counter counter(String name, Tag... tags) - Specified by:
- counterin class- MetricRegistry
 
 - 
counterpublic Counter counter(Metadata metadata, Tag... tags) - Specified by:
- counterin class- MetricRegistry
 
 - 
histogrampublic Histogram histogram(String name) - Specified by:
- histogramin class- MetricRegistry
 
 - 
histogrampublic Histogram histogram(Metadata metadata) - Specified by:
- histogramin class- MetricRegistry
 
 - 
histogrampublic Histogram histogram(String name, Tag... tags) - Specified by:
- histogramin class- MetricRegistry
 
 - 
histogrampublic Histogram histogram(Metadata metadata, Tag... tags) - Specified by:
- histogramin class- MetricRegistry
 
 - 
meterpublic Meter meter(String name) - Specified by:
- meterin class- MetricRegistry
 
 - 
meterpublic Meter meter(Metadata metadata) - Specified by:
- meterin class- MetricRegistry
 
 - 
meterpublic Meter meter(String name, Tag... tags) - Specified by:
- meterin class- MetricRegistry
 
 - 
meterpublic Meter meter(Metadata metadata, Tag... tags) - Specified by:
- meterin class- MetricRegistry
 
 - 
timerpublic Timer timer(String name) - Specified by:
- timerin class- MetricRegistry
 
 - 
timerpublic Timer timer(Metadata metadata) - Specified by:
- timerin class- MetricRegistry
 
 - 
timerpublic Timer timer(String name, Tag... tags) - Specified by:
- timerin class- MetricRegistry
 
 - 
timerpublic Timer timer(Metadata metadata, Tag... tags) - Specified by:
- timerin class- MetricRegistry
 
 - 
concurrentGaugepublic ConcurrentGauge concurrentGauge(String name) - Specified by:
- concurrentGaugein class- MetricRegistry
 
 - 
concurrentGaugepublic ConcurrentGauge concurrentGauge(Metadata metadata) - Specified by:
- concurrentGaugein class- MetricRegistry
 
 - 
concurrentGaugepublic ConcurrentGauge concurrentGauge(String name, Tag... tags) - Specified by:
- concurrentGaugein class- MetricRegistry
 
 - 
concurrentGaugepublic ConcurrentGauge concurrentGauge(Metadata metadata, Tag... tags) - Specified by:
- concurrentGaugein class- MetricRegistry
 
 - 
simpleTimerpublic SimpleTimer simpleTimer(String name) - Specified by:
- simpleTimerin class- MetricRegistry
 
 - 
simpleTimerpublic SimpleTimer simpleTimer(Metadata metadata) - Specified by:
- simpleTimerin class- MetricRegistry
 
 - 
simpleTimerpublic SimpleTimer simpleTimer(String name, Tag... tags) - Specified by:
- simpleTimerin class- MetricRegistry
 
 - 
simpleTimerpublic SimpleTimer simpleTimer(Metadata metadata, Tag... tags) - Specified by:
- simpleTimerin class- MetricRegistry
 
 - 
removepublic boolean remove(String name) Removes a metric by name. Synchronized for atomic update of more than one internal map.- Specified by:
- removein class- MetricRegistry
- Parameters:
- name- Name of the metric.
- Returns:
- Outcome of removal.
 
 - 
removepublic boolean remove(MetricID metricID) Removes a metric by ID. Synchronized for atomic update of more than one internal map.- Specified by:
- removein class- MetricRegistry
- Parameters:
- metricID- ID of metric.
- Returns:
- Outcome of removal.
 
 - 
removeMatchingpublic void removeMatching(MetricFilter filter) - Specified by:
- removeMatchingin class- MetricRegistry
 
 - 
getNamespublic SortedSet<String> getNames() - Specified by:
- getNamesin class- MetricRegistry
 
 - 
getMetricIDspublic SortedSet<MetricID> getMetricIDs() - Specified by:
- getMetricIDsin class- MetricRegistry
 
 - 
getGaugespublic SortedMap<MetricID,Gauge> getGauges() - Specified by:
- getGaugesin class- MetricRegistry
 
 - 
getGaugespublic SortedMap<MetricID,Gauge> getGauges(MetricFilter filter) - Specified by:
- getGaugesin class- MetricRegistry
 
 - 
getCounterspublic SortedMap<MetricID,Counter> getCounters() - Specified by:
- getCountersin class- MetricRegistry
 
 - 
getCounterspublic SortedMap<MetricID,Counter> getCounters(MetricFilter filter) - Specified by:
- getCountersin class- MetricRegistry
 
 - 
getHistogramspublic SortedMap<MetricID,Histogram> getHistograms() - Specified by:
- getHistogramsin class- MetricRegistry
 
 - 
getHistogramspublic SortedMap<MetricID,Histogram> getHistograms(MetricFilter filter) - Specified by:
- getHistogramsin class- MetricRegistry
 
 - 
getMeterspublic SortedMap<MetricID,Meter> getMeters() - Specified by:
- getMetersin class- MetricRegistry
 
 - 
getMeterspublic SortedMap<MetricID,Meter> getMeters(MetricFilter filter) - Specified by:
- getMetersin class- MetricRegistry
 
 - 
getTimerspublic SortedMap<MetricID,Timer> getTimers() - Specified by:
- getTimersin class- MetricRegistry
 
 - 
getTimerspublic SortedMap<MetricID,Timer> getTimers(MetricFilter filter) - Specified by:
- getTimersin class- MetricRegistry
 
 - 
getConcurrentGaugespublic SortedMap<MetricID,ConcurrentGauge> getConcurrentGauges() - Specified by:
- getConcurrentGaugesin class- MetricRegistry
 
 - 
getConcurrentGaugespublic SortedMap<MetricID,ConcurrentGauge> getConcurrentGauges(MetricFilter filter) - Specified by:
- getConcurrentGaugesin class- MetricRegistry
 
 - 
getSimpleTimerspublic SortedMap<MetricID,SimpleTimer> getSimpleTimers() - Specified by:
- getSimpleTimersin class- MetricRegistry
 
 - 
getSimpleTimerspublic SortedMap<MetricID,SimpleTimer> getSimpleTimers(MetricFilter filter) - Specified by:
- getSimpleTimersin class- MetricRegistry
 
 - 
getMetadatapublic Map<String,Metadata> getMetadata() - Specified by:
- getMetadatain class- MetricRegistry
 
 - 
getMetricspublic Map<MetricID,Metric> getMetrics() - Specified by:
- getMetricsin class- MetricRegistry
 
 - 
getMetricpublic Optional<Metric> getMetric(String metricName) Access a metric by name. Used by FT library.- Parameters:
- metricName- Metric name.
- Returns:
- Optional metric.
 
 - 
typepublic String type() Returns type of this registry.- Returns:
- The type.
 
 - 
emptypublic boolean empty() Determines if registry is empty.- Returns:
- Outcome of test.
 
 - 
getOptionalMetricWithIDsEntrypublic Optional<Map.Entry<? extends Metric,List<MetricID>>> getOptionalMetricWithIDsEntry(String metricName) Get internal map entry given a metric name. Synchronized for atomic access of more than one internal map.- Parameters:
- metricName- The metric name.
- Returns:
- Optional map entry..
 
 - 
getMetricpublic M getMetric(MetricID metricID) Lookup metric by its metric ID.- Parameters:
- metricID- the metric ID
- Returns:
- the metric or nullif not found
 
 - 
isStrictExemplarsprotected boolean isStrictExemplars() - Returns:
- whether exemplars are to be implemented strictly
 
 - 
streamprotected Stream<Map.Entry<MetricID,M>> stream() Returns a stream ofMap.Entryfor this registry for enabled metrics.- Returns:
- Stream of Map.Entry
 
 - 
toImplprotected abstract <T extends Metric> M toImpl(Metadata metadata, T metric) Creates a new instance of an implementation wrapper around the indicated metric.- Type Parameters:
- T- specific type of- Metricprovided and wrapped
- Parameters:
- metadata-- Metadatafor the metric
- metric- the existing metric to be wrapped by the impl
- Returns:
- new wrapper implementation around the specified metric instance
 
 - 
prepareMetricFactoriesprotected abstract Map<MetricType,BiFunction<String,Metadata,M>> prepareMetricFactories() 
 - 
registrySettingsprotected RegistrySettings registrySettings() 
 - 
getOptionalMetricEntryprotected Optional<Map.Entry<MetricID,M>> getOptionalMetricEntry(String metricName) 
 - 
registryTypeprotected MetricRegistry.Type registryType() 
 - 
deriveTypeprotected static MetricType deriveType(MetricType candidateType, Metric metric) 
 - 
metricFactoriesprotected Map<MetricType,BiFunction<String,Metadata,M>> metricFactories() 
 - 
prepareMetricToTypeMapprotected abstract Map<Class<? extends M>,MetricType> prepareMetricToTypeMap() 
 
- 
 
-