interface SensorResultInterface in Monitoring 8
Same name and namespace in other branches
- 7 lib/Drupal/monitoring/Result/SensorResultInterface.php \Drupal\monitoring\Result\SensorResultInterface
Interface for a sensor result.
@todo more
Hierarchy
- interface \Drupal\monitoring\Entity\SensorResultDataInterface
- interface \Drupal\monitoring\Result\SensorResultInterface
Expanded class hierarchy of SensorResultInterface
All classes that implement SensorResultInterface
42 files declare their use of SensorResultInterface
- CommerceTurnoverSensorPlugin.php in src/
Plugin/ monitoring/ SensorPlugin/ CommerceTurnoverSensorPlugin.php - ContentEntityAggregatorSensorPlugin.php in src/
Plugin/ monitoring/ SensorPlugin/ ContentEntityAggregatorSensorPlugin.php - Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\ContentEntityAggregatorSensorPlugin.
- CoreRequirementsSensorPlugin.php in src/
Plugin/ monitoring/ SensorPlugin/ CoreRequirementsSensorPlugin.php - Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\CoreRequirementsSensorPlugin.
- CronLastRunAgeSensorPlugin.php in src/
Plugin/ monitoring/ SensorPlugin/ CronLastRunAgeSensorPlugin.php - Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\CronLastRunAgeSensorPlugin.
- DatabaseAggregatorSensorPlugin.php in src/
Plugin/ monitoring/ SensorPlugin/ DatabaseAggregatorSensorPlugin.php - Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\DatabaseAggregatorSensorPlugin.
File
- src/
Result/ SensorResultInterface.php, line 16 - Contains \Drupal\monitoring\Result\SensorResultInterface.
Namespace
Drupal\monitoring\ResultView source
interface SensorResultInterface extends SensorResultDataInterface {
/**
* Adds sensor status message.
*
* Multiple status messages can be added to a single result and will be added
* to the final status message.
*
* @param string $message
* Message to be set.
* @param array $variables
* Dynamic values to be replaced for placeholders in the message.
*
* @see \Drupal\monitoring\Result\SensorResultInterface::setMessage()
*/
public function addStatusMessage($message, array $variables = array());
/**
* Compiles added status messages sets the status.
*
* If the status is STATUS_UNKNOWN, this will attempt to set the status
* based on expected value and threshold configurations. See
* \Drupal\monitoring\SensorPlugin\SensorPluginInterface::runSensor() for details.
*
* @throws \Drupal\monitoring\Sensor\SensorCompilationException
* Thrown if an error occurs during the sensor result compilation.
*/
public function compile();
/**
* Gets the sensor metric value formatted for UI output.
*
* @param mixed $value
* Sensor result value.
*
* @return mixed
* Whatever value the sensor is supposed to return.
*/
public function getFormattedValue($value);
/**
* Gets the sensor expected value.
*
* @return mixed
* Whatever value the sensor is supposed to return.
*/
public function getExpectedValue();
/**
* Sets sensor status.
*
* @param string $status
* One of SensorResultInterface::STATUS_* constants.
*/
public function setStatus($status);
/**
* Sets sensor value.
*
* @param mixed $value
*/
public function setValue($value);
/**
* Sets the final result message.
*
* If this is set, then the compilation will not extend the message in any
* way and the sensor completely responsible for making sure that all
* relevant information like the sensor value is part of the message.
*
* @param string $message
* Message to be set.
* @param array $variables
* Dynamic values to be replaced for placeholders in the message.
*/
public function setMessage($message, array $variables = array());
/**
* Sets sensor execution time in ms.
*
* @param float $time
* Sensor execution time in ms.
*/
public function setExecutionTime($time);
/**
* Sets sensor expected value.
*
* Set to NULL if you want to prevent the default sensor result assessment.
* Use 0/FALSE values instead.
*
* In case an interval is expected, do not set the expected value, thresholds
* are used instead.
*
* The expected value is not considered when thresholds are configured.
*
* @param mixed $value
*/
public function setExpectedValue($value);
/**
* Casts/processes the sensor value into numeric representation.
*
* @return number
* Numeric sensor value.
*/
public function toNumber();
/**
* Determines if data for given result object are cached.
*
* @return boolean
* Cached flag.
*/
public function isCached();
/**
* Gets sensor result data as array.
*
* @return array
* Sensor result data as array.
*/
public function toArray();
/**
* Gets sensor name.
*
* @return string
*/
public function getSensorId();
/**
* Gets sensor config.
*
* @return \Drupal\monitoring\Entity\SensorConfig
*/
public function getSensorConfig();
/**
* Checks if sensor is in UNKNOWN state.
*
* @return boolean
*/
public function isUnknown();
/**
* Checks if sensor is in WARNING state.
*
* @return boolean
*/
public function isWarning();
/**
* Checks if sensor is in CRITICAL state.
*
* @return boolean
*/
public function isCritical();
/**
* Checks if sensor is in OK state.
*
* @return boolean
*/
public function isOk();
/**
* Set the verbose output.
*
* @param array $verbose_output
* The verbose output as a render array.
*/
public function setVerboseOutput($verbose_output);
/**
* Returns the verbose output.
*
* Verbose output is not persisted and is only available if the sensor result
* is not cached.
*
* @return array
* The verbose output as a render array.
*/
public function getVerboseOutput();
/**
* Sets the previous sensor result.
*
* @param \Drupal\monitoring\Entity\SensorResultDataInterface|null $previous_result
* A SensorResultEntity representing the previous sensor result to set.
* NULL if there is no previous result.
*/
public function setPreviousResult(SensorResultDataInterface $previous_result = NULL);
/**
* Gets the previous sensor result.
*
* @return \Drupal\monitoring\Entity\SensorResultDataInterface|null
* A SensorResultEntity representing the previous sensor result. NULL if
* there is no previous result.
*/
public function getPreviousResult();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SensorResultDataInterface:: |
public | function | Get sensor execution time in ms. | 2 |
SensorResultDataInterface:: |
public | function | Gets sensor status message. | 2 |
SensorResultDataInterface:: |
public | function | Gets sensor status. | 2 |
SensorResultDataInterface:: |
public | function | Gets a human readable label for the sensor status. | 2 |
SensorResultDataInterface:: |
public | function | The result data timestamp. | 2 |
SensorResultDataInterface:: |
public | function | Gets the sensor metric value. | 2 |
SensorResultDataInterface:: |
constant | Sensor status CRITICAL. | ||
SensorResultDataInterface:: |
constant | Sensor status INFO. | ||
SensorResultDataInterface:: |
constant | Sensor status OK. | ||
SensorResultDataInterface:: |
constant | Sensor status UNKNOWN. | ||
SensorResultDataInterface:: |
constant | Sensor status WARNING. | ||
SensorResultInterface:: |
public | function | Adds sensor status message. | 1 |
SensorResultInterface:: |
public | function | Compiles added status messages sets the status. | 1 |
SensorResultInterface:: |
public | function | Gets the sensor expected value. | 1 |
SensorResultInterface:: |
public | function | Gets the sensor metric value formatted for UI output. | 1 |
SensorResultInterface:: |
public | function | Gets the previous sensor result. | 1 |
SensorResultInterface:: |
public | function | Gets sensor config. | 1 |
SensorResultInterface:: |
public | function | Gets sensor name. | 1 |
SensorResultInterface:: |
public | function | Returns the verbose output. | 1 |
SensorResultInterface:: |
public | function | Determines if data for given result object are cached. | 1 |
SensorResultInterface:: |
public | function | Checks if sensor is in CRITICAL state. | 1 |
SensorResultInterface:: |
public | function | Checks if sensor is in OK state. | 1 |
SensorResultInterface:: |
public | function | Checks if sensor is in UNKNOWN state. | 1 |
SensorResultInterface:: |
public | function | Checks if sensor is in WARNING state. | 1 |
SensorResultInterface:: |
public | function | Sets sensor execution time in ms. | 1 |
SensorResultInterface:: |
public | function | Sets sensor expected value. | 1 |
SensorResultInterface:: |
public | function | Sets the final result message. | 1 |
SensorResultInterface:: |
public | function | Sets the previous sensor result. | 1 |
SensorResultInterface:: |
public | function | Sets sensor status. | 1 |
SensorResultInterface:: |
public | function | Sets sensor value. | 1 |
SensorResultInterface:: |
public | function | Set the verbose output. | 1 |
SensorResultInterface:: |
public | function | Gets sensor result data as array. | 1 |
SensorResultInterface:: |
public | function | Casts/processes the sensor value into numeric representation. | 1 |