From 7f30ac2ac092898f58b2c65a25fad2cee0345b52 Mon Sep 17 00:00:00 2001 From: Ezri Zhu Date: Fri, 18 Oct 2024 02:13:33 -0400 Subject: [PATCH] fix --- lg.go | 4 ---- main.go | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lg.go b/lg.go index 005544e..fc769c7 100644 --- a/lg.go +++ b/lg.go @@ -75,10 +75,6 @@ func (p *Prefix) checkLGState() { availableStr = "n" } - upstreamsGauge.Reset() - upstreams2Gauge.Reset() - bgpCommunitiesGauge.Reset() - origin := strconv.Itoa(p.origin) for _, rrc := range ripeStatLookingGlassResp.Data.Rrcs { diff --git a/main.go b/main.go index 757e1ee..e0483f9 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,11 @@ const ripestatBase = "https://stat.ripe.net" func updateStates() { log.Debug().Msg("Updating Prefixes") + + upstreamsGauge.Reset() + upstreams2Gauge.Reset() + bgpCommunitiesGauge.Reset() + for _, prefix := range monitorState { prefix.checkVisState() prefix.checkLGState() @@ -60,9 +65,8 @@ func main() { Str("Data Source", "RIPE RIS via RIPEstat API"). Msg("Starting PEERINGMON Exporter") - updateStates() - setUpstreamGauge() + updateStates() go func() { ticker := time.NewTicker(1 * time.Minute)