fix(alarm): alarm message with .2f format
This commit is contained in:
parent
9e8b4ab237
commit
1b0da3cc58
|
@ -96,8 +96,8 @@ handle_info({timeout, _Timer, check}, State) ->
|
||||||
_ = case emqx_vm:cpu_util() of %% TODO: should be improved?
|
_ = case emqx_vm:cpu_util() of %% TODO: should be improved?
|
||||||
0 -> ok;
|
0 -> ok;
|
||||||
Busy when Busy >= CPUHighWatermark ->
|
Busy when Busy >= CPUHighWatermark ->
|
||||||
Usage = io_lib:format("~p%", [Busy]),
|
Usage = list_to_binary(io_lib:format("~.2f%", [Busy])),
|
||||||
Message = [Usage, " cpu usage"],
|
Message = <<Usage/binary, " cpu usage">>,
|
||||||
emqx_alarm:activate(high_cpu_usage,
|
emqx_alarm:activate(high_cpu_usage,
|
||||||
#{
|
#{
|
||||||
usage => Usage,
|
usage => Usage,
|
||||||
|
@ -107,8 +107,8 @@ handle_info({timeout, _Timer, check}, State) ->
|
||||||
Message),
|
Message),
|
||||||
start_check_timer();
|
start_check_timer();
|
||||||
Busy when Busy =< CPULowWatermark ->
|
Busy when Busy =< CPULowWatermark ->
|
||||||
Usage = io_lib:format("~p%", [Busy]),
|
Usage = list_to_binary(io_lib:format("~.2f%", [Busy])),
|
||||||
Message = [Usage, " cpu usage"],
|
Message = <<Usage/binary, " cpu usage">>,
|
||||||
emqx_alarm:deactivate(high_cpu_usage,
|
emqx_alarm:deactivate(high_cpu_usage,
|
||||||
#{
|
#{
|
||||||
usage => Usage,
|
usage => Usage,
|
||||||
|
|
Loading…
Reference in New Issue