You are here

class SensorQueue in Monitoring 7

Monitors number of items for a given core queue.

Every instance represents a single queue. Once all queue items are processed, the value should be 0.

Hierarchy

Expanded class hierarchy of SensorQueue

See also

\DrupalQueue

File

lib/Drupal/monitoring/Sensor/Sensors/SensorQueue.php, line 20
Contains \Drupal\monitoring\Sensor\Sensors\SensorQueue.

Namespace

Drupal\monitoring\Sensor\Sensors
View source
class SensorQueue extends SensorThresholds {

  /**
   * {@inheritdoc}
   */
  public function runSensor(SensorResultInterface $result) {

    /** @var \DrupalQueueInterface $queue */
    $queue = \DrupalQueue::get($this->info
      ->getSetting('queue'));
    $result
      ->setValue($queue
      ->numberOfItems());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Sensor::$info protected property Current sensor info object.
Sensor::getSensorName public function Gets sensor name (not the label). Overrides SensorInterface::getSensorName
Sensor::isEnabled public function Determines if sensor is enabled. Overrides SensorInterface::isEnabled
Sensor::__construct function Instantiates a sensor object. 1
SensorQueue::runSensor public function Runs the sensor, updating $sensor_result. Overrides SensorInterface::runSensor
SensorThresholds::setFormError protected function Sets a form error for the given threshold key.
SensorThresholds::settingsForm public function Gets settings form for a specific sensor. Overrides SensorConfigurable::settingsForm 1
SensorThresholds::settingsFormValidate public function Form validator for a sensor settings form. Overrides SensorConfigurable::settingsFormValidate