|
|
@@ -147,12 +147,12 @@ handle_info({timeout, Timer, check}, State = #{timer := Timer,
|
|
|
case emqx_vm:cpu_util() of %% TODO: should be improved?
|
|
|
0 ->
|
|
|
State#{timer := undefined};
|
|
|
- Busy when Busy >= CPUHighWatermark ->
|
|
|
+ Busy when Busy > CPUHighWatermark ->
|
|
|
emqx_alarm:activate(high_cpu_usage, #{usage => Busy,
|
|
|
high_watermark => CPUHighWatermark,
|
|
|
low_watermark => CPULowWatermark}),
|
|
|
ensure_check_timer(State);
|
|
|
- Busy when Busy =< CPULowWatermark ->
|
|
|
+ Busy when Busy < CPULowWatermark ->
|
|
|
emqx_alarm:deactivate(high_cpu_usage),
|
|
|
ensure_check_timer(State);
|
|
|
_Busy ->
|
|
|
@@ -191,7 +191,7 @@ ensure_system_memory_alarm(HW) ->
|
|
|
undefined -> ok;
|
|
|
_Pid ->
|
|
|
{Allocated, Total, _Worst} = memsup:get_memory_data(),
|
|
|
- case Total =/= 0 andalso Allocated/Total * 100 >= HW of
|
|
|
+ case Total =/= 0 andalso Allocated/Total * 100 > HW of
|
|
|
true -> emqx_alarm:activate(high_system_memory_usage, #{high_watermark => HW});
|
|
|
false -> ok
|
|
|
end
|