Add an API for mem3_sync queue lengths
Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/4a94b1ee Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/4a94b1ee Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/4a94b1ee Branch: refs/heads/import Commit: 4a94b1eeaf30ce3a9742e8f7be75bac673fb425f Parents: 755759e Author: Paul J. Davis <paul.joseph.da...@gmail.com> Authored: Thu Feb 21 01:08:21 2013 -0600 Committer: Paul J. Davis <paul.joseph.da...@gmail.com> Committed: Thu Feb 21 01:08:21 2013 -0600 ---------------------------------------------------------------------- src/mem3_sync.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/4a94b1ee/src/mem3_sync.erl ---------------------------------------------------------------------- diff --git a/src/mem3_sync.erl b/src/mem3_sync.erl index 3b20d49..a0eb8f1 100644 --- a/src/mem3_sync.erl +++ b/src/mem3_sync.erl @@ -18,7 +18,7 @@ code_change/3]). -export([start_link/0, get_active/0, get_queue/0, push/1, push/2, - remove_node/1, initial_sync/1]). + remove_node/1, initial_sync/1, get_backlog/0]). -import(queue, [in/2, out/1, to_list/1, join/2, from_list/1, is_empty/1]). @@ -45,6 +45,9 @@ get_active() -> get_queue() -> gen_server:call(?MODULE, get_queue). +get_backlog() -> + gen_server:call(?MODULE, get_backlog). + push(#shard{name = Name}, Target) -> push(Name, Target); push(Name, #shard{node=Node}) ->