@Service(name="microprofile-metrics-service") @RunLevel(value=10) public class MetricsServiceImpl extends Object implements MetricsService, ConfigListener, fish.payara.monitoring.collect.MonitoringDataSource
MetricsService.MetricsContext| Constructor and Description |
|---|
MetricsServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
UnprocessedChangeEvents |
changed(PropertyChangeEvent[] events)
Notification that @Configured objects that were injected have changed
|
void |
collect(fish.payara.monitoring.collect.MonitoringDataCollector rootCollector) |
void |
deregisterApplication(String applicationName)
Removes an application from the enabled map
|
String |
getApplicationName()
Gets the application name from the invocation manager.
|
MetricsService.MetricsContext |
getContext(boolean createIfNotExists)
Access current application metric context.
|
MetricsService.MetricsContext |
getContext(String name)
Access the context by name.
|
Set<String> |
getContextNames() |
void |
init() |
boolean |
isEnabled()
When metrics are disabled no
MetricsService.MetricsContext exists, both MetricsService.getContext(boolean) and
MetricsService.getContext(String) will return null. |
Boolean |
isMetricsSecure() |
boolean |
isSecurityEnabled() |
void |
refresh()
Registers unresolved MBeans if they have been started after the metrics
service.
|
void |
registerApplication(String applicationName)
Adds an application to the enabled map
|
void |
resetMetricsEnabledProperty() |
void |
resetMetricsSecureProperty() |
@PostConstruct public void init()
public Set<String> getContextNames()
getContextNames in interface MetricsServiceMetricsService.MetricsContext that currently exist. When applications are undeployed their
MetricsService.MetricsContext equally are removed which means a name from the set of names returned may indeed
no longer exists when using MetricsService.getContext(boolean).public MetricsService.MetricsContext getContext(boolean createIfNotExists)
MetricsServicegetContext in interface MetricsServicecreateIfNotExists - true to create the requested context in case it did not exist, false to instead return
null in that caseMetricsService.isEnabled()public MetricsService.MetricsContext getContext(String name)
MetricsServiceMetricsService.MetricsContext.SERVER_CONTEXT_NAME if needed but no
other context that does not exist yet or no more.getContext in interface MetricsServicename - the name of the MetricsService.MetricsContext to provide, this assumes it does existMetricsService.isEnabled() no context exists. Otherwise when asking for the
MetricsService.MetricsContext.SERVER_CONTEXT_NAME the context is created should it not exist yet.public void collect(fish.payara.monitoring.collect.MonitoringDataCollector rootCollector)
collect in interface fish.payara.monitoring.collect.MonitoringDataSourcepublic void refresh()
refresh in interface MetricsServicepublic boolean isEnabled()
MetricsServiceMetricsService.MetricsContext exists, both MetricsService.getContext(boolean) and
MetricsService.getContext(String) will return null.isEnabled in interface MetricsServicepublic void resetMetricsEnabledProperty()
public Boolean isMetricsSecure()
public void resetMetricsSecureProperty()
public boolean isSecurityEnabled()
public void registerApplication(String applicationName)
applicationName - The name of the application to createpublic void deregisterApplication(String applicationName)
applicationName - The name of the application to removepublic String getApplicationName()
public UnprocessedChangeEvents changed(PropertyChangeEvent[] events)
ConfigListenerchanged in interface ConfigListenerevents - list of changesCopyright © 2021. All rights reserved.