Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Emit stats unconditionally
Browse files Browse the repository at this point in the history
...of connection (flow control) state.

This makes it much easier to reason about flow control
state when looking at the management UI or monitoring tools
that poll HTTP API.
Now that rabbitmq/rabbitmq-management#41 is merged, there are
few arguments against always emitting stats.

Fixes #679.
  • Loading branch information
michaelklishin committed Mar 8, 2016
1 parent 2b934e7 commit 68c9f7d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/rabbit_reader.erl
Expand Up @@ -1465,13 +1465,7 @@ emit_stats(State) ->
Infos = infos(?STATISTICS_KEYS, State),
rabbit_event:notify(connection_stats, Infos),
State1 = rabbit_event:reset_stats_timer(State, #v1.stats_timer),
%% If we emit an event which looks like we are in flow control, it's not a
%% good idea for it to be our last even if we go idle. Keep emitting
%% events, either we stay busy or we drop out of flow control.
case proplists:get_value(state, Infos) of
flow -> ensure_stats_timer(State1);
_ -> State1
end.
ensure_stats_timer(State1).

%% 1.0 stub
-ifdef(use_specs).
Expand Down

0 comments on commit 68c9f7d

Please sign in to comment.