From a23b15fc7ad2fa329534c081125d3c109d70fdee Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:06:53 +0300 Subject: [PATCH] use lagSelfDefaultThreshold Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletserver/throttle/base/self_metric_lag.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/go/vt/vttablet/tabletserver/throttle/base/self_metric_lag.go b/go/vt/vttablet/tabletserver/throttle/base/self_metric_lag.go index fb76077810e..dc25ee5622a 100644 --- a/go/vt/vttablet/tabletserver/throttle/base/self_metric_lag.go +++ b/go/vt/vttablet/tabletserver/throttle/base/self_metric_lag.go @@ -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{}) @@ -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 {