MCPcopy Create free account
hub / github.com/cortexproject/cortex / UserStatsHandler

Method UserStatsHandler

pkg/distributor/http_server.go:10–18  ·  view source on GitHub ↗

UserStatsHandler handles user stats to the Distributor.

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

Source from the content-addressed store, hash-verified

8
9// UserStatsHandler handles user stats to the Distributor.
10func (d *Distributor) UserStatsHandler(w http.ResponseWriter, r *http.Request) {
11 stats, err := d.UserStats(r.Context())
12 if err != nil {
13 http.Error(w, err.Error(), http.StatusInternalServerError)
14 return
15 }
16
17 util.WriteJSONResponse(w, stats)
18}

Callers

nothing calls this directly

Calls 4

UserStatsMethod · 0.95
WriteJSONResponseFunction · 0.92
ContextMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected