@Service(name="microprofile-metrics-service") @RunLevel(value=10) public class MetricsService extends Object implements EventListener
EventListener.Event<T>| Constructor and Description |
|---|
MetricsService() |
| Modifier and Type | Method and Description |
|---|---|
void |
event(EventListener.Event event)
Process a Glassfish/Payara event
|
Set<String> |
getAllRegistryNames() |
String |
getApplicationName()
Gets the application name from the invocation manager.
|
Set<String> |
getApplicationRegistryNames() |
Map<String,org.eclipse.microprofile.metrics.Metadata> |
getMetadataAsMap(String registryName) |
Map<String,org.eclipse.microprofile.metrics.Metadata> |
getMetadataAsMap(String registryName,
String metricName) |
Map<String,org.eclipse.microprofile.metrics.Metric> |
getMetricsAsMap(String registryName) |
Map<String,org.eclipse.microprofile.metrics.Metric> |
getMetricsAsMap(String registryName,
String metricName) |
org.eclipse.microprofile.metrics.MetricRegistry |
getOrAddRegistry(String registryName)
Returns the Metrics registry based on respective registry name,
if not available then add the new MetricRegistry instance
|
org.eclipse.microprofile.metrics.MetricRegistry |
getRegistry(String registryName)
Returns the Metrics registry based on respective registry name
|
void |
init() |
boolean |
isInsucreMetricEnabled() |
Boolean |
isMetricEnabled() |
Boolean |
isMetricEnabled(String applicationName) |
Boolean |
isMetricEnabled(String applicationName,
org.eclipse.microprofile.config.Config config)
Checks whether metric is enabled for a given application
|
org.eclipse.microprofile.metrics.MetricRegistry |
removeRegistry(String registryName)
Remove the Metrics registry
|
@PostConstruct public void init()
public void event(EventListener.Event event)
EventListenerevent in interface EventListenerpublic Boolean isMetricEnabled()
public Boolean isMetricEnabled(String applicationName, org.eclipse.microprofile.config.Config config)
applicationName - The application to check if metric is enabled for.config - The application config to check for any override valuespublic boolean isInsucreMetricEnabled()
public Map<String,org.eclipse.microprofile.metrics.Metric> getMetricsAsMap(String registryName) throws NoSuchRegistryException
NoSuchRegistryExceptionpublic Map<String,org.eclipse.microprofile.metrics.Metadata> getMetadataAsMap(String registryName) throws NoSuchRegistryException
NoSuchRegistryExceptionpublic Map<String,org.eclipse.microprofile.metrics.Metric> getMetricsAsMap(String registryName, String metricName) throws NoSuchRegistryException, NoSuchMetricException
public Map<String,org.eclipse.microprofile.metrics.Metadata> getMetadataAsMap(String registryName, String metricName) throws NoSuchRegistryException, NoSuchMetricException
public org.eclipse.microprofile.metrics.MetricRegistry getRegistry(String registryName) throws NoSuchRegistryException
registryName - NoSuchRegistryExceptionpublic org.eclipse.microprofile.metrics.MetricRegistry getOrAddRegistry(String registryName)
registryName - public org.eclipse.microprofile.metrics.MetricRegistry removeRegistry(String registryName)
registryName - public String getApplicationName()
Copyright © 2018. All rights reserved.