-
Notifications
You must be signed in to change notification settings - Fork 151
Description
Currently, the library emits a connectionClosed
event, which is helpful for tracking the overall bandwidth usage of a socket connection. However, in many real-world scenarios involving persistent connections (e.g., HTTP keep-alive), it's valuable to monitor bandwidth usage on a per-request basis.
Feature Request
I’d like to propose adding support for a new event, requestFinished
, which would be emitted at the end of each individual HTTP/HTTPS request-response cycle.
While precise per-request bandwidth usage may not be trivial to isolate due to socket reuse, this event would still provide:
- A time-based approximation of bandwidth usage across requests.
- Insight into request frequency, response size patterns, and endpoint behavior.
- A hook for logging, monitoring, or quota management per request.
Why This Matters
Tracking only at the socket level can obscure usage spikes or performance anomalies associated with individual requests—especially under connection pooling or when clients reuse a single proxy connection.