public class HostMonitorV1Impl extends AbstractMonitor implements HostMonitor, StateSnapshotProvider
| Modifier and Type | Field and Description |
|---|---|
protected HostSpec |
hostSpec |
protected AtomicConnection |
monitoringConn |
protected java.util.Properties |
monitoringProperties |
protected java.util.Properties |
properties |
protected FullServicesContainer |
servicesContainer |
protected TelemetryFactory |
telemetryFactory |
lastActivityTimestampNanos, monitorExecutor, state, stop, terminationTimeoutSec| Constructor and Description |
|---|
HostMonitorV1Impl(@NonNull FullServicesContainer servicesContainer,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties properties)
Store the monitoring configuration for a connection.
|
| Modifier and Type | Method and Description |
|---|---|
protected long |
getCurrentTimeNano() |
java.util.List<Pair<java.lang.String,java.lang.Object>> |
getSnapshotState() |
void |
monitor()
Executes the monitoring loop for this monitor.
|
void |
processEvent(Event event)
Processes an event.
|
protected void |
reset() |
void |
start()
Submits this monitor in a separate thread to begin its monitoring tasks.
|
void |
startMonitoring(ConnectionContext context) |
canDispose, close, getLastActivityTimestampNanos, getState, run, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanDispose, close, getLastActivityTimestampNanos, getState, stopprotected final FullServicesContainer servicesContainer
protected final TelemetryFactory telemetryFactory
protected final java.util.Properties properties
protected final java.util.Properties monitoringProperties
protected final HostSpec hostSpec
protected AtomicConnection monitoringConn
public HostMonitorV1Impl(@NonNull FullServicesContainer servicesContainer, @NonNull HostSpec hostSpec, @NonNull java.util.Properties properties)
servicesContainer - The telemetry factory to use to create telemetry data.hostSpec - The HostSpec of the server this HostMonitorV2Impl
instance is monitoring.properties - The Properties containing additional monitoring
configuration.public void start()
Monitorstart in interface Monitorstart in class AbstractMonitorpublic void startMonitoring(ConnectionContext context)
startMonitoring in interface HostMonitorpublic void monitor()
MonitorMonitor.start(). Additionally, the monitoring loop should regularly update the last
activity timestamp so that the MonitorService can detect whether the monitor is stuck or not.protected long getCurrentTimeNano()
protected void reset()
public void processEvent(Event event)
EventSubscriberEventPublisher.subscribe(software.amazon.jdbc.util.events.EventSubscriber, java.util.Set<java.lang.Class<? extends software.amazon.jdbc.util.events.Event>>).processEvent in interface EventSubscriberevent - the event to process.public java.util.List<Pair<java.lang.String,java.lang.Object>> getSnapshotState()
getSnapshotState in interface StateSnapshotProvider