MCPcopy Create free account
hub / github.com/InferCore/InferCore / status

Method status

internal/server/server.go:205–227  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

203}
204
205func (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
229func cloneBoolMap(m map[string]bool) map[string]bool {
230 if m == nil {

Callers

nothing calls this directly

Calls 4

cachedBackendHealthMethod · 0.95
CurrentSignalsMethod · 0.95
telemetryStatusMethod · 0.95
writeJSONFunction · 0.85

Tested by

no test coverage detected