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 | ef2ab5274618b3750479875b927be218b0d8bda4 (patch) | |
tree | 67e615e338e25a59ab176a0259b17a4da6d248fd /src/file_handle_cache.erl | |
parent | 5b55bf19ff24fcc24c31efa04d3590b67059c294 (diff) | |
download | rabbitmq-server-ef2ab5274618b3750479875b927be218b0d8bda4.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/file_handle_cache.erl')
-rw-r--r-- | src/file_handle_cache.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl index 66114732..3ef12375 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}). %%---------------------------------------------------------------------------- |