Package fish.payara.microprofile.metrics
Interface MetricsService.MetricsContext
-
- Enclosing interface:
- MetricsService
public static interface MetricsService.MetricsContext
Each deployed application has its ownMetricsService.MetricsContext
. In addition there is the server context which has no name as indicated byisServerContext()
.- Author:
- Jan Bernitt
-
-
Field Summary
Fields Modifier and Type Field Description static String
SERVER_CONTEXT_NAME
The global or server context name cannot have any name but the empty string as all other names potentially are application names used by deployed applications.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default org.eclipse.microprofile.metrics.MetricRegistry
getApplicationRegistry()
default org.eclipse.microprofile.metrics.MetricRegistry
getBaseRegistry()
String
getName()
org.eclipse.microprofile.metrics.MetricRegistry
getRegistry(org.eclipse.microprofile.metrics.MetricRegistry.Type type)
Access aMetricRegistry
of this context.default org.eclipse.microprofile.metrics.MetricRegistry
getVendorRegistry()
default boolean
isServerContext()
-
-
-
Field Detail
-
SERVER_CONTEXT_NAME
static final String SERVER_CONTEXT_NAME
The global or server context name cannot have any name but the empty string as all other names potentially are application names used by deployed applications.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
String getName()
- Returns:
- the name of this context which is either the name of the application this context is linked to or the empty string in case of the server context
-
isServerContext
default boolean isServerContext()
-
getRegistry
org.eclipse.microprofile.metrics.MetricRegistry getRegistry(org.eclipse.microprofile.metrics.MetricRegistry.Type type) throws NoSuchRegistryException
Access aMetricRegistry
of this context. Each context has one instance of each type except the server context does not have an application type registry.- Parameters:
type
- the type ofMetricRegistry
to access- Returns:
- the
MetricRegistry
instance for the type in this context - Throws:
NoSuchRegistryException
- In case asking for aMetricRegistry.Type.APPLICATION
registry in the server (global) context.
-
getBaseRegistry
default org.eclipse.microprofile.metrics.MetricRegistry getBaseRegistry()
-
getVendorRegistry
default org.eclipse.microprofile.metrics.MetricRegistry getVendorRegistry()
-
getApplicationRegistry
default org.eclipse.microprofile.metrics.MetricRegistry getApplicationRegistry() throws NoSuchRegistryException
- Throws:
NoSuchRegistryException
-
-