Package org.opends.server.monitors
Class HealthStatusMonitorProvider
java.lang.Object
org.opends.server.api.MonitorProvider
org.opends.server.monitors.HealthStatusMonitorProvider
- All Implemented Interfaces:
MeterBinder
A
MonitorProvider for monitoring the server health status.-
Field Summary
Fields inherited from class org.opends.server.api.MonitorProvider
registry -
Constructor Summary
ConstructorsConstructorDescriptionHealthStatusMonitorProvider(HealthStatusProvider healthStatusProvider) Creates a newHealthStatusMonitorProviderfor monitoring the providedHealthStatusProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMonitorObjectClassNames(Attribute objectClassAttribute) Adds to the provided attribute the objectclass names that should be included in the monitor entry created from this monitor provider.voidbindTo(MeterRegistry parent) .protected DnReturns the monitor instance DN for this monitor provider.Methods inherited from class org.opends.server.api.MonitorProvider
configurationDnToMonitorDn, deregisterAll, getMonitorEntry, getMonitorInstanceDn, toString
-
Constructor Details
-
HealthStatusMonitorProvider
Creates a newHealthStatusMonitorProviderfor monitoring the providedHealthStatusProvider.- Parameters:
healthStatusProvider- TheHealthStatusProviderto be monitored.
-
-
Method Details
-
bindTo
Description copied from class:MonitorProvider.Implementation considerations
Implementations MUST set the
MonitorProvider.registryfield by creating a newMeterRegistryHolder, and specifying the appropriate prefix for the dimensional model and also the hierarchical model if they are different. This can be done using a parameter on the constructor, or theMeterRegistryHolder.hierarchicalNamePrefix(String)method. Tags common to all metrics for this monitor provider can also be set using theMeterRegistryHolder.tag(String, String)method.Attribute names are then registered by calling factory methods on the
MonitorProvider.registryfield.Sample dummy implementation
(Please remove the comments when using this code as a template)
public void bindTo(final MeterRegistry parent) { // create the MeterRegistryHolder wrapping OpenDJ's MeterRegistry registry = new MeterRegistryHolder("dimensional-name-prefix", parent) .tag("label", "dimension") .hierarchicalNamePrefix("hierarchical-name-prefix.dimension"); // register the metrics against the wrapper registry.numberGauge("gauge", numberSupplier); // use lambdas or method references here timer = registry.timer("requests-submitted"); // set a different name for the metric in cn=monitor, dimensional model and hierarchical model Gauge.doubleGauge(dimensionalName, supplier) .hierarchicalName(hierarchicalName) .tag(MeterRegistryHolder.TAG_ATTRIBUTE_NAME, "cn-monitor-name") // drop the "ds-mon-" prefix here .register(registry); // this gauge will only output to cn=monitor based monitoring endpoints registry.monitoringGauge("only-visible-in-cn-monitor", supplier); }- Specified by:
bindToin interfaceMeterBinder- Specified by:
bindToin classMonitorProvider
-
computeMonitorInstanceDn
Description copied from class:MonitorProviderReturns the monitor instance DN for this monitor provider.- Specified by:
computeMonitorInstanceDnin classMonitorProvider- Returns:
- the monitor instance DN.
-
addMonitorObjectClassNames
Description copied from class:MonitorProviderAdds to the provided attribute the objectclass names that should be included in the monitor entry created from this monitor provider. This method should be implemented by child classes to make it easier to search for monitor entries of a specific type.- Specified by:
addMonitorObjectClassNamesin classMonitorProvider- Parameters:
objectClassAttribute- the objectClass attribute where to add the object class names
-