couchdb-couch
couchdb-couch copied to clipboard
Add counters for lifetime total queued and dequeued items
This PR enables a work queue to keep a running total of all the work that's ever been added to it, queryable through the functions total_in/1, total_out/1, and total_held/1. Additionally, a queue(Wq, Item, CountsAs) function-clause has been added and exported, which enables a single queue-item to be counted as an arbitrary number of work-items from the perspective of the running total counters. This allows for the ability to track the total number of individual work-items processed, even when queuing and dequeuing are done in "chunks" of items, as is done in couch_index_updater.
COUCHDB-2955 BugzID: 14036
Here need some tests to make sure that it counts right.