Class CheckList
Represents a list of health checks to be performed. Health checks are classes derived from BaseCheck class and must implement DoRun() method that performs application-specific checking. CheckList obtains a list of Check instances from assemblies supplied to its constructor. Health checks are executed in no predictable order. If particular execution order is necessary then a check has to be written to explicitly coordinate sub-checks. The class is thread safe for all operations.
Inheritance
Inherited Members
Namespace: NFX.Health
Assembly: NFX.dll
Syntax
public sealed class CheckList
Constructors
CheckList(IEnumerable<Assembly>, ConfigSectionNode)
Initializaes check list from assemblies
Declaration
public CheckList(IEnumerable<Assembly> checkAssemblies, ConfigSectionNode config)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> | checkAssemblies | |
ConfigSectionNode | config |
CheckList(String, String, ConfigSectionNode)
Initializaes check list from assembly names separated by semicolons. Optional path will be prepended to every assembly name
Declaration
public CheckList(string path, string checkAssemblies, ConfigSectionNode config)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | |
System.String | checkAssemblies | |
ConfigSectionNode | config |
Properties
AllSuccessful
Returns true when all checks have successfuly run
Declaration
public bool AllSuccessful { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Checks
Returns health checks
Declaration
public IEnumerable<BaseCheck> Checks { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<BaseCheck> |
RunFinish
Returns when run finished
Declaration
public DateTime? RunFinish { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
RunStart
Returns when run started
Declaration
public DateTime? RunStart { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
Status
Returns current status - whether checks are running or have already been run
Declaration
public CheckListStatus Status { get; }
Property Value
Type | Description |
---|---|
CheckListStatus |
Successful
Returns true when all checks that could be run have successfuly run
Declaration
public bool Successful { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Report(TextWriter, String)
Dumps check results into writer in on of the supported formats
Declaration
public string Report(TextWriter writer, string format)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | writer | |
System.String | format |
Returns
Type | Description |
---|---|
System.String |
Run(NameValueCollection)
Runs health checks. Checks are ran in NO PARTICULAR order. This method can not be called twice
Declaration
public void Run(NameValueCollection parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NameValueCollection | parameters |