mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 01:08:47 +02:00
improved metrics implementation
This commit is contained in:
@@ -37,13 +37,13 @@ func HealthMap() map[string]map[string]string {
|
||||
return healthMap
|
||||
}
|
||||
|
||||
func HealthStatuses() map[string]health.Status {
|
||||
healthMap := make(map[string]health.Status, routes.NumRoutes())
|
||||
func HealthInfo() map[string]health.WithHealthInfo {
|
||||
healthMap := make(map[string]health.WithHealthInfo, routes.NumRoutes())
|
||||
routes.RangeRoutes(func(alias string, r route.Route) {
|
||||
if r.HealthMonitor() == nil {
|
||||
return
|
||||
mon := r.HealthMonitor()
|
||||
if mon != nil {
|
||||
healthMap[alias] = mon
|
||||
}
|
||||
healthMap[alias] = r.HealthMonitor().Status()
|
||||
})
|
||||
return healthMap
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user