pushy icon indicating copy to clipboard operation
pushy copied to clipboard

Queue size / in-flight count in metrics listener

Open pertu opened this issue 3 years ago • 3 comments

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)

pertu avatar Nov 22 '21 11:11 pertu

In-flight requests can be easily calculated as sent - (accepted + rejected) in monitoring tools (e.g. grafana).

pertu avatar Nov 22 '21 12:11 pertu

The metrics listeners are due for an overhaul anyhow; I'll consider this as part of that effort.

jchambers avatar Nov 28 '21 23:11 jchambers

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?"

jchambers avatar Jan 15 '24 21:01 jchambers

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.

jchambers avatar Apr 14 '24 23:04 jchambers