summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_management_agent
diff options
context:
space:
mode:
authorArnaud Cogoluègnes <acogoluegnes@gmail.com>2019-01-18 15:47:55 +0100
committerArnaud Cogoluègnes <acogoluegnes@gmail.com>2019-01-18 15:47:55 +0100
commit55843136d1bfa185b5ea1096610fbe600273225a (patch)
treee855ee16f8a4423b2976a770b7c5c4aa523824df /deps/rabbitmq_management_agent
parentabc1774d3df78ad0344ea05ce97739e0be895e44 (diff)
downloadrabbitmq-server-git-55843136d1bfa185b5ea1096610fbe600273225a.tar.gz
Update active consumer flag
Can be updated to true or false. [#163298456] References rabbitmq/rabbitmq-server#1838
Diffstat (limited to 'deps/rabbitmq_management_agent')
-rw-r--r--deps/rabbitmq_management_agent/src/rabbit_mgmt_metrics_collector.erl13
1 files changed, 6 insertions, 7 deletions
diff --git a/deps/rabbitmq_management_agent/src/rabbit_mgmt_metrics_collector.erl b/deps/rabbitmq_management_agent/src/rabbit_mgmt_metrics_collector.erl
index b21eb6e54a..ecf68351de 100644
--- a/deps/rabbitmq_management_agent/src/rabbit_mgmt_metrics_collector.erl
+++ b/deps/rabbitmq_management_agent/src/rabbit_mgmt_metrics_collector.erl
@@ -403,7 +403,7 @@ aggregate_entry({Id, Reductions}, NextStats, Ops0,
Ops = insert_entry_ops(channel_process_stats, Id, false,
Entry, Ops0, BPolicies),
{NextStats, Ops, State};
-aggregate_entry({Id, Exclusive, AckRequired, PrefetchCount, SingleActive, Args},
+aggregate_entry({Id, Exclusive, AckRequired, PrefetchCount, Active, Args},
NextStats, Ops0,
#state{table = consumer_created} = State) ->
case ets:lookup(consumer_stats, Id) of
@@ -411,20 +411,19 @@ aggregate_entry({Id, Exclusive, AckRequired, PrefetchCount, SingleActive, Args},
Fmt = rabbit_mgmt_format:format([{exclusive, Exclusive},
{ack_required, AckRequired},
{prefetch_count, PrefetchCount},
- {single_active, SingleActive},
+ {active, Active},
{arguments, Args}], {[], false}),
Entry = ?consumer_stats(Id, Fmt),
Ops = insert_with_index_op(consumer_stats, Id, Entry, Ops0),
{NextStats, Ops , State};
[{_K, V}] ->
- % consumer updated only when promoted to single active consumer
- CurrentSingleActive = proplists:get_value(single_active, V, undefined),
- case {SingleActive, CurrentSingleActive} of
- {true, false} ->
+ CurrentActive = proplists:get_value(active, V, undefined),
+ case Active =:= CurrentActive of
+ false ->
Fmt = rabbit_mgmt_format:format([{exclusive, Exclusive},
{ack_required, AckRequired},
{prefetch_count, PrefetchCount},
- {single_active, SingleActive},
+ {active, Active},
{arguments, Args}], {[], false}),
Entry = ?consumer_stats(Id, Fmt),
Ops = insert_with_index_op(consumer_stats, Id, Entry, Ops0),