Skip to content

Commit d3eed6a

Browse files
committed
Use hex.pm package for sysmon_handler, copy schema into rabbit.schema
1 parent 9f3ace8 commit d3eed6a

File tree

2 files changed

+98
-1
lines changed

2 files changed

+98
-1
lines changed

priv/schema/rabbit.schema

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,103 @@ end}.
13551355
{validators, ["non_zero_positive_integer"]}
13561356
]}.
13571357

1358+
% ==========================
1359+
% sysmon_handler section
1360+
% ==========================
1361+
1362+
%% @doc The threshold at which to warn about the number of processes
1363+
%% that are overly busy. Processes with large heaps or that take a
1364+
%% long time to garbage collect will count toward this threshold.
1365+
{mapping, "sysmon_handler.thresholds.busy_processes", "sysmon_handler.process_limit", [
1366+
{default, 30},
1367+
{datatype, integer},
1368+
hidden
1369+
]}.
1370+
1371+
%% @doc The threshold at which to warn about the number of ports that
1372+
%% are overly busy. Ports with full input buffers count toward this
1373+
%% threshold.
1374+
{mapping, "sysmon_handler.thresholds.busy_ports", "sysmon_handler.port_limit", [
1375+
{default, 2},
1376+
{datatype, integer},
1377+
hidden
1378+
]}.
1379+
1380+
%% @doc A process will become busy when it exceeds this amount of time
1381+
%% doing garbage collection.
1382+
%%
1383+
%% NOTE: Enabling this setting can cause performance problems on
1384+
%% multi-core systems.
1385+
%% @see sysmon_handler.thresholds.busy_processes
1386+
{mapping, "sysmon_handler.triggers.process.garbage_collection", "sysmon_handler.gc_ms_limit", [
1387+
{default, off},
1388+
{datatype, [{atom, off},
1389+
{duration, ms}]},
1390+
hidden
1391+
]}.
1392+
1393+
{translation, "sysmon_handler.gc_ms_limit",
1394+
fun(Conf) ->
1395+
case cuttlefish:conf_get("sysmon_handler.triggers.process.garbage_collection", Conf) of
1396+
off -> 0;
1397+
Int -> Int
1398+
end
1399+
end}.
1400+
1401+
%% @doc A process will become busy when it exceeds this amount of time
1402+
%% during a single process scheduling & execution cycle.
1403+
{mapping, "sysmon_handler.triggers.process.long_scheduled_execution", "sysmon_handler.schedule_ms_limit", [
1404+
{default, off},
1405+
{datatype, [{atom, off},
1406+
{duration, ms}]},
1407+
hidden
1408+
]}.
1409+
1410+
{translation, "sysmon_handler.schedule_ms_limit",
1411+
fun(Conf) ->
1412+
case cuttlefish:conf_get("sysmon_handler.triggers.process.long_scheduled_execution", Conf) of
1413+
off -> 0;
1414+
Int -> Int
1415+
end
1416+
end}.
1417+
1418+
%% @doc A process will become busy when its heap exceeds this size.
1419+
%% @see sysmon_handler.thresholds.busy_processes
1420+
{mapping, "sysmon_handler.triggers.process.heap_size", "sysmon_handler.heap_word_limit", [
1421+
{default, "160444000"},
1422+
{datatype, [bytesize, {atom, off}]},
1423+
hidden
1424+
]}.
1425+
1426+
{translation, "sysmon_handler.heap_word_limit",
1427+
fun(Conf) ->
1428+
case cuttlefish:conf_get("sysmon_handler.triggers.process.heap_size", Conf) of
1429+
off -> 0;
1430+
Bytes ->
1431+
WordSize = erlang:system_info(wordsize),
1432+
Bytes div WordSize
1433+
end
1434+
end}.
1435+
1436+
%% @doc Whether ports with full input buffers will be counted as
1437+
%% busy. Ports can represent open files or network sockets.
1438+
%% @see sysmon_handler.thresholds.busy_ports
1439+
{mapping, "sysmon_handler.triggers.port", "sysmon_handler.busy_port", [
1440+
{default, on},
1441+
{datatype, flag},
1442+
hidden
1443+
]}.
1444+
1445+
%% @doc Whether distribution ports with full input buffers will be
1446+
%% counted as busy. Distribution ports connect Erlang nodes within a
1447+
%% single cluster.
1448+
%% @see sysmon_handler.thresholds.busy_ports
1449+
{mapping, "sysmon_handler.triggers.distribution_port", "sysmon_handler.busy_dist_port", [
1450+
{default, on},
1451+
{datatype, flag},
1452+
hidden
1453+
]}.
1454+
13581455
% ===============================
13591456
% Validators
13601457
% ===============================

rabbitmq-components.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ dep_cowlib = hex 2.7.0
113113
dep_jsx = hex 2.9.0
114114
dep_lager = hex 3.6.5
115115
dep_ra = git https://github.com/rabbitmq/ra.git master
116-
dep_sysmon_handler = git https://github.com/rabbitmq/sysmon-handler.git master
117116
dep_ranch = hex 1.7.1
118117
dep_recon = hex 2.3.6
118+
dep_sysmon_handler = hex 1.0.0
119119

120120
RABBITMQ_COMPONENTS = amqp_client \
121121
amqp10_common \

0 commit comments

Comments
 (0)