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
- class \Drupal\monitoring\Sensor\Sensor implements SensorInterface
- class \Drupal\monitoring\Sensor\SensorConfigurable implements SensorConfigurableInterface
- class \Drupal\monitoring\Sensor\SensorThresholds implements SensorThresholdsInterface
- class \Drupal\monitoring\Sensor\Sensors\SensorQueue
- class \Drupal\monitoring\Sensor\SensorThresholds implements SensorThresholdsInterface
- class \Drupal\monitoring\Sensor\SensorConfigurable implements SensorConfigurableInterface
Expanded class hierarchy of SensorQueue
See also
File
- lib/
Drupal/ monitoring/ Sensor/ Sensors/ SensorQueue.php, line 20 - Contains \Drupal\monitoring\Sensor\Sensors\SensorQueue.
Namespace
Drupal\monitoring\Sensor\SensorsView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Sensor:: |
protected | property | Current sensor info object. | |
Sensor:: |
public | function |
Gets sensor name (not the label). Overrides SensorInterface:: |
|
Sensor:: |
public | function |
Determines if sensor is enabled. Overrides SensorInterface:: |
|
Sensor:: |
function | Instantiates a sensor object. | 1 | |
SensorQueue:: |
public | function |
Runs the sensor, updating $sensor_result. Overrides SensorInterface:: |
|
SensorThresholds:: |
protected | function | Sets a form error for the given threshold key. | |
SensorThresholds:: |
public | function |
Gets settings form for a specific sensor. Overrides SensorConfigurable:: |
1 |
SensorThresholds:: |
public | function |
Form validator for a sensor settings form. Overrides SensorConfigurable:: |