Two defects, both in server.go, both fatal:
TCPKeepalive is fasthttp own on/off flag (bool); the interval field is
TCPKeepalivePeriod. Assigning 3*time.Minute to the flag is a type error, so
the package failed to build for every consumer — luxfi/adx among them.
HandleRequest computed `duration := time.Since(start)` under a comment
reading "Increment counters atomically" and then did nothing with it. An
unused local is also a compile error, so even fixing the first defect left
this one.
The three metrics fields (requestsInFlight, requestsTotal, requestDuration) were
declared and never written anywhere. Rather than delete `duration` to silence
the compiler, this wires the counters the comment described and adds Stats() to
read them — write-only counters would be no better than not keeping any.
Builds clean, go vet clean.
Co-authored-by: Hanzo Dev <[email protected]>