You are here

protected function SensorResult::assessComparison in Monitoring 7

Same name and namespace in other branches
  1. 8 src/Result/SensorResult.php \Drupal\monitoring\Result\SensorResult::assessComparison()

Performs comparison of expected and actual sensor values.

1 call to SensorResult::assessComparison()
SensorResult::compile in lib/Drupal/monitoring/Result/SensorResult.php
Compiles added status messages sets the status.

File

lib/Drupal/monitoring/Result/SensorResult.php, line 256
Contains \Drupal\monitoring\Result\SensorResult.

Class

SensorResult
Generic container for the sensor result.

Namespace

Drupal\monitoring\Result

Code

protected function assessComparison() {
  if ($this
    ->getValue() != $this
    ->getExpectedValue()) {
    $this
      ->setStatus(SensorResultInterface::STATUS_CRITICAL);
  }
  else {
    $this
      ->setStatus(SensorResultInterface::STATUS_OK);
  }
}