kiteco-public/kite-go/kitestatus/status.go
2021-12-31 23:54:19 -08:00

29 lines
530 B
Go

package kitestatus
// Get returns all the metrics kitestatus knows about
func Get() map[string]interface{} {
collected := make(map[string]interface{})
metrics.Range(func(key, value interface{}) bool {
switch t := value.(type) {
case Metric:
for k, v := range t.Value() {
collected[k] = v
}
}
return true
})
return collected
}
// Reset resets all the metrics
func Reset() {
metrics.Range(func(key, value interface{}) bool {
switch t := value.(type) {
case Metric:
t.Reset()
}
return true
})
}