Skip to content

Commit

Permalink
vis count
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrizhu committed Nov 14, 2024
1 parent 58b690d commit 74b3dcb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lg.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ var (
},
[]string{"prefix", "city", "mux", "communities"},
)
prefixCountGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "prefix_count",
Help: "Prefix Count",
},
[]string{"prefix", "city", "mux"},
)
)

func (p *Prefix) checkLGState() {
Expand Down Expand Up @@ -77,6 +83,14 @@ func (p *Prefix) checkLGState() {

origin := strconv.Itoa(p.origin)

for _, rrc := range ripeStatLookingGlassResp.Data.Rrcs {
prefixCountGauge.WithLabelValues(
p.prefix,
rrc.Location,
p.pop,
).Set(float64(len(rrc.Peers)))
}

for _, rrc := range ripeStatLookingGlassResp.Data.Rrcs {
//communities := []string{}
for _, peer := range rrc.Peers {
Expand Down

0 comments on commit 74b3dcb

Please sign in to comment.