(w http.ResponseWriter, r *http.Request)
| 203 | } |
| 204 | |
| 205 | func (s *Server) status(w http.ResponseWriter, r *http.Request) { |
| 206 | health := s.cachedBackendHealth(r.Context()) |
| 207 | backends := make([]map[string]string, 0, len(s.cfg.Backends)) |
| 208 | for _, backend := range s.cfg.Backends { |
| 209 | status := "unhealthy" |
| 210 | if h, ok := health[backend.Name]; ok && h { |
| 211 | status = "healthy" |
| 212 | } |
| 213 | backends = append(backends, map[string]string{ |
| 214 | "name": backend.Name, |
| 215 | "status": status, |
| 216 | }) |
| 217 | } |
| 218 | |
| 219 | sig := s.CurrentSignals() |
| 220 | writeJSON(w, http.StatusOK, map[string]any{ |
| 221 | "service": "infercore", |
| 222 | "backends": backends, |
| 223 | "queue_depth": s.inferInflight.Load(), |
| 224 | "telemetry": s.telemetryStatus(), |
| 225 | "scaling_signals": sig, |
| 226 | }) |
| 227 | } |
| 228 | |
| 229 | func cloneBoolMap(m map[string]bool) map[string]bool { |
| 230 | if m == nil { |
nothing calls this directly
no test coverage detected