remove the manual group counting

Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
This commit is contained in:
Mikolaj Pawlikowski
2018-12-06 15:48:30 +00:00
parent b071dcaa97
commit 9fda1ec4e7
+4 -24
View File
@@ -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()
)
@@ -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,