MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / statJSON

Method statJSON

internal/panel/handler.go:358–366  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

356}
357
358func (h *Handler) statJSON(w http.ResponseWriter, r *http.Request) {
359 payload, err := h.buildStatPayload()
360 if err != nil {
361 http.Error(w, "internal server error", http.StatusInternalServerError)
362 return
363 }
364 w.Header().Set("Content-Type", "application/json")
365 json.NewEncoder(w).Encode(payload)
366}
367
368// statStream 是 /v1/stat/stream 的 SSE 处理器(无需认证)。
369// 连接时立即推送 event:init(完整 stat 数据),之后每 2s 推送 event:metrics(实时网速),

Callers

nothing calls this directly

Calls 2

buildStatPayloadMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected