jberryman / unagi-chan

A haskell library implementing fast and scalable concurrent queues for x86, with a Chan-like API
BSD 3-Clause "New" or "Revised" License
127 stars 15 forks source link

Estimated bounded queue length #23

Closed danclien closed 6 years ago

danclien commented 6 years ago

Is there a way to get an estimated length for a bounded queue? It would be nice to be able to send that metric over to our monitoring system.

jberryman commented 6 years ago

Not with the current API. You could get an estimate by reading the input and output counters and subtracting them, with the obvious caveats that the value might be totally inaccurate sometimes since both reads won't be done atomically.