You are here

public function SensorRunner::__construct in Monitoring 7

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

Constructs a SensorRunner.

Parameters

\Drupal\monitoring\Sensor\SensorInfo[] $sensors: Associative array of sensor names => sensor info. Only enabled sensors may be passed.

File

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

Class

SensorRunner
Instantiate and run requested sensors.

Namespace

Drupal\monitoring

Code

public function __construct(array $sensors = array()) {
  $this->sensors = $sensors;
  $this->sensorManager = monitoring_sensor_manager();
  if (empty($sensors)) {
    $this->sensors = $this->sensorManager
      ->getEnabledSensorInfo();
  }

  // @todo LOW Cleanly variable based installation should go into a factory.
  $this->loggingMode = variable_get('monitoring_sensor_call_logging', 'on_request');
  $this
    ->loadCache();
}