Class LocalBackendMonitor<B extends LocalBackend<?>>
- Type Parameters:
- B- The type of local backend associated with this monitor.
- All Implemented Interfaces:
- MeterBinder
- Direct Known Subclasses:
- PluggableBackendMonitor
 Subclasses may override addAdditionalMetrics() in order to add implementation specific
 monitoring metrics.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final recordStores metric data local backends.
- 
Field SummaryFields inherited from class org.opends.server.api.MonitorProviderregistry
- 
Constructor SummaryConstructorsConstructorDescriptionLocalBackendMonitor(B backend, ServerContext serverContext) Creates a new instance of this backend monitor provider that will work with the provided backend.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidAdds additional metrics specific to the local backend implementation in this monitor provider'sMeterRegistry.protected voidaddMonitorObjectClassNames(Attribute ocAttr) Adds to the provided attribute the objectclass names that should be included in the monitor entry created from this monitor provider.final voidbindTo(MeterRegistry parent) .protected final DnReturns the monitor instance DN for this monitor provider.final voidDeregisters monitoring entries associated to the base DNs handled by the monitored backend in the directory server.protected StringReturns the local backend implementation type.getBaseDnMonitorData(Dn baseDn) Returns a new BaseDnMonitorData instance that will use the provided base DN.protected final BReturns the local backend associated with this backend.final voidRegisters monitoring entries associated to the base DNs handled by the monitored backend in the directory server.final voidUpdates the list of monitoring entries associated to the base DNs handled by the monitored backend in the directory server.Methods inherited from class org.opends.server.api.MonitorProviderconfigurationDnToMonitorDn, deregisterAll, getMonitorEntry, getMonitorInstanceDn, toString
- 
Constructor Details- 
LocalBackendMonitorCreates a new instance of this backend monitor provider that will work with the provided backend.- Parameters:
- backend- The backend with which this monitor is associated.
- serverContext- The server context
 
 
- 
- 
Method Details- 
computeMonitorInstanceDnDescription copied from class:MonitorProviderReturns the monitor instance DN for this monitor provider.- Specified by:
- computeMonitorInstanceDnin class- MonitorProvider
- Returns:
- the monitor instance DN.
 
- 
addMonitorObjectClassNamesDescription 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 class- MonitorProvider
- Parameters:
- ocAttr- the objectClass attribute where to add the object class names
 
- 
bindToDescription copied from class:MonitorProvider.Implementation considerationsImplementations 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 interface- MeterBinder
- Specified by:
- bindToin class- MonitorProvider
 
- 
getBaseDnMonitorDataReturns a new BaseDnMonitorData instance that will use the provided base DN.- Parameters:
- baseDn- the base DN
- Returns:
- a new BaseDnMonitorData instance
 
- 
getBackendTypeReturns the local backend implementation type.- Returns:
- A string used in this monitor provider's MeterRegistryrepresenting the local backend type.
 
- 
addAdditionalMetricsprotected void addAdditionalMetrics()Adds additional metrics specific to the local backend implementation in this monitor provider'sMeterRegistry.The default implementation is to do nothing. 
- 
getLocalBackendReturns the local backend associated with this backend.- Returns:
- The local backend associated with this backend.
 
- 
registerBaseDnMonitorspublic final void registerBaseDnMonitors()Registers monitoring entries associated to the base DNs handled by the monitored backend in the directory server.
- 
deregisterBaseDnMonitorspublic final void deregisterBaseDnMonitors()Deregisters monitoring entries associated to the base DNs handled by the monitored backend in the directory server.
- 
updateBaseDnMonitorspublic final void updateBaseDnMonitors()Updates the list of monitoring entries associated to the base DNs handled by the monitored backend in the directory server.
 
-