- java.lang.Object
-
- io.helidon.metrics.RegistryFactory
-
public final class RegistryFactory extends Object
Access point to all registries. There are two options to use the factory:- A singleton instance, obtained through
getInstance()orgetInstance(io.helidon.config.Config). This instance is lazily initialized - the latest call that provides a config instance before aMetricRegistry.Type.BASEregistry is obtained would be used to configure the base registry (as that is the only configurable registry in current implementation) - A custom instance, obtained through
create(Config)orcreate(). This would create a new instance of a registry factory (in case multiple instances are desired), independent on the singleton instance and on other instances provided by these methods.
- A singleton instance, obtained through
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RegistryFactorycreate()Create a new factory with default configuration, with pre-filledMetricRegistry.Type.VENDORandMetricRegistry.Type.BASEmetrics.static RegistryFactorycreate(Config config)Create a new factory with provided configuration, with pre filledMetricRegistry.Type.VENDORandMetricRegistry.Type.BASEmetrics.static RegistryFactorygetInstance()Get a singleton instance of the registry factory.static RegistryFactorygetInstance(Config config)Get a singleton instance of the registry factory for and update it with provided configuration.org.eclipse.microprofile.metrics.MetricRegistrygetRegistry(org.eclipse.microprofile.metrics.MetricRegistry.Type type)Get a registry based on its type.
-
-
-
Method Detail
-
create
public static RegistryFactory create()
Create a new factory with default configuration, with pre-filledMetricRegistry.Type.VENDORandMetricRegistry.Type.BASEmetrics.- Returns:
- a new registry factory
-
create
public static RegistryFactory create(Config config)
Create a new factory with provided configuration, with pre filledMetricRegistry.Type.VENDORandMetricRegistry.Type.BASEmetrics.- Parameters:
config- configuration to use- Returns:
- a new registry factory
-
getInstance
public static RegistryFactory getInstance()
Get a singleton instance of the registry factory.- Returns:
- registry factory singleton
-
getInstance
public static RegistryFactory getInstance(Config config)
Get a singleton instance of the registry factory for and update it with provided configuration. Note that the config is used only if nobody access the base registry.- Parameters:
config- configuration of the registry factory used to update behavior of the instance returned- Returns:
- registry factory singleton
-
getRegistry
public org.eclipse.microprofile.metrics.MetricRegistry getRegistry(org.eclipse.microprofile.metrics.MetricRegistry.Type type)
Get a registry based on its type. ForMetricRegistry.Type.APPLICATIONandMetricRegistry.Type.VENDORreturns a modifiable registry, forMetricRegistry.Type.BASEreturns a final registry (cannot register new metrics).- Parameters:
type- type of registry- Returns:
- MetricRegistry for the type defined.
-
-