@@ -1355,6 +1355,103 @@ end}.
1355
1355
{validators, ["non_zero_positive_integer"]}
1356
1356
]}.
1357
1357
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
+
1358
1455
% ===============================
1359
1456
% Validators
1360
1457
% ===============================
0 commit comments