puma-plugin-statsd icon indicating copy to clipboard operation
puma-plugin-statsd copied to clipboard

Negative requests count metric on server shutdown

Open tjvc opened this issue 1 year ago • 1 comments

We're seeing this plugin report a negative requests count metric just before Puma (in our case in a Kubernetes pod) shuts down. I'm assuming that the counters are cleared at some point during the shutdown process (or perhaps the workers shut down before the master process) and that when we calculate the request count we end up subtracting from zero.

Would you accept a patch that ensures that requests count never returns less than zero? Happy to submit a PR if so.

tjvc avatar Nov 27 '24 10:11 tjvc

Yup, I'd accept a PR for this!

It feels a shame to not just pass through whatever puma says the stats are, but also non-zero request count seems .... not ideal :man_shrugging:

yob avatar Dec 02 '24 03:12 yob