summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-06-20 15:47:04 +0100
committerSimon MacMullen <simon@rabbitmq.com>2011-06-20 15:47:04 +0100
commit4b50006fe43430efc36cf84b4a553ff94937ef42 (patch)
tree74c90000db3e7b88c9022941dd545e0f83a77afd /src
parent6154fbdfb428a524640a361fd99d79a1f04f0f8d (diff)
downloadrabbitmq-server-4b50006fe43430efc36cf84b4a553ff94937ef42.tar.gz
Generate fine stats on redeliver.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 991b0b06..51d844c9 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -286,12 +286,11 @@ handle_cast({deliver, ConsumerTag, AckRequired,
exchange = ExchangeName#resource.name,
routing_key = RoutingKey},
rabbit_writer:send_command_and_notify(WriterPid, QPid, self(), M, Content),
-
- maybe_incr_stats([{QPid, 1}],
- case AckRequired of
- true -> deliver;
- false -> deliver_no_ack
- end, State),
+ maybe_incr_stats([{QPid, 1}], case AckRequired of
+ true -> deliver;
+ false -> deliver_no_ack
+ end, State),
+ maybe_incr_redeliver(Redelivered, QPid, State),
rabbit_trace:tap_trace_out(Msg, TraceState),
noreply(State1#ch{next_tag = DeliveryTag + 1});
@@ -690,6 +689,7 @@ handle_method(#'basic.get'{queue = QueueNameBin,
true -> get_no_ack;
false -> get
end, State),
+ maybe_incr_redeliver(Redelivered, QPid, State),
rabbit_trace:tap_trace_out(Msg, TraceState),
ok = rabbit_writer:send_command(
WriterPid,
@@ -1454,6 +1454,11 @@ i(client_flow_blocked, #ch{limiter_pid = LimiterPid}) ->
i(Item, _) ->
throw({bad_argument, Item}).
+maybe_incr_redeliver(true, QPid, State) ->
+ maybe_incr_stats([{QPid, 1}], redeliver, State);
+maybe_incr_redeliver(_, _, _) ->
+ ok.
+
maybe_incr_stats(QXIncs, Measure, #ch{stats_timer = StatsTimer}) ->
case rabbit_event:stats_level(StatsTimer) of
fine -> [incr_stats(QX, Inc, Measure) || {QX, Inc} <- QXIncs];