Rename 'mailbox_len' to 'message_queue_len'

This commit is contained in:
Feng Lee 2019-09-27 20:26:54 +08:00
parent 89b03eb9a6
commit 7b1a80c265
1 changed files with 10 additions and 8 deletions

View File

@ -116,17 +116,19 @@ cancel_timer(_) -> ok.
proc_name(Mod, Id) -> proc_name(Mod, Id) ->
list_to_atom(lists:concat([Mod, "_", Id])). list_to_atom(lists:concat([Mod, "_", Id])).
-spec(proc_stats() -> list()). %% Get Proc's Stats.
proc_stats() -> -spec(proc_stats() -> emqx_types:stats()).
proc_stats(self()). proc_stats() -> proc_stats(self()).
-spec(proc_stats(pid()) -> list()). -spec(proc_stats(pid()) -> emqx_types:stats()).
proc_stats(Pid) -> proc_stats(Pid) ->
case process_info(Pid, [message_queue_len, heap_size, case process_info(Pid, [message_queue_len,
total_heap_size, reductions, memory]) of heap_size,
total_heap_size,
reductions,
memory]) of
undefined -> []; undefined -> [];
[{message_queue_len, Len}|Stats] -> ProcStats -> ProcStats
[{mailbox_len, Len}|Stats]
end. end.
%% @doc Drain delivers from the channel's mailbox. %% @doc Drain delivers from the channel's mailbox.