summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-12-16 18:37:44 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2010-12-16 18:37:44 +0000
commitfaa35a799468acc38a014d781e535d08f1b97f35 (patch)
treef4043587187c6b502870483b58f902a6300e0c80 /src
parent33184f2cdc708cdb49929db33eba0212128228a6 (diff)
downloadrabbitmq-server-git-faa35a799468acc38a014d781e535d08f1b97f35.tar.gz
Permit dynamic inspection of the current mirror queues. This isn't particularly lovely because the master queue itself does not know, and thus has to do an mnesia read. However, for the time being it should do
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl6
-rw-r--r--src/rabbit_control.erl6
2 files changed, 11 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index f8ec4ec8b3..4dd48457a3 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -89,7 +89,8 @@
messages,
consumers,
memory,
- backing_queue_status
+ backing_queue_status,
+ mirror_pids
]).
-define(CREATION_EVENT_KEYS,
@@ -761,6 +762,9 @@ i(memory, _) ->
M;
i(backing_queue_status, #q{backing_queue_state = BQS, backing_queue = BQ}) ->
BQ:status(BQS);
+i(mirror_pids, #q{q = #amqqueue{name = Name}}) ->
+ {ok, #amqqueue{mirror_pids = MPids}} = rabbit_amqqueue:lookup(Name),
+ MPids;
i(Item, _) ->
throw({bad_argument, Item}).
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index df55d9612b..4a0bd25e54 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -353,6 +353,12 @@ format_info_item([{TableEntryKey, TableEntryType, _TableEntryValue} | _] =
Value) when is_binary(TableEntryKey) andalso
is_atom(TableEntryType) ->
io_lib:format("~1000000000000p", [prettify_amqp_table(Value)]);
+format_info_item([T | _] = Value)
+ when is_tuple(T) orelse is_pid(T) orelse is_binary(T) orelse is_atom(T) orelse
+ is_list(T) ->
+ "[" ++
+ lists:nthtail(2, lists:append(
+ [", " ++ format_info_item(E) || E <- Value])) ++ "]";
format_info_item(Value) ->
io_lib:format("~w", [Value]).