diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-09-29 13:02:28 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-09-29 13:02:28 +0100 |
commit | a203ea9faf929414cb5ebe314d5358109e84830a (patch) | |
tree | 99a28737c23bc21b9134edfd7da2232014cc1363 | |
parent | f3c1eb4e58519762231cf7e21c6bebfed16d6749 (diff) | |
download | rabbitmq-server-a203ea9faf929414cb5ebe314d5358109e84830a.tar.gz |
add confirm related info keys
Added the following info_keys:
- confirm :: The type of the channel. Is one of none, single,
multiple.
- unconfirmed :: The number of unconfirmed messages.
-rw-r--r-- | src/rabbit_channel.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 4bb1f13b..b558a0cc 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -57,8 +57,10 @@ -define(STATISTICS_KEYS, [pid, transactional, + confirm, consumer_count, messages_unacknowledged, + unconfirmed, acks_uncommitted, prefetch_count]). @@ -1288,8 +1290,16 @@ i(number, #ch{channel = Channel}) -> Channel; i(user, #ch{username = Username}) -> Username; i(vhost, #ch{virtual_host = VHost}) -> VHost; i(transactional, #ch{transaction_id = TxnKey}) -> TxnKey =/= none; +i(confirm, #ch{confirm_enabled = CE, + confirm_multiple = CM}) -> case {CE, CM} of + {false, _} -> none; + {_, false} -> single; + {_, true} -> multiple + end; i(consumer_count, #ch{consumer_mapping = ConsumerMapping}) -> dict:size(ConsumerMapping); +i(unconfirmed, #ch{need_confirming = NC}) -> + gb_sets:size(NC); i(messages_unacknowledged, #ch{unacked_message_q = UAMQ, uncommitted_ack_q = UAQ}) -> queue:len(UAMQ) + queue:len(UAQ); |