Skip to content

Commit 085d220

Browse files
committed
Restore FD info in rabbitmqctl status
The FD limits are still valuable. The FD used will still show some information during CQv1 upgrade to v2 so it is kept for now. But in the future it will have to be reworked to query the system, or be removed.
1 parent 32a4c54 commit 085d220

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Diff for: deps/rabbit/src/rabbit.erl

+4-1
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,9 @@ status() ->
751751
get_disk_free_limit, []}},
752752
{disk_free, {rabbit_disk_monitor,
753753
get_disk_free, []}}]),
754+
S3 = rabbit_misc:with_exit_handler(
755+
fun () -> [] end,
756+
fun () -> [{file_descriptors, file_handle_cache:info()}] end),
754757
S4 = [{processes, [{limit, erlang:system_info(process_limit)},
755758
{used, erlang:system_info(process_count)}]},
756759
{run_queue, erlang:statistics(run_queue)},
@@ -785,7 +788,7 @@ status() ->
785788
(_) -> false
786789
end,
787790
maps:to_list(product_info())),
788-
S1 ++ S2 ++ S4 ++ S5 ++ S6 ++ S7 ++ S8.
791+
S1 ++ S2 ++ S3 ++ S4 ++ S5 ++ S6 ++ S7 ++ S8.
789792

790793
alarms() ->
791794
Alarms = rabbit_misc:with_exit_handler(rabbit_misc:const([]),

Diff for: deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/status_command.ex

+7-1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ defmodule RabbitMQ.CLI.Ctl.Commands.StatusCommand do
164164
"#{category}: #{IU.convert(val[:bytes], unit)} #{unit} (#{val[:percentage]} %)"
165165
end)
166166

167+
file_descriptors = [
168+
"\n#{bright("File Descriptors")}\n",
169+
"Total: #{m[:file_descriptors][:total_used]}, limit: #{m[:file_descriptors][:total_limit]}"
170+
]
171+
167172
disk_space_section = [
168173
"\n#{bright("Free Disk Space")}\n",
169174
"Low free disk space watermark: #{IU.convert(m[:disk_free_limit], unit)} #{unit}",
@@ -194,7 +199,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.StatusCommand do
194199
log_section ++
195200
alarms_section ++
196201
memory_section ++
197-
disk_space_section ++ totals_section ++ listeners_section
202+
file_descriptors ++ disk_space_section ++ totals_section ++ listeners_section
198203

199204
{:ok, Enum.join(lines, line_separator())}
200205
end
@@ -258,6 +263,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.StatusCommand do
258263
vm_memory_high_watermark_limit: Keyword.get(result, :vm_memory_limit),
259264
disk_free_limit: Keyword.get(result, :disk_free_limit),
260265
disk_free: Keyword.get(result, :disk_free),
266+
file_descriptors: Enum.into(Keyword.get(result, :file_descriptors), %{}),
261267
alarms: Keyword.get(result, :alarms),
262268
listeners: listener_maps(Keyword.get(result, :listeners, [])),
263269
memory: Keyword.get(result, :memory) |> Enum.into(%{}),

0 commit comments

Comments
 (0)