Closed gavin-norman-sociomantic closed 5 years ago
Two ways of implementing this that come to mind:
Another idea:
Allow request handlers to access this, look up the request, and update the stats.
This is the only tricky part of the above suggestion. Currently, request handlers have no access to anything at the level of the request set. The request-on-conn would be a possible way to pass a ref to the stats tracker, but that sounds a little bit on the edge of hacky.
Currently, request handlers have no access to anything at the level of the request set.
My top-of-the-head knowledge of the neo client isn't as fresh as it used to be :( The request context forms this conduit between the request set and the individual handlers.
Actually, we already have stats for connection I/O throughput. This might be enough, in practice.
Closing. No current use case.
Applications commonly want to monitor the throughput of their stream / batch requests. It would be nice to support this in the client directly.
Update: This feature is only required if we need per-request throughput stats, at some point. We already have per-connection throughput stats: https://github.com/sociomantic-tsunami/swarm/blob/v5.x.x/src/swarm/neo/client/mixins/ClientCore.d#L420