You are here

public function SensorRunner::runSensors in Monitoring 7

Same name and namespace in other branches
  1. 8 src/SensorRunner.php \Drupal\monitoring\SensorRunner::runSensors()

Runs the defined sensors.

Return value

\Drupal\monitoring\Result\SensorResultInterface[] Array of sensor results.

Throws

\Drupal\monitoring\Sensor\DisabledSensorException Thrown if any of the passed sensors is not enabled.

See also

\Drupal\monitoring\SensorRunner::runSensor()

1 call to SensorRunner::runSensors()
SensorRunner::getIterator in lib/Drupal/monitoring/SensorRunner.php

File

lib/Drupal/monitoring/SensorRunner.php, line 150
Contains \Drupal\monitoring\SensorRunner.

Class

SensorRunner
Instantiate and run requested sensors.

Namespace

Drupal\monitoring

Code

public function runSensors() {
  $results = array();
  foreach ($this->sensors as $name => $info) {
    if ($result = $this
      ->runSensor($info)) {
      $results[$name] = $result;
    }
  }
  $this
    ->logResults($results);
  $this
    ->cacheResults($results);
  return $results;
}