For application monitoring purposes I would like to know roughly how many messages are sitting in a
Channel created with a buffer.
The naive approach suggests that adding a
size method to
Channel and having that call the internal
@queue.size method should do it however conversation on Restoring Channel#full? suggests that it may not be as simple in MT.
Also the method name of
size might be problematic as it could be confused with the actual size of the buffer when creating a channel. i.e.
Channel.new(1024).size would aways return 1024 or the number of items?.
Maybe a separate method called
capacity or some-such could also be added for that piece of information, although personally I don’t need it.