Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit 92a9c75

Browse files
dcorbachokjnilsson
authored andcommitted
Collect ra io stats
[#157193081]
1 parent 2565680 commit 92a9c75

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/rabbit_mgmt_external_stats.erl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ format_mochiweb_option(_K, V) ->
340340
init([]) ->
341341
{ok, Interval} = application:get_env(rabbit, collect_statistics_interval),
342342
State = #state{fd_total = file_handle_cache:ulimit(),
343-
fhc_stats = file_handle_cache_stats:get(),
343+
fhc_stats = get_fhc_stats(),
344344
node_owners = sets:new(),
345345
interval = Interval},
346346
%% We can update stats straight away as they need to be available
@@ -395,5 +395,13 @@ emit_node_node_stats(State = #state{node_owners = Owners}) ->
395395
update_state(State0) ->
396396
%% Store raw data, the average operation time is calculated during querying
397397
%% from the accumulated total
398-
FHC = file_handle_cache_stats:get(),
398+
FHC = get_fhc_stats(),
399399
State0#state{fhc_stats = FHC}.
400+
401+
get_fhc_stats() ->
402+
dict:to_list(dict:merge(fun(_, V1, V2) -> V1 + V2 end,
403+
dict:from_list(file_handle_cache_stats:get()),
404+
dict:from_list(get_ra_io_metrics()))).
405+
406+
get_ra_io_metrics() ->
407+
lists:sort(ets:tab2list(ra_io_metrics)).

0 commit comments

Comments
 (0)