MCPcopy
hub / github.com/PatchMon/PatchMon / Stats

Method Stats

server-source-code/internal/handler/dashboard.go:31–38  ·  view source on GitHub ↗

Stats handles GET /dashboard/stats.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

29
30// Stats handles GET /dashboard/stats.
31func (h *DashboardHandler) Stats(w http.ResponseWriter, r *http.Request) {
32 stats, err := h.dashboard.GetStats(r.Context())
33 if err != nil {
34 Error(w, http.StatusInternalServerError, "Failed to load dashboard stats")
35 return
36 }
37 JSON(w, http.StatusOK, stats)
38}
39
40// Hosts handles GET /dashboard/hosts.
41func (h *DashboardHandler) Hosts(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 3

ErrorFunction · 0.85
JSONFunction · 0.70
GetStatsMethod · 0.45

Tested by

no test coverage detected