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 | a01458914b039f1f0dab0df73bdad5c3b16cb03e (patch) | |
| tree | 99a28737c23bc21b9134edfd7da2232014cc1363 /src | |
| parent | ee6d8422aed1f4f1571005de89d8a4a43fe9ce76 (diff) | |
| download | rabbitmq-server-git-a01458914b039f1f0dab0df73bdad5c3b16cb03e.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.
Diffstat (limited to 'src')
| -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 4bb1f13b02..b558a0cc5c 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); |
