private function computeThreshold($name, $value)
{
if (!isset($this->thresholds[$name])) {
return null;
}
$threshold = $this->thresholds[$name];
if ($value <= $threshold[0]) {
return 'low';
} elseif ($value >= $threshold[2]) {
return 'high';
} else {
$low = $value - $threshold[0];
$avg = $threshold[1] - $value;
if ($low < $avg) {
return 'low';
}
}
return 'average';
}