Skip to content

Commit b0f28e1

Browse files
committed
[+] add GetMetricInterval()
1 parent f93345c commit b0f28e1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

internal/sources/conn.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ func (md *SourceConn) GetDatabaseName() string {
102102
return md.ConnConfig.ConnConfig.Database
103103
}
104104

105+
// GetMetricInterval returns the metric interval for the connection
106+
func (md *SourceConn) GetMetricInterval(name string) float64 {
107+
if md.IsInRecovery && len(md.MetricsStandby) > 0 {
108+
return md.MetricsStandby[name]
109+
}
110+
return md.Metrics[name]
111+
}
112+
105113
// SetDatabaseName sets the database name in the connection config for resolved databases
106114
func (md *SourceConn) SetDatabaseName(name string) {
107115
if err := md.ParseConfig(); err != nil {

0 commit comments

Comments
 (0)