Package io.smallrye.metrics
Class MetricRegistries
- java.lang.Object
-
- io.smallrye.metrics.MetricRegistries
-
@ApplicationScoped public class MetricRegistries extends Object
- Author:
- hrupp
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringGLOBAL_TAG_MALFORMED_EXCEPTIONprotected static StringGLOBAL_TAGS_VARIABLEstatic ThreadLocal<Boolean>MP_APP_METER_REG_ACCESSstatic ThreadLocal<Boolean>MP_BASE_METER_REG_ACCESSstatic ThreadLocal<Boolean>MP_VENDOR_METER_REG_ACCESSprotected static io.micrometer.core.instrument.Tag[]SERVER_LEVEL_MPCONFIG_GLOBAL_TAGSThis static Tag[] represents the server level global tags retrieved from MP Config for mp.metrics.tags.
-
Constructor Summary
Constructors Constructor Description MetricRegistries()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()static voiddrop(org.eclipse.microprofile.metrics.MetricRegistry.Type type)Drops a particular registry.static voiddropAll()Drops all registries.org.eclipse.microprofile.metrics.MetricRegistrygetApplicationRegistry()org.eclipse.microprofile.metrics.MetricRegistrygetBaseRegistry()static org.eclipse.microprofile.metrics.MetricRegistrygetOrCreate(org.eclipse.microprofile.metrics.MetricRegistry.Type type)static org.eclipse.microprofile.metrics.MetricRegistrygetOrCreate(org.eclipse.microprofile.metrics.MetricRegistry.Type type, ApplicationNameResolver appNameResolver)org.eclipse.microprofile.metrics.MetricRegistrygetVendorRegistry()
-
-
-
Field Detail
-
GLOBAL_TAG_MALFORMED_EXCEPTION
protected static final String GLOBAL_TAG_MALFORMED_EXCEPTION
- See Also:
- Constant Field Values
-
GLOBAL_TAGS_VARIABLE
protected static final String GLOBAL_TAGS_VARIABLE
- See Also:
- Constant Field Values
-
SERVER_LEVEL_MPCONFIG_GLOBAL_TAGS
protected static io.micrometer.core.instrument.Tag[] SERVER_LEVEL_MPCONFIG_GLOBAL_TAGS
This static Tag[] represents the server level global tags retrieved from MP Config for mp.metrics.tags. This value will be 'null' when not initialized. If during initialization and no global tag has been resolved this will be to an array of size 0. Using an array of size 0 is to represent that an attempt on start up was made to resolve the value, but none was found. This prevents later instantiations of MetricRegistry to avoid attempting to resolve the MP Config value for the slight performance boon. This server level value will not change at all throughout the life time of the server as it is defined by env vars or sys props.
-
MP_APP_METER_REG_ACCESS
public static final ThreadLocal<Boolean> MP_APP_METER_REG_ACCESS
-
MP_BASE_METER_REG_ACCESS
public static final ThreadLocal<Boolean> MP_BASE_METER_REG_ACCESS
-
MP_VENDOR_METER_REG_ACCESS
public static final ThreadLocal<Boolean> MP_VENDOR_METER_REG_ACCESS
-
-
Method Detail
-
getApplicationRegistry
@Produces @Default @RegistryType(type=APPLICATION) @ApplicationScoped public org.eclipse.microprofile.metrics.MetricRegistry getApplicationRegistry()
-
getBaseRegistry
@Produces @RegistryType(type=BASE) @ApplicationScoped public org.eclipse.microprofile.metrics.MetricRegistry getBaseRegistry()
-
getVendorRegistry
@Produces @RegistryType(type=VENDOR) @ApplicationScoped public org.eclipse.microprofile.metrics.MetricRegistry getVendorRegistry()
-
getOrCreate
public static org.eclipse.microprofile.metrics.MetricRegistry getOrCreate(org.eclipse.microprofile.metrics.MetricRegistry.Type type)
-
getOrCreate
public static org.eclipse.microprofile.metrics.MetricRegistry getOrCreate(org.eclipse.microprofile.metrics.MetricRegistry.Type type, ApplicationNameResolver appNameResolver)
-
cleanUp
@PreDestroy public void cleanUp()
-
drop
public static void drop(org.eclipse.microprofile.metrics.MetricRegistry.Type type)
Drops a particular registry. If a reference to the same registry type is requested later, a new empty registry will be created for that purpose.- Parameters:
type- Type of registry that should be dropped.
-
dropAll
public static void dropAll()
Drops all registries. If a reference to a registry is requested later, a new empty registry will be created for that purpose.
-
-