public class ClusterAwareMetrics extends 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 records the duration of time running writer failover procedure. - Reader Failover Procedure records the duration of time running reader failover procedure. - Topology Query records the duration of time it takes to fetch the new topology
Performance (hit-miss) metrics: - Successful Failover Reconnects A total number of failover events vs a number of successful ones. "Hit" events record whenever a failover procedure successfully reconnects to an appropriate instance and "Miss" events record whenever a failover procedure fails to reconenct to an appropriate instance.
Constructor and Description |
---|
ClusterAwareMetrics()
Constructor for ClusterAwareMetrics.
|
Modifier and Type | Method and Description |
---|---|
void |
registerFailoverConnects(boolean isHit)
Registers whether or not a failover procedure successfully reconnected
|
void |
registerFailureDetectionTime(long timeMs)
Registers the time it takes to failover
|
void |
registerReaderFailoverProcedureTime(long timeMs)
Registers the time it takes to perform a reader failover once initiated
|
void |
registerTopologyQueryTime(long timeMs)
Registers the time it takes to fetch the topology from the database
|
void |
registerWriterFailoverProcedureTime(long timeMs)
Registers the time it takes to perform a writer failover once initiated
|
void |
reportMetrics(Logger log)
Create a report from the current available data and attach it to a Logger instance
|
public ClusterAwareMetrics()
public void registerFailureDetectionTime(long timeMs)
timeMs
- Time it took to detect that failover is neededpublic void registerWriterFailoverProcedureTime(long timeMs)
timeMs
- Time it took for writer to failoverpublic void registerReaderFailoverProcedureTime(long timeMs)
timeMs
- Time it took for reader to failoverpublic void registerTopologyQueryTime(long timeMs)
timeMs
- Time it to took to complete the topology querypublic void registerFailoverConnects(boolean isHit)
isHit
- True if failover was successfulpublic void reportMetrics(Logger log)
log
- the log used to displayCopyright © 1997-2021 PostgreSQL Global Development Group. All Rights Reserved.