This module defines the riaknostic_check behaviour.
Required callback functions: description/0, valid/0, check/0, format/1.
Enforces a common API among all diagnostic modules and provides some automation around their execution.
-spec description() -> iodata().
A short description of what the diagnostic does, which will be
printed when the script is given the -l
flag.
-spec valid() -> boolean().
Whether the diagnostic is valid to run. For example, some checks require connectivity to the Riak node and hence call riaknostic_node:can_connect().
-spec check() -> [{lager:log_level(), term()}].
Runs the diagnostic, returning a list of pairs, where the first
is a severity level and the second is any term that is understood
by the format/1
callback.
-spec format(term()) -> iodata() | {io:format(), [term()]}.
Formats terms that were returned from check/0
for
output to the console. Valid return values are an iolist (string,
binary, etc) or a pair of a format string and a list of terms, as
you would pass to io:format/2.
behaviour_info/1 | The behaviour definition for diagnostic modules. |
check/1 | Runs the diagnostic in the given module, if it is valid. |
modules/0 | Collects a list of diagnostic modules included in the riaknostic application. |
print/1 | Formats and prints the given message via lager:log/3,4. |
behaviour_info(X1::atom()) -> undefined | [{atom(), arity()}]
The behaviour definition for diagnostic modules.
check(Module::module()) -> [{lager:log_level(), module(), term()}]
Runs the diagnostic in the given module, if it is valid. Returns a list of messages that will be printed later using print/1.
modules() -> [module()]
Collects a list of diagnostic modules included in the riaknostic application.
print(X1::{Level::lager:log_level(), Module::module(), Data::term()}) -> ok
Formats and prints the given message via lager:log/3,4. The diagnostic module's format/1 function will be called to provide a human-readable message. It should return an iolist() or a 2-tuple consisting of a format string and a list of terms.
Generated by EDoc, Feb 18 2012, 03:37:56.