diff options
| author | Michael Klishin <mklishin@pivotal.io> | 2019-10-17 07:34:07 +0300 |
|---|---|---|
| committer | Michael Klishin <mklishin@pivotal.io> | 2019-10-17 07:34:07 +0300 |
| commit | 57ff7b30929e094de17a72b000e18f7e6cf00baa (patch) | |
| tree | b07c6aeca51bd02b2d34f634fb0a750c42da245d | |
| parent | 50fbc5259df3b23ec34af156516203b0b8030c5e (diff) | |
| download | rabbitmq-server-git-57ff7b30929e094de17a72b000e18f7e6cf00baa.tar.gz | |
Revert "Merge pull request #2136 from rabbitmq/mark-down-queue-core-metrics"
This reverts commit 50fbc5259df3b23ec34af156516203b0b8030c5e, reversing
changes made to 46a0181bc9729f20fad631c779dfbb817c71c206.
There are test failures in two suites.
| -rw-r--r-- | src/rabbit_amqqueue.erl | 15 | ||||
| -rw-r--r-- | src/rabbit_core_metrics_gc.erl | 22 |
2 files changed, 2 insertions, 35 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index ff83bc9d04..925e7915cb 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -32,7 +32,7 @@ emit_info_local/4, emit_info_down/4]). -export([count/0]). -export([list_down/1, count/1, list_names/0, list_names/1, list_local_names/0, - list_local_names_down/0, list_with_possible_retry/1]). + list_with_possible_retry/1]). -export([list_by_type/1]). -export([force_event_refresh/1, notify_policy_changed/1]). -export([consumers/1, consumers_all/1, emit_consumers_all/4, consumer_info_keys/0]). @@ -941,19 +941,6 @@ list_local_names() -> [ amqqueue:get_name(Q) || Q <- list(), amqqueue:get_state(Q) =/= crashed, is_local_to_node(amqqueue:get_pid(Q), node())]. -list_local_names_down() -> - [ amqqueue:get_name(Q) || Q <- list(), - is_down(Q), - is_local_to_node(amqqueue:get_pid(Q), node())]. - -is_down(Q) -> - try - info(Q, [state]) == [{state, down}] - catch - _:_ -> - true - end. - -spec list_by_type(atom()) -> [amqqueue:amqqueue()]. list_by_type(Type) -> diff --git a/src/rabbit_core_metrics_gc.erl b/src/rabbit_core_metrics_gc.erl index 58e6c90c08..99ad8eef34 100644 --- a/src/rabbit_core_metrics_gc.erl +++ b/src/rabbit_core_metrics_gc.erl @@ -75,11 +75,9 @@ gc_queues() -> gc_local_queues() -> Queues = rabbit_amqqueue:list_local_names(), - QueuesDown = rabbit_amqqueue:list_local_names_down(), GbSet = gb_sets:from_list(Queues), - GbSetDown = gb_sets:from_list(QueuesDown), gc_entity(queue_metrics, GbSet), - gc_queue_metrics(GbSet, GbSetDown), + gc_entity(queue_coarse_metrics, GbSet), Followers = gb_sets:from_list(rabbit_amqqueue:list_local_followers()), gc_leader_data(Followers). @@ -135,24 +133,6 @@ gc_process(Pid, Table, Key) -> none end. -gc_queue_metrics(GbSet, GbSetDown) -> - Table = queue_metrics, - ets:foldl(fun({Key, Props, Marker}, none) -> - case gb_sets:is_member(Key, GbSet) of - true -> - case gb_sets:is_member(Key, GbSetDown) of - true -> - ets:insert(Table, {Key, [{state, down} | lists:keydelete(state, 1, Props)], Marker}), - none; - false -> - none - end; - false -> - ets:delete(Table, Key), - none - end - end, none, Table). - gc_entity(Table, GbSet) -> ets:foldl(fun({{_, Id} = Key, _}, none) -> gc_entity(Id, Table, Key, GbSet); |
