Skip to content

Commit

Permalink
Merge pull request emqx#6923 from k32/sysmon3
Browse files Browse the repository at this point in the history
feat(system_monitor): Bump version to 3.0.0
  • Loading branch information
k32 authored Feb 7, 2022
2 parents e4b14a3 + f699de9 commit 342eed9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/emqx/src/emqx_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ fields("sysmon_top") ->
, {"max_procs",
sc(non_neg_integer(),
#{ mapping => "system_monitor.top_max_procs"
, default => 3000000
, default => 1_000_000
, desc => "Stop collecting data when the number of processes
in the VM exceeds this value"
})
Expand Down
14 changes: 14 additions & 0 deletions apps/emqx_machine/src/emqx_machine.erl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
-export([ start/0
, graceful_shutdown/0
, is_ready/0

, node_status/0
, update_vips/0
]).

-include_lib("emqx/include/logger.hrl").
Expand Down Expand Up @@ -57,6 +60,9 @@ print_otp_version_warning() ->
-endif. % OTP_RELEASE > 22

start_sysmon() ->
_ = application:load(system_monitor),
application:set_env(system_monitor, node_status_fun, {?MODULE, node_status}),
application:set_env(system_monitor, status_checks, [{?MODULE, update_vips, false, 10}]),
case application:get_env(system_monitor, db_hostname) of
undefined ->
%% If there is no sink for the events, there is no reason
Expand All @@ -67,3 +73,11 @@ start_sysmon() ->
_ = application:ensure_all_started(system_monitor, temporary),
ok
end.

node_status() ->
emqx_json:encode(#{ backend => mria_rlog:backend()
, role => mria_rlog:role()
}).

update_vips() ->
system_monitor:add_vip(mria_status:shards_up()).
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ defmodule EMQXUmbrella.MixProject do
{:emqtt, github: "emqx/emqtt", tag: "1.4.3", override: true},
{:rulesql, github: "emqx/rulesql", tag: "0.1.4"},
{:observer_cli, "1.7.1"},
{:system_monitor, github: "k32/system_monitor", tag: "2.2.1"},
{:system_monitor, github: "k32/system_monitor", tag: "3.0.0"},
# in conflict by emqtt and hocon
{:getopt, "1.0.2", override: true},
{:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "0.16.0", override: true},
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
, {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.4.3"}}}
, {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.4"}}}
, {observer_cli, "1.7.1"} % NOTE: depends on recon 2.5.x
, {system_monitor, {git, "https://github.com/k32/system_monitor", {tag, "2.2.1"}}}
, {system_monitor, {git, "https://github.com/k32/system_monitor", {tag, "3.0.0"}}}
, {getopt, "1.0.2"}
, {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.16.0"}}}
, {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.24.0"}}}
Expand Down

0 comments on commit 342eed9

Please sign in to comment.