From 33c35915cab3006aa6347f6ec9c1aac1156f9a0d Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Fri, 22 Jan 2021 09:23:20 +0100 Subject: [PATCH] refactor(emqx_vm): make elvis happy --- src/emqx_vm.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emqx_vm.erl b/src/emqx_vm.erl index 953171d68..e1ab29b8b 100644 --- a/src/emqx_vm.erl +++ b/src/emqx_vm.erl @@ -180,7 +180,7 @@ get_system_info(Key) -> format_system_info(allocated_areas, List) -> [convert_allocated_areas(Value) || Value <- List]; -format_system_info(allocator, {_,_,_,List}) -> +format_system_info(allocator, {_, _, _, List}) -> List; format_system_info(dist_ctrl, List) -> lists:map(fun({Node, Socket}) -> @@ -230,7 +230,7 @@ scheduler_usage(Interval) when is_integer(Interval) -> scheduler_usage_diff(First, Last). scheduler_usage_diff(First, Last) -> - lists:map(fun({{I, A0, T0},{I, A1, T1}}) -> + lists:map(fun({{I, A0, T0}, {I, A1, T1}}) -> {I, (A1 - A0)/(T1 - T0)} end, lists:zip(lists:sort(First), lists:sort(Last))). @@ -280,7 +280,7 @@ alloc(Type) -> allocators() -> UtilAllocators = erlang:system_info(alloc_util_allocators), Allocators = [sys_alloc, mseg_alloc|UtilAllocators], - [{{A, N},lists:sort(proplists:delete(versions, Props))} || + [{{A, N}, lists:sort(proplists:delete(versions, Props))} || A <- Allocators, Allocs <- [erlang:system_info({allocator, A})], Allocs =/= false, {_, N, Props} <- Allocs].