public class ClusterAwareMetrics
extends java.lang.Object
Performance (duration in time) metrics: - Failover Detection Duration of time between a start of executing sql statement to the moment when driver identifies a communication error and starts a failover process (a process to re-connect to another cluster instance). - Writer Failover Procedure Duration of time running writer failover procedure. - Reader Failover Procedure Duration of time running reader failover procedure.
Performance (hit-miss) metrics: - Successful Failover Reconnects A total number of failover events vs a number of successful ones - Used Last Connected Reader Number of time driver utilises details about a last successfully connected reader host. Knowing the last successfully connected reader host helps driver to connect to this host in the first turn rather than trying to randomly connect to any reader hosts. This metric is applicable for read-only connections only. - Invalid Initial Connection As a side-effect of using last connected reader host from a cache, there's a chance that this host may turn out to be a writer, not a reader as expected. In such a case, driver has to drop connection to this host since it's not accurate and initiate a new one to another host. Such cases are measured by this metric. "Hit" event corresponds to dropping connection and connecting to another host. - Used Cached Topology Number of time driver utilises a cached cluster topology
| Constructor and Description |
|---|
ClusterAwareMetrics() |
| Modifier and Type | Method and Description |
|---|---|
void |
registerFailoverConnects(boolean isHit) |
void |
registerFailureDetectionTime(long timeMs) |
void |
registerInvalidInitialConnection(boolean isHit) |
void |
registerReaderFailoverProcedureTime(long timeMs) |
void |
registerUseCachedTopology(boolean isHit) |
void |
registerUseLastConnectedReader(boolean isHit) |
void |
registerWriterFailoverProcedureTime(long timeMs) |
void |
reportMetrics(Log log)
Report metrics.
|
public void registerFailureDetectionTime(long timeMs)
public void registerWriterFailoverProcedureTime(long timeMs)
public void registerReaderFailoverProcedureTime(long timeMs)
public void registerFailoverConnects(boolean isHit)
public void registerInvalidInitialConnection(boolean isHit)
public void registerUseLastConnectedReader(boolean isHit)
public void registerUseCachedTopology(boolean isHit)
public void reportMetrics(Log log)