protected function SensorResult::assessThresholds in Monitoring 7
Same name and namespace in other branches
- 8 src/Result/SensorResult.php \Drupal\monitoring\Result\SensorResult::assessThresholds()
Deal with thresholds.
Set the sensor value based on threshold configuration.
Return value
string The message associated with the threshold.
See also
\Drupal\monitoring\Sensor\Thresholds
1 call to SensorResult::assessThresholds()
- SensorResult::compile in lib/
Drupal/ monitoring/ Result/ SensorResult.php - Compiles added status messages sets the status.
File
- lib/
Drupal/ monitoring/ Result/ SensorResult.php, line 275 - Contains \Drupal\monitoring\Result\SensorResult.
Class
- SensorResult
- Generic container for the sensor result.
Namespace
Drupal\monitoring\ResultCode
protected function assessThresholds() {
$thresholds = new Thresholds($this->sensorInfo);
$matched_threshold = $thresholds
->getMatchedThreshold($this
->getValue());
// Set sensor status based on matched threshold.
$this
->setStatus($matched_threshold);
// @todo why not just set the status message?
return $thresholds
->getStatusMessage();
}