Skip to content

Commit

Permalink
fix exec flow of lg
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrizhu committed Nov 14, 2024
1 parent ba72eba commit 5d298fa
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions lg.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ func (p *Prefix) checkLGState() {

origin := strconv.Itoa(p.origin)

for _, rrc := range ripeStatLookingGlassResp.Data.Rrcs {
communities := []string{}
for _, peer := range rrc.Peers {
communities = append(communities, peer.Community)
//communities = slices.Compact(communities)
for _, e := range communities {
bgpCommunitiesGauge.WithLabelValues(
p.prefix,
rrc.Location,
p.pop,
e,
).Set(1)
}
}
}

for _, rrc := range ripeStatLookingGlassResp.Data.Rrcs {
upstreams := []string{}
upstreams2 := []string{}
Expand Down Expand Up @@ -151,16 +167,6 @@ func (p *Prefix) checkLGState() {
}
}

//communities = slices.Compact(communities)
for _, e := range communities {
bgpCommunitiesGauge.WithLabelValues(
p.prefix,
rrc.Location,
p.pop,
e,
).Set(1)
}

upstreamsGauge.WithLabelValues(
p.prefix,
p.pop,
Expand Down

0 comments on commit 5d298fa

Please sign in to comment.