diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2011-07-26 16:57:06 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-07-26 16:57:06 +0100 |
| commit | 99a23a6ab47505b08cbd7e72aab5d6624c68e81f (patch) | |
| tree | 3ec5146ae01f17964f63186f26a59b7fa650f9ac | |
| parent | 3ea2233ba38bd0e30535bdbba133642097bcdc95 (diff) | |
| download | rabbitmq-server-git-99a23a6ab47505b08cbd7e72aab5d6624c68e81f.tar.gz | |
+documentation, minor renaming, clarity
| -rw-r--r-- | src/gen_server2.erl | 7 | ||||
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/gen_server2.erl b/src/gen_server2.erl index d1b24714be..5bf28477c2 100644 --- a/src/gen_server2.erl +++ b/src/gen_server2.erl @@ -67,6 +67,11 @@ %% module. Note there is no form also encompassing a reply, thus if %% you wish to reply in handle_call/3 and change the callback module, %% you need to use gen_server2:reply/2 to issue the reply manually. +%% +%% 8) The callback module can optionally implement +%% format_message_queue/2 which is the equivalent of format_status/2 +%% but where the second argument is specifically the priority_queue +%% which contains the prioritised message_queue. %% All modifications are (C) 2009-2011 VMware, Inc. @@ -1163,7 +1168,7 @@ format_status(Opt, StatusData) -> Log = sys:get_debug(log, Debug, []), Specfic = callback_format_status(Opt, Mod, format_status, [PDict, State], [{data, [{"State", State}]}]), - Messages = callback_format_status(Opt, Mod, format_priority_mailbox, Queue, + Messages = callback_format_status(Opt, Mod, format_message_queue, Queue, priority_queue:to_list(Queue)), [{header, Header}, {data, [{"Status", SysState}, diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index f0db479f86..4b144ff480 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -35,7 +35,7 @@ -export([init_with_backing_queue_state/7]). --export([format_priority_mailbox/2]). +-export([format_message_queue/2]). %% Queue's state -record(q, {q, @@ -1165,11 +1165,12 @@ handle_pre_hibernate(State = #q{backing_queue = BQ, backing_queue_state = BQS3}, {hibernate, stop_rate_timer(State1)}. -format_priority_mailbox(_Opt, Mailbox) -> +format_message_queue(_Opt, Mailbox) -> Len = priority_queue:len(Mailbox), {Len, case Len > 100 of false -> priority_queue:to_list(Mailbox); - true -> {dict:to_list( + true -> {summary, + dict:to_list( lists:foldl( fun ({P, _V}, Counts) -> dict:update_counter(P, 1, Counts) |
