MCPcopy Create free account
hub / github.com/PasarGuard/node / GetOutboundsLatency

Method GetOutboundsLatency

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

Source from the content-addressed store, hash-verified

77}
78
79func (s *Service) GetOutboundsLatency(w http.ResponseWriter, r *http.Request) {
80 var request common.LatencyRequest
81 if err := common.ReadProtoBody(r.Body, &request); err != nil {
82 http.Error(w, err.Error(), http.StatusBadRequest)
83 return
84 }
85
86 latency, err := s.OutboundsLatency(r.Context(), &request)
87 if err != nil {
88 http.Error(w, err.Error(), http.StatusBadGateway)
89 return
90 }
91
92 common.SendProtoResponse(w, latency)
93}
94
95func (s *Service) GetSystemStats(w http.ResponseWriter, r *http.Request) {
96 common.SendProtoResponse(w, s.SystemStats(r.Context()))

Callers

nothing calls this directly

Implementers 1

Controllercontroller/controller.go

Calls 4

ReadProtoBodyFunction · 0.92
SendProtoResponseFunction · 0.92
ErrorMethod · 0.80
OutboundsLatencyMethod · 0.80

Tested by

no test coverage detected