diff options
Diffstat (limited to 'priv')
| -rw-r--r-- | priv/schema/rabbit.schema | 121 |
1 files changed, 89 insertions, 32 deletions
diff --git a/priv/schema/rabbit.schema b/priv/schema/rabbit.schema index 570c335ee4..9bccb9a89e 100644 --- a/priv/schema/rabbit.schema +++ b/priv/schema/rabbit.schema @@ -1363,95 +1363,152 @@ end}. %% that are overly busy. Processes with large heaps or that take a %% long time to garbage collect will count toward this threshold. {mapping, "sysmon_handler.thresholds.busy_processes", "sysmon_handler.process_limit", [ - {default, 30}, - {datatype, integer}, - hidden + {datatype, integer}, + hidden ]}. +{translation, "sysmon_handler.process_limit", + fun(Conf) -> + case cuttlefish:conf_get("sysmon_handler.thresholds.busy_processes", Conf, undefined) of + undefined -> + cuttlefish:unset(); + Int when is_integer(Int) -> + Int; + _ -> + cuttlefish:invalid("should be a non-negative integer") + end + end +}. + %% @doc The threshold at which to warn about the number of ports that %% are overly busy. Ports with full input buffers count toward this %% threshold. {mapping, "sysmon_handler.thresholds.busy_ports", "sysmon_handler.port_limit", [ - {default, 2}, {datatype, integer}, hidden ]}. +{translation, "sysmon_handler.port_limit", + fun(Conf) -> + case cuttlefish:conf_get("sysmon_handler.thresholds.busy_ports", Conf, undefined) of + undefined -> + cuttlefish:unset(); + Int when is_integer(Int) -> + Int; + _ -> + cuttlefish:invalid("should be a non-negative integer") + end + end +}. + %% @doc A process will become busy when it exceeds this amount of time %% doing garbage collection. -%% -%% NOTE: Enabling this setting can cause performance problems on -%% multi-core systems. %% @see sysmon_handler.thresholds.busy_processes {mapping, "sysmon_handler.triggers.process.garbage_collection", "sysmon_handler.gc_ms_limit", [ - {default, off}, {datatype, [{atom, off}, {duration, ms}]}, hidden ]}. {translation, "sysmon_handler.gc_ms_limit", - fun(Conf) -> - case cuttlefish:conf_get("sysmon_handler.triggers.process.garbage_collection", Conf) of - off -> 0; - Int -> Int - end - end}. + fun(Conf) -> + case cuttlefish:conf_get("sysmon_handler.triggers.process.garbage_collection", Conf, undefined) of + undefined -> + cuttlefish:unset(); + off -> + 0; + Int when is_integer(Int) -> + Int; + _ -> + cuttlefish:invalid("should be a non-negative integer") + end + end +}. %% @doc A process will become busy when it exceeds this amount of time %% during a single process scheduling & execution cycle. {mapping, "sysmon_handler.triggers.process.long_scheduled_execution", "sysmon_handler.schedule_ms_limit", [ - {default, off}, {datatype, [{atom, off}, {duration, ms}]}, hidden ]}. {translation, "sysmon_handler.schedule_ms_limit", - fun(Conf) -> - case cuttlefish:conf_get("sysmon_handler.triggers.process.long_scheduled_execution", Conf) of - off -> 0; - Int -> Int - end - end}. + fun(Conf) -> + case cuttlefish:conf_get("sysmon_handler.triggers.process.long_scheduled_execution", Conf, undefined) of + undefined -> + cuttlefish:unset(); + off -> + 0; + Int when is_integer(Int) -> + Int; + _ -> + cuttlefish:invalid("should be a non-negative integer") + end + end +}. %% @doc A process will become busy when its heap exceeds this size. %% @see sysmon_handler.thresholds.busy_processes {mapping, "sysmon_handler.triggers.process.heap_size", "sysmon_handler.heap_word_limit", [ - {default, "160444000"}, - {datatype, [bytesize, {atom, off}]}, + {datatype, [{atom, off}, + bytesize]}, hidden ]}. {translation, "sysmon_handler.heap_word_limit", - fun(Conf) -> - case cuttlefish:conf_get("sysmon_handler.triggers.process.heap_size", Conf) of - off -> 0; - Bytes -> - WordSize = erlang:system_info(wordsize), - Bytes div WordSize + fun(Conf) -> + case cuttlefish:conf_get("sysmon_handler.triggers.process.heap_size", Conf, undefined) of + undefined -> + cuttlefish:unset(); + off -> + 0; + Bytes when is_integer(Bytes) -> + WordSize = erlang:system_info(wordsize), + Bytes div WordSize; + _ -> + cuttlefish:invalid("should be a non-negative integer") + end end -end}. +}. %% @doc Whether ports with full input buffers will be counted as %% busy. Ports can represent open files or network sockets. %% @see sysmon_handler.thresholds.busy_ports {mapping, "sysmon_handler.triggers.port", "sysmon_handler.busy_port", [ - {default, on}, {datatype, flag}, hidden ]}. +{translation, "sysmon_handler.busy_port", + fun(Conf) -> + case cuttlefish:conf_get("sysmon_handler.triggers.port", Conf, undefined) of + undefined -> + cuttlefish:unset(); + Val -> Val + end + end +}. + %% @doc Whether distribution ports with full input buffers will be %% counted as busy. Distribution ports connect Erlang nodes within a %% single cluster. %% @see sysmon_handler.thresholds.busy_ports {mapping, "sysmon_handler.triggers.distribution_port", "sysmon_handler.busy_dist_port", [ - {default, on}, {datatype, flag}, hidden ]}. +{translation, "sysmon_handler.busy_dist_port", + fun(Conf) -> + case cuttlefish:conf_get("sysmon_handler.triggers.distribution_port", Conf, undefined) of + undefined -> + cuttlefish:unset(); + Val -> Val + end + end +}. + % =============================== % Validators % =============================== |
