fix(emqx_mgmt): show used and total ram from lc

This commit is contained in:
Zaiming (Stone) Shi 2022-05-27 11:35:07 +02:00
parent 7b9a600c20
commit eacd3847ed
4 changed files with 6 additions and 6 deletions

View File

@ -22,7 +22,7 @@
%% This rebar.config is necessary because the app may be used as a %% This rebar.config is necessary because the app may be used as a
%% `git_subdir` dependency in other projects. %% `git_subdir` dependency in other projects.
{deps, [ {deps, [
{lc, {git, "https://github.com/emqx/lc.git", {tag, "0.3.0"}}}, {lc, {git, "https://github.com/emqx/lc.git", {tag, "0.3.1"}}},
{gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}}, {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}},
{jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}, {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}},
{cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.0"}}}, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.0"}}},

View File

@ -121,14 +121,14 @@ list_nodes() ->
lookup_node(Node) -> node_info(Node). lookup_node(Node) -> node_info(Node).
node_info() -> node_info() ->
Memory = emqx_vm:get_memory(), {UsedRatio, Total} = load_ctl:get_sys_memory(),
Info = maps:from_list([{K, list_to_binary(V)} || {K, V} <- emqx_vm:loads()]), Info = maps:from_list([{K, list_to_binary(V)} || {K, V} <- emqx_vm:loads()]),
BrokerInfo = emqx_sys:info(), BrokerInfo = emqx_sys:info(),
Info#{ Info#{
node => node(), node => node(),
otp_release => otp_rel(), otp_release => otp_rel(),
memory_total => proplists:get_value(allocated, Memory), memory_total => Total,
memory_used => proplists:get_value(used, Memory), memory_used => erlang:round(Total * UsedRatio),
process_available => erlang:system_info(process_limit), process_available => erlang:system_info(process_limit),
process_used => erlang:system_info(process_count), process_used => erlang:system_info(process_count),

View File

@ -44,7 +44,7 @@ defmodule EMQXUmbrella.MixProject do
# we need several overrides here because dependencies specify # we need several overrides here because dependencies specify
# other exact versions, and not ranges. # other exact versions, and not ranges.
[ [
{:lc, github: "emqx/lc", tag: "0.3.0"}, {:lc, github: "emqx/lc", tag: "0.3.1"},
{:redbug, "2.0.7"}, {:redbug, "2.0.7"},
{:typerefl, github: "ieQu1/typerefl", tag: "0.9.1", override: true}, {:typerefl, github: "ieQu1/typerefl", tag: "0.9.1", override: true},
{:ehttpc, github: "emqx/ehttpc", tag: "0.2.0"}, {:ehttpc, github: "emqx/ehttpc", tag: "0.2.0"},

View File

@ -44,7 +44,7 @@
{post_hooks,[]}. {post_hooks,[]}.
{deps, {deps,
[ {lc, {git, "https://github.com/emqx/lc.git", {tag, "0.3.0"}}} [ {lc, {git, "https://github.com/emqx/lc.git", {tag, "0.3.1"}}}
, {redbug, "2.0.7"} , {redbug, "2.0.7"}
, {gpb, "4.11.2"} %% gpb only used to build, but not for release, pin it here to avoid fetching a wrong version due to rebar plugins scattered in all the deps , {gpb, "4.11.2"} %% gpb only used to build, but not for release, pin it here to avoid fetching a wrong version due to rebar plugins scattered in all the deps
, {typerefl, {git, "https://github.com/ieQu1/typerefl", {tag, "0.9.1"}}} , {typerefl, {git, "https://github.com/ieQu1/typerefl", {tag, "0.9.1"}}}