Skip to content

Commit

Permalink
Remove sockets_used/total from HTTP API
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoguin committed Jun 17, 2024
1 parent ed0bb18 commit 75684a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
17 changes: 6 additions & 11 deletions deps/rabbitmq_management/src/rabbit_mgmt_stats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,13 @@ format_rate(Type, {TR, TU, TM}, {RR, RU, RM}) when Type =:= queue_msg_stats;
{messages, TM},
{messages_details, [{rate, RM}]}
];
format_rate(node_coarse_stats, {TF, TS, TM, TD, TP, TGC, TGCW, TCS},
{RF, RS, RM, RD, RP, RGC, RGCW, RCS}) ->
format_rate(node_coarse_stats, {TF, _TS, TM, TD, TP, TGC, TGCW, TCS},
{RF, _RS, RM, RD, RP, RGC, RGCW, RCS}) ->
[
{mem_used, TM},
{mem_used_details, [{rate, RM}]},
{fd_used, TF},
{fd_used_details, [{rate, RF}]},
{sockets_used, TS},
{sockets_used_details, [{rate, RS}]},
{proc_used, TP},
{proc_used_details, [{rate, RP}]},
{disk_free, TD},
Expand Down Expand Up @@ -476,20 +474,17 @@ format_rate(Type, {TR, TU, TM}, {RR, RU, RM}, {SR, SU, SM}, {STR, STU, STM},
{messages_details, [{rate, RM},
{samples, SM}] ++ average(SM, STM, Length)}
];
format_rate(node_coarse_stats, {TF, TS, TM, TD, TP, TGC, TGCW, TCS},
{RF, RS, RM, RD, RP, RGC, RGCW, RCS},
{SF, SS, SM, SD, SP, SGC, SGCW, SCS},
{STF, STS, STM, STD, STP, STGC, STGCW, STCS}, Length) ->
format_rate(node_coarse_stats, {TF, _TS, TM, TD, TP, TGC, TGCW, TCS},
{RF, _RS, RM, RD, RP, RGC, RGCW, RCS},
{SF, _SS, SM, SD, SP, SGC, SGCW, SCS},
{STF, _STS, STM, STD, STP, STGC, STGCW, STCS}, Length) ->
[
{mem_used, TM},
{mem_used_details, [{rate, RM},
{samples, SM}] ++ average(SM, STM, Length)},
{fd_used, TF},
{fd_used_details, [{rate, RF},
{samples, SF}] ++ average(SF, STF, Length)},
{sockets_used, TS},
{sockets_used_details, [{rate, RS},
{samples, SS}] ++ average(SS, STS, Length)},
{proc_used, TP},
{proc_used_details, [{rate, RP},
{samples, SP}] ++ average(SP, STP, Length)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

-export([list_registry_plugins/1]).

-define(METRICS_KEYS, [fd_used, sockets_used, mem_used, disk_free, proc_used, gc_num,
-define(METRICS_KEYS, [fd_used, mem_used, disk_free, proc_used, gc_num,
gc_bytes_reclaimed, context_switches]).

-define(PERSISTER_KEYS, [persister_stats]).

-define(OTHER_KEYS, [name, partitions, os_pid, fd_total, sockets_total, mem_limit,
-define(OTHER_KEYS, [name, partitions, os_pid, fd_total, mem_limit,
mem_alarm, disk_free_limit, disk_free_alarm, proc_total,
rates_mode, uptime, run_queue, processors, exchange_types,
auth_mechanisms, applications, contexts, log_files,
Expand Down Expand Up @@ -195,11 +195,6 @@ i(fd_used, State) ->
get_used_fd(State);
i(fd_total, #state{fd_total = FdTotal}=State) ->
{State, FdTotal};
%% sockets_used and sockets_total are unused since RabbitMQ 4.0.
i(sockets_used, State) ->
{State, 0};
i(sockets_total, State) ->
{State, 0};
i(os_pid, State) ->
{State, rabbit_data_coercion:to_utf8_binary(os:getpid())};
i(mem_used, State) ->
Expand Down

0 comments on commit 75684a3

Please sign in to comment.