private void DoChecks()
{
var results = new Dictionary<string, object>();
foreach (var check in Checks)
{
Log.DebugFormat("{0}: start", check.GetType());
try
{
var result = check.DoCheck();
if (result != null)
{
results.Add(check.Key, result);
Log.DebugFormat("{0}: end", check.GetType());
}
}
catch (Exception ex)
{
Log.Error(ex);
}
}
// Post metrics to Server Density servers.
try
{
var poster = new PayloadPoster(_config, results);
poster.Post();
}
catch (Exception ex)
{
Log.Error(ex);
}
}