MCPcopy Index your code
hub / github.com/PasarGuard/node / GetBackendStats

Method GetBackendStats

controller/rest/stats.go:67–77  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

65}
66
67func (s *Service) GetBackendStats(w http.ResponseWriter, r *http.Request) {
68 stats, err := s.Backend().GetSysStats(r.Context())
69 if err != nil {
70 st, _ := status.FromError(err)
71 httpCode := common.GrpcCodeToHTTP(st.Code())
72 http.Error(w, err.Error(), httpCode)
73 return
74 }
75
76 common.SendProtoResponse(w, stats)
77}
78
79func (s *Service) GetOutboundsLatency(w http.ResponseWriter, r *http.Request) {
80 var request common.LatencyRequest

Callers

nothing calls this directly

Implementers 1

Controllercontroller/controller.go

Calls 5

GrpcCodeToHTTPFunction · 0.92
SendProtoResponseFunction · 0.92
BackendMethod · 0.80
ErrorMethod · 0.80
GetSysStatsMethod · 0.65

Tested by

no test coverage detected