MCPcopy
hub / github.com/netdata/netdata / connectionTracker

Function connectionTracker

packaging/tools/agent-events/server.go:250–256  ·  view source on GitHub ↗

connectionTracker is middleware that wraps an http.Handler to track active connections

(next http.Handler)

Source from the content-addressed store, hash-verified

248
249// connectionTracker is middleware that wraps an http.Handler to track active connections
250func connectionTracker(next http.Handler) http.Handler {
251 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
252 atomic.AddInt32(&activeConnections, 1)
253 defer atomic.AddInt32(&activeConnections, -1)
254 next.ServeHTTP(w, r)
255 })
256}
257
258// --- HTTP Handler ---
259func handler(w http.ResponseWriter, r *http.Request) {

Callers 1

mainFunction · 0.85

Calls 1

ServeHTTPMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…