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

Commit 1fd2020

Browse files
author
Diana Corbacho
committed
Delete all relevant stats when channels/queues are closed/deleted
* Process all queue and channel events on their own collectors * Ensure base and total are always deleted
1 parent 6c1ad93 commit 1fd2020

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/rabbit_mgmt_channel_stats_collector.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
-define(DROP_LENGTH, 500).
3737

38-
prioritise_cast({event, #event{props = Props}}, Len, _State)
38+
prioritise_cast({event, #event{type = channel_stats, props = Props}}, Len, _State)
3939
when Len > ?DROP_LENGTH ->
4040
case pget(idle_since, Props) of
4141
unknown -> drop;

src/rabbit_mgmt_queue_stats_collector.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
-define(DROP_LENGTH, 500).
3737

38-
prioritise_cast({event, #event{props = Props}}, Len, _State)
38+
prioritise_cast({event, #event{type = queue_stats, props = Props}}, Len, _State)
3939
when Len > ?DROP_LENGTH ->
4040
case pget(idle_since, Props) of
4141
unknown -> drop;

src/rabbit_mgmt_stats.erl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,8 @@ indexes(Table, Id) ->
454454
lists:sort(ets:lookup(rabbit_mgmt_stats_tables:index(Table), Id)).
455455

456456
full_indexes(Table, Id) ->
457-
case ets:lookup(rabbit_mgmt_stats_tables:index(Table), Id) of
458-
[] ->
459-
[];
460-
Indexes ->
461-
[{Id, base}, {Id, total} | Indexes]
462-
end.
457+
Indexes = ets:lookup(rabbit_mgmt_stats_tables:index(Table), Id),
458+
[{Id, base}, {Id, total} | Indexes].
463459

464460
%%----------------------------------------------------------------------------
465461
%% Match specs to select or delete from the ETS tables

0 commit comments

Comments
 (0)