summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2010-09-30 09:31:11 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2010-09-30 09:31:11 +0100
commita250fccfd9b7a17d75562b3ffd2ec2b24144cbcb (patch)
tree49a6fff020286f831a508f389c97e0673e42911c /src
parenta01458914b039f1f0dab0df73bdad5c3b16cb03e (diff)
downloadrabbitmq-server-git-a250fccfd9b7a17d75562b3ffd2ec2b24144cbcb.tar.gz
added fine grained stats
Channel now emits the number of publisher acks (confirms) sent to the publisher. If this number is less than the number of publishes, it means that the broker isn't coping with the amount of incoming messages.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index b558a0cc5c..55d2a0b425 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -464,6 +464,7 @@ send_or_enqueue_ack(_, State = #ch{confirm_enabled = false}) ->
State;
send_or_enqueue_ack(MsgSeqNo,
State = #ch{confirm_multiple = false}) ->
+ maybe_incr_stats([{channel_stats, 1}], confirm, State),
do_if_not_dup(MsgSeqNo, State,
fun(MSN, S = #ch{writer_pid = WriterPid,
qpid_to_msgs = QTM}) ->
@@ -475,6 +476,7 @@ send_or_enqueue_ack(MsgSeqNo,
end, QTM) }
end);
send_or_enqueue_ack(MsgSeqNo, State = #ch{confirm_multiple = true}) ->
+ maybe_incr_stats([{channel_stats, 1}], confirm, State),
do_if_not_dup(MsgSeqNo, State,
fun(MSN, S = #ch{qpid_to_msgs = QTM}) ->
State1 = start_ack_timer(S),
@@ -1322,6 +1324,8 @@ incr_stats({QPid, _} = QX, Inc, Measure) ->
incr_stats(QPid, Inc, Measure) when is_pid(QPid) ->
maybe_monitor(QPid),
update_measures(queue_stats, QPid, Inc, Measure);
+incr_stats(channel_stats, Inc, Measure) ->
+ update_measures(channel_stats, self(), Inc, Measure);
incr_stats(X, Inc, Measure) ->
update_measures(exchange_stats, X, Inc, Measure).
@@ -1355,6 +1359,8 @@ internal_emit_stats(State = #ch{stats_timer = StatsTimer}) ->
[{QPid, Stats} || {{queue_stats, QPid}, Stats} <- get()]},
{channel_exchange_stats,
[{X, Stats} || {{exchange_stats, X}, Stats} <- get()]},
+ {channel_channel_stats,
+ [Stats || {{channel_stats, _}, Stats} <- get()]},
{channel_queue_exchange_stats,
[{QX, Stats} ||
{{queue_exchange_stats, QX}, Stats} <- get()]}],