Skip to content

Commit

Permalink
Merge branch 'release/0.12.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
yosukehara committed Aug 8, 2016
2 parents b4b174e + 5ce0178 commit 3955cf9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 2 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
%% under the License.
%%
%%======================================================================
{require_otp_vsn, "R16B*|17|18"}.
{require_otp_vsn, "R16B*|17|18|19"}.

{deps, [
{leo_commons, "1.*", {git, "https://github.com/leo-project/leo_commons.git", {tag, "1.1.6"}}},
{leo_commons, "1.*", {git, "https://github.com/leo-project/leo_commons.git", {tag, "1.1.7"}}},
{elarm, ".*", {git, "https://github.com/leo-project/elarm.git", "d9e8a6f35c408c0c4dea8a15ddcf61f54cb8a826"}}
]}.

{erl_opts, [{d, 'NOTEST'},
warn_obsolete_guard,
warnings_as_errors,
warn_shadow_vars
]}.
{xref_checks, [undefined_function_calls]}.
Expand Down
2 changes: 1 addition & 1 deletion src/leo_watchdog.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{application, leo_watchdog,
[
{description, "leo_watchdog keep monitoring applications"},
{vsn, "0.12.2"},
{vsn, "0.12.3"},
{mod, {leo_watchdog_app, []}},
{registered, []},
{applications, [
Expand Down
11 changes: 9 additions & 2 deletions src/leo_watchdog_cpu.erl
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,17 @@ handle_call(Id, #state{threshold_load_avg = ThresholdLoadAvg,
raised_error_times = RaisedErrorTimes,
cur_error_times = CurErrorTimes} = State) ->
try
AVG_1 = erlang:round(cpu_sup:avg1() / 256 * 100),
AVG_1 = case catch cpu_sup:avg1() of
{'EXIT',_} ->
0.0;
OrgAvg1 ->
erlang:round(OrgAvg1 / 256 * 100)
end,
CPU_Util = case os:type() of
{unix, linux} ->
case cpu_sup:util([per_cpu]) of
case catch cpu_sup:util([per_cpu]) of
{'EXIT',_} ->
0;
[] ->
0;
Ret_CPUUtil ->
Expand Down

0 comments on commit 3955cf9

Please sign in to comment.