public class NodeResponseTimeMonitor extends AbstractMonitor implements EventSubscriber, StateSnapshotProvider
lastActivityTimestampNanos, monitorExecutor, state, stop, terminationTimeoutSec| Constructor and Description |
|---|
NodeResponseTimeMonitor(@NonNull FullServicesContainer servicesContainer,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props,
int intervalMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes all resources used by this monitor.
|
protected long |
getCurrentTime() |
@NonNull HostSpec |
getHostSpec() |
int |
getResponseTime() |
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() |
canDispose, getLastActivityTimestampNanos, getState, run, start, stoppublic NodeResponseTimeMonitor(@NonNull FullServicesContainer servicesContainer, @NonNull HostSpec hostSpec, @NonNull java.util.Properties props, int intervalMs)
public int getResponseTime()
public @NonNull HostSpec getHostSpec()
protected long getCurrentTime()
public 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.public void close()
MonitorMonitor.stop().close in interface Monitorclose in class AbstractMonitorprotected 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