pushy
pushy copied to clipboard
Queue size / in-flight count in metrics listener
It would be nice to have "queued requests count" (aka NioEventLoop.pendingTasks()) in the metrics listener.
It's possible to access ApnsClient.channelPool.executor.pendingTasks() using reflection, but it seems too hacky and fragile.
In-flight: easy to calculate using "request start" and "request reject/accept" events, but it would be nice to have it in the default listeners (e.g. MicrometerApnsClientMetricsListener)
In-flight requests can be easily calculated as sent - (accepted + rejected) in monitoring tools (e.g. grafana).
The metrics listeners are due for an overhaul anyhow; I'll consider this as part of that effort.
I have, as promised (and after much delay) made a pass at improving metrics listeners in #1046. Having done that, I don't think it necessarily makes sense to add a dedicated metric for outstanding requests because, as you correctly point out, that count
…can be easily calculated as sent - (accepted + rejected) in monitoring tools (e.g. grafana).
Can you please clarify why you'd want to consider "queued requests" seaparately from "in-flight?"
Closing this issue for now for the reasons stated above and for lack of counter-argument. @pertu if you have the opportunity to provide more information, please feel free to leave a comment here and I'll happily reopen the issue.