diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-01-10 12:26:31 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-01-10 12:26:31 +0000 |
| commit | 48213ca5e9255a0e98f016e9ef48f0d886ff0bfb (patch) | |
| tree | 67e615e338e25a59ab176a0259b17a4da6d248fd /src | |
| parent | 68e7bdb6e79effb12a5ac1a987ca0c0738c69ba5 (diff) | |
| download | rabbitmq-server-git-48213ca5e9255a0e98f016e9ef48f0d886ff0bfb.tar.gz | |
include fd info in rabbit:status()
There is a slight layer violation here - we label the info items with
'socket...', which is correct in the rabbit context but really could
be any fd in other contexts. Note though that we already mentioned
sockets in the log message produced on startup.
Diffstat (limited to 'src')
| -rw-r--r-- | src/file_handle_cache.erl | 8 | ||||
| -rw-r--r-- | src/rabbit.erl | 24 |
2 files changed, 18 insertions, 14 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl index 66114732db..3ef12375d1 100644 --- a/src/file_handle_cache.erl +++ b/src/file_handle_cache.erl @@ -261,7 +261,7 @@ -endif. %%---------------------------------------------------------------------------- --define(INFO_KEYS, [obtain_count, obtain_limit]). +-define(INFO_KEYS, [count, limit, socket_count, socket_limit]). %%---------------------------------------------------------------------------- %% Public API @@ -789,8 +789,10 @@ write_buffer(Handle = #handle { hdl = Hdl, offset = Offset, infos(Items, State) -> [{Item, i(Item, State)} || Item <- Items]. -i(obtain_count, #fhc_state{obtain_count = Count}) -> Count; -i(obtain_limit, #fhc_state{obtain_limit = Limit}) -> Limit; +i(count, #fhc_state{open_count = C1, obtain_count = C2}) -> C1 + C2; +i(limit, #fhc_state{limit = Limit}) -> Limit; +i(socket_count, #fhc_state{obtain_count = Count}) -> Count; +i(socket_limit, #fhc_state{obtain_limit = Limit}) -> Limit; i(Item, _) -> throw({bad_argument, Item}). %%---------------------------------------------------------------------------- diff --git a/src/rabbit.erl b/src/rabbit.erl index 0a2681a219..114e62e3ae 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -308,17 +308,19 @@ stop_and_halt() -> ok. status() -> - [{pid, list_to_integer(os:getpid())}, - {running_applications, application:which_applications(infinity)}, - {os, os:type()}, - {erlang_version, erlang:system_info(system_version)}, - {memory, erlang:memory()}] ++ - rabbit_misc:filter_exit_map( - fun ({Key, {M, F, A}}) -> {Key, erlang:apply(M, F, A)} end, - [{vm_memory_high_watermark, {vm_memory_monitor, - get_vm_memory_high_watermark, []}}, - {vm_memory_limit, {vm_memory_monitor, - get_memory_limit, []}}]). + S1 = [{pid, list_to_integer(os:getpid())}, + {running_applications, application:which_applications(infinity)}, + {os, os:type()}, + {erlang_version, erlang:system_info(system_version)}, + {memory, erlang:memory()}], + S2 = rabbit_misc:filter_exit_map( + fun ({Key, {M, F, A}}) -> {Key, erlang:apply(M, F, A)} end, + [{vm_memory_high_watermark, {vm_memory_monitor, + get_vm_memory_high_watermark, []}}, + {vm_memory_limit, {vm_memory_monitor, + get_memory_limit, []}}]), + S3 = [{file_descriptors, file_handle_cache:info()}], + S1 ++ S2 ++ S3. is_running() -> is_running(node()). |
