Skip to content

Commit

Permalink
Add the watchdog-disc configuration in leo_gateway.conf to avoid its …
Browse files Browse the repository at this point in the history
  • Loading branch information
yosukehara committed Feb 24, 2015
1 parent 3a37896 commit 3d6663b
Showing 1 changed file with 142 additions and 0 deletions.
142 changes: 142 additions & 0 deletions priv/leo_gateway.schema
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,148 @@
]}.


%%
%% Watchdog.disk
%%
%% @doc Disk - Is enabled
{mapping,
"watchdog.disk.is_enabled",
"leo_watchdog.disk_enabled",
[
{datatype, atom},
{default, false}
]}.

%% @doc Disk - Raised error times - defalut:3
{mapping,
"watchdog.disk.raised_error_times",
"leo_watchdog.disk_raised_error_times",
[
{datatype, integer},
{default, 3}
]}.

%% @doc Check inteval (sec) - defalut:1sec
{mapping,
"watchdog.disk.interval",
"leo_watchdog.disk_interval",
[
{datatype, integer},
{default, 1}
]}.


%% @doc
{mapping,
"watchdog.disk.target_paths",
"leo_watchdog.disk_target_paths",
[
{datatype, string},
{default, []}
]}.

{translation, "leo_watchdog.disk_target_paths",
fun(Conf) ->
%% retrieve pathes
Paths = cuttlefish_util:conf_get_value("obj_containers.path", Conf),
Paths_1 = case string:tokens(Paths, "[ , ]") of
[] ->
["./avs"];
Tokens_1 ->
Tokens_1
end,
lists:map(
fun(Path) ->
{ok, Curr} = file:get_cwd(),
Path_1 = case Path of
"/" ++ _Rest -> Path;
"../" ++ _Rest -> Path;
"./" ++ Rest -> Curr ++ "/" ++ Rest;
_ -> Curr ++ "/" ++ Path
end,
Path_2 = case (string:len(Path_1) == string:rstr(Path_1, "/")) of
true -> Path_1;
false -> Path_1 ++ "/"
end,
Path_2
end, Paths_1)
end}.


%% @doc Threshold disk use% - default:85%
{mapping,
"watchdog.disk.threshold_disk_use",
"leo_watchdog.disk_threshold_use",
[
{datatype, integer},
{default, 85}
]}.

%% @doc Threshold disk util% - default:100%
{mapping,
"watchdog.disk.threshold_disk_util",
"leo_watchdog.disk_threshold_util",
[
{datatype, integer},
{default, 100}
]}.

%% @doc Threshold disk read kb/sec
%% default:131072(KB) - 256MB
{mapping,
"watchdog.disk.threshold_disk_rkb",
"leo_watchdog.disk_threshold_rkb",
[
{datatype, integer},
{default, 262144}
]}.

%% @doc Threshold disk write kb/sec
%% default:262144(KB) - 256MB
{mapping,
"watchdog.disk.threshold_disk_wkb",
"leo_watchdog.disk_threshold_wkb",
[
{datatype, integer},
{default, 262144}
]}.


%% @doc Threshold disk write kb/sec
%% default:262144(KB) - 256MB
{mapping,
"watchdog.disk.target_devices",
"leo_watchdog.disk_target_devices",
[
{datatype, string},
{default, []}
]}.

{translation, "leo_watchdog.disk_target_devices",
fun(Conf) ->
Managers = cuttlefish_util:conf_get_value("watchdog.disk.target_devices", Conf),
case string:tokens(Managers, "[ , ]") of
[] ->
[];
Tokens ->
Tokens
end
end}.


%%
%% Watchdog.Cluster
%%
%% @doc Cluster - Is enabled
{mapping,
"watchdog.cluster.is_enabled",
"leo_watchdog.cluster_enabled",
[
{datatype, atom},
{default, false}
]}.


%% --------------------------------------------------------------------
%% GATEWAY - NFS-related configuration
%% --------------------------------------------------------------------
Expand Down

0 comments on commit 3d6663b

Please sign in to comment.