fix(watermark): hight watermark should greater than low watermark.
This commit is contained in:
parent
570bc5023b
commit
579905b92a
|
@ -2388,12 +2388,20 @@ end}.
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{translation, "emqx.os_mon", fun(Conf) ->
|
{translation, "emqx.os_mon", fun(Conf) ->
|
||||||
[{cpu_check_interval, cuttlefish:conf_get("os_mon.cpu_check_interval", Conf)},
|
CpuHw = cuttlefish:conf_get("os_mon.cpu_high_watermark", Conf) * 100,
|
||||||
{cpu_high_watermark, cuttlefish:conf_get("os_mon.cpu_high_watermark", Conf) * 100},
|
CpuLw = cuttlefish:conf_get("os_mon.cpu_low_watermark", Conf) * 100,
|
||||||
{cpu_low_watermark, cuttlefish:conf_get("os_mon.cpu_low_watermark", Conf) * 100},
|
case CpuHw > CpuLw of
|
||||||
{mem_check_interval, cuttlefish:conf_get("os_mon.mem_check_interval", Conf)},
|
true ->
|
||||||
{sysmem_high_watermark, cuttlefish:conf_get("os_mon.sysmem_high_watermark", Conf) * 100},
|
[{cpu_check_interval, cuttlefish:conf_get("os_mon.cpu_check_interval", Conf)},
|
||||||
{procmem_high_watermark, cuttlefish:conf_get("os_mon.procmem_high_watermark", Conf) * 100}]
|
{cpu_high_watermark, CpuHw},
|
||||||
|
{cpu_low_watermark, CpuLw},
|
||||||
|
{mem_check_interval, cuttlefish:conf_get("os_mon.mem_check_interval", Conf)},
|
||||||
|
{sysmem_high_watermark, cuttlefish:conf_get("os_mon.sysmem_high_watermark", Conf) * 100},
|
||||||
|
{procmem_high_watermark, cuttlefish:conf_get("os_mon.procmem_high_watermark", Conf) * 100}];
|
||||||
|
false ->
|
||||||
|
Msg = io_lib:format("high(~w)_must_greater_than_low(~w)", [CpuHw, CpuLw]),
|
||||||
|
error(lists:flatten(Msg))
|
||||||
|
end
|
||||||
end}.
|
end}.
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
@ -2415,9 +2423,17 @@ end}.
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{translation, "emqx.vm_mon", fun(Conf) ->
|
{translation, "emqx.vm_mon", fun(Conf) ->
|
||||||
[{check_interval, cuttlefish:conf_get("vm_mon.check_interval", Conf)},
|
Hw = cuttlefish:conf_get("vm_mon.process_high_watermark", Conf) * 100,
|
||||||
{process_high_watermark, cuttlefish:conf_get("vm_mon.process_high_watermark", Conf) * 100},
|
Lw = cuttlefish:conf_get("vm_mon.process_low_watermark", Conf) * 100,
|
||||||
{process_low_watermark, cuttlefish:conf_get("vm_mon.process_low_watermark", Conf) * 100}]
|
case Hw > Lw of
|
||||||
|
true ->
|
||||||
|
[{check_interval, cuttlefish:conf_get("vm_mon.check_interval", Conf)},
|
||||||
|
{process_high_watermark, Hw},
|
||||||
|
{process_low_watermark, Lw}];
|
||||||
|
false ->
|
||||||
|
Msg = io_lib:format("high(~w)_must_greater_than_low(~w)", [Hw, Lw]),
|
||||||
|
error(lists:flatten(Msg))
|
||||||
|
end
|
||||||
end}.
|
end}.
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue