From baa11334a08a122a09d17eac6f0c12ad4cc4030f Mon Sep 17 00:00:00 2001 From: Ezri Zhu Date: Thu, 17 Oct 2024 14:42:28 -0400 Subject: [PATCH] reset gauge --- lg.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lg.go b/lg.go index 4a77bb6..005544e 100644 --- a/lg.go +++ b/lg.go @@ -75,6 +75,10 @@ func (p *Prefix) checkLGState() { availableStr = "n" } + upstreamsGauge.Reset() + upstreams2Gauge.Reset() + bgpCommunitiesGauge.Reset() + origin := strconv.Itoa(p.origin) for _, rrc := range ripeStatLookingGlassResp.Data.Rrcs { @@ -149,7 +153,6 @@ func (p *Prefix) checkLGState() { communities = append(communities, peer.Community) } - upstreamsGauge.Reset() upstreamsGauge.WithLabelValues( p.prefix, p.pop, @@ -158,7 +161,6 @@ func (p *Prefix) checkLGState() { origin, ).Set(float64(len(upstreams))) - upstreams2Gauge.Reset() upstreams2Gauge.WithLabelValues( p.prefix, p.pop, @@ -167,7 +169,6 @@ func (p *Prefix) checkLGState() { origin, ).Set(float64(len(upstreams2))) - bgpCommunitiesGauge.Reset() communities = slices.Compact(communities) for _, e := range communities { bgpCommunitiesGauge.WithLabelValues(