diff options
| author | Matthias Radestock <matthias@lshift.net> | 2010-02-01 22:58:09 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2010-02-01 22:58:09 +0000 |
| commit | 209e5914c0329c51efa9463bf5806641344624fc (patch) | |
| tree | 1d444bec252d899b5fb1c1b575cdda77d0f40b03 | |
| parent | eafef585eb6c367d99dafcccb605e517e7c60839 (diff) | |
| download | rabbitmq-server-git-209e5914c0329c51efa9463bf5806641344624fc.tar.gz | |
add 'rabbitmqctl list_channels' command
| -rw-r--r-- | docs/rabbitmqctl.1.pod | 56 | ||||
| -rw-r--r-- | src/rabbit_control.erl | 13 |
2 files changed, 69 insertions, 0 deletions
diff --git a/docs/rabbitmqctl.1.pod b/docs/rabbitmqctl.1.pod index 5255be28a0..e768ae764c 100644 --- a/docs/rabbitmqctl.1.pod +++ b/docs/rabbitmqctl.1.pod @@ -367,6 +367,62 @@ send queue size =back +=over + +=item list_channels [I<channelinfoitem> ...] + +List channel information. Each line printed describes a channel, +I<channelinfoitem> values separated by tab characters. If no +I<channelinfoitem>s are specified then I<pid>, I<user>, +I<transactional>, I<consumer_count>, and I<messages_unacknowledged> +are assumed. + +The list includes channels which are part of ordinary AMQP connections +(as listed by list_connections) and channels created by various +plug-ins and other extensions. + +=back + +=head3 Channel information items + +=over + +=item pid + +id of the Erlang process associated with the channel + +=item connection + +id of the Erlang process associated with the connection to which the +channel belongs. + +=item user + +username associated with the channel + +=item vhost + +virtual host in which the channel operates + +=item transactional + +true if the channel is in transactional mode, false otherwise + +=item consumer_count + +number of logical AMQP consumers retrieving messages via the channel + +=item messages_unacknowledged + +number of messages delivered to via this channel but not yet +acknowledged + +=item prefetch_count + +QoS prefetch count limit in force, 0 if unlimited + +=back + The list_queues, list_exchanges and list_bindings commands accept an optional virtual host parameter for which to display results, defaulting to I<"/">. The default can be overridden with the B<-p> diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index 2fe3f33e09..738ed444f4 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -158,6 +158,7 @@ Available commands: list_exchanges [-p <VHostPath>] [<ExchangeInfoItem> ...] list_bindings [-p <VHostPath>] list_connections [<ConnectionInfoItem> ...] + list_channels [<ChannelInfoItem> ...] Quiet output mode is selected with the \"-q\" flag. Informational messages are suppressed when quiet mode is in effect. @@ -191,6 +192,11 @@ frame_max, client_properties, recv_oct, recv_cnt, send_oct, send_cnt, send_pend]. The default is to display user, peer_address, peer_port and state. +<ChannelInfoItem> must be a member of the list [pid, connection, user, +vhost, transactional, consumer_count, messages_unacknowledged, +prefetch_count]. The default is to display pid, user, transactional, +consumer_count, messages_unacknowledged. + "), halt(1). @@ -301,6 +307,13 @@ action(list_connections, Node, Args, Inform) -> [ArgAtoms]), ArgAtoms); +action(list_channels, Node, Args, Inform) -> + Inform("Listing channels", []), + ArgAtoms = default_if_empty(Args, [pid, user, transactional, consumer_count, + messages_unacknowledged]), + display_info_list(rpc_call(Node, rabbit_channel, info_all, [ArgAtoms]), + ArgAtoms); + action(Command, Node, Args, Inform) -> {VHost, RemainingArgs} = parse_vhost_flag(Args), action(Command, Node, VHost, RemainingArgs, Inform). |
