public object DoCheck()
{
var results = new Dictionary<string, object>();
foreach (var drive in this.drivesToCheck)
{
var driveResults = new Dictionary<string, object>();
foreach (var metric in drive.Metrics)
{
driveResults[metric.MetricName] = metric.Counter.NextValue() / metric.Divisor;
}
var read = (float)driveResults["r/s"];
var write = (float)driveResults["w/s"];
var total = read + write;
float ratio = (read / total) * 100;
if (!float.IsNaN(ratio))
{
driveResults["rwratio"] = ratio;
}
else
{
driveResults["rwratio"] = 0.0;
}
results[drive.DriveName] = driveResults;
}
return results;
}