Skip to content

Commit

Permalink
use lagSelfDefaultThreshold
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Jul 29, 2024
1 parent 8dc4095 commit a23b15f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go/vt/vttablet/tabletserver/throttle/base/self_metric_lag.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import (
)

var (
lagSelfMetricQueryBase = "select unix_timestamp(now(6))-max(ts/1000000000) as replication_lag from %s.heartbeat"
lagSelfMetricQueryBase = "select unix_timestamp(now(6))-max(ts/1000000000) as replication_lag from %s.heartbeat"
lagSelfDefaultThreshold = 5 * time.Second
)

var _ SelfMetric = registerSelfMetric(&LagSelfMetric{})
Expand Down Expand Up @@ -57,7 +58,7 @@ func (m *LagSelfMetric) DefaultScope() Scope {
}

func (m *LagSelfMetric) DefaultThreshold() float64 {
return 5 * time.Second.Seconds()
return lagSelfDefaultThreshold.Seconds()
}

func (m *LagSelfMetric) RequiresConn() bool {
Expand Down

0 comments on commit a23b15f

Please sign in to comment.