Skip to content

Commit

Permalink
remove the manual group counting
Browse files Browse the repository at this point in the history
Signed-off-by: Mikolaj Pawlikowski <[email protected]>
  • Loading branch information
seeker89 committed Dec 6, 2018
1 parent b071dca commit 9fda1ec
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions pkg/goldpinger/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,6 @@ var (
},
)

groups = map[string]map[string]int64{
"received": map[string]int64{
"ping": 0,
"check": 0,
"check_all": 0,
},
"made": map[string]int64{
"ping": 0,
"check": 0,
"check_all": 0,
},
}

bootTime = time.Now()
)

Expand All @@ -109,21 +96,14 @@ func init() {
}

func GetStats() *models.PingResults {
var result models.PingResults
var calls models.CallStats

calls.Check = groups["received"]["check"]
calls.CheckAll = groups["received"]["check_all"]
calls.Ping = groups["received"]["ping"]
result.BootTime = strfmt.DateTime(bootTime)
result.Received = &calls
return &result
// GetStats no longer populates the received and made calls - use metrics for that instead
return &models.PingResults{
BootTime: strfmt.DateTime(bootTime),
}
}

// counts various calls received and made
func CountCall(group string, call string) {
groups[group][call]++

goldpingerStatsCounter.WithLabelValues(
GoldpingerConfig.Hostname,
group,
Expand Down

0 comments on commit 9fda1ec

Please sign in to comment.