couchdb-couch icon indicating copy to clipboard operation
couchdb-couch copied to clipboard

Add counters for lifetime total queued and dequeued items

Open tsutsu opened this issue 9 years ago • 1 comments

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

tsutsu avatar Feb 27 '16 01:02 tsutsu

Here need some tests to make sure that it counts right.

kxepal avatar Feb 27 '16 08:02 kxepal