function monitoring_sensor_run in Monitoring 8
Same name and namespace in other branches
- 7 monitoring.module \monitoring_sensor_run()
The sensor runner function.
Note that in case there is a cached result for given sensor name, the sensor will not run and the cached result will be returned.
Parameters
string $sensor_name: The name of the sensor that is to be run.
bool $force_run: Set to TRUE to force the run. Defaults to FALSE.
bool $verbose: (optional) Set to TRUE to enable verbose execution, defaults to FALSE.
Return value
\Drupal\monitoring\Result\SensorResultInterface A single result object.
Throws
\Drupal\monitoring\Sensor\NonExistingSensorException Thrown if the requested sensor does not exist.
\Drupal\monitoring\Sensor\DisabledSensorException Thrown if any of the passed sensor names is not enabled.
7 calls to monitoring_sensor_run()
- DisappearedSensorsSensorPlugin::buildConfigurationForm in src/
Plugin/ monitoring/ SensorPlugin/ DisappearedSensorsSensorPlugin.php - Adds UI to clear the missing sensor status.
- MonitoringApiTest::testAPI in tests/
src/ Kernel/ MonitoringApiTest.php - Test the base class if info is set and passed correctly.
- MonitoringServicesTest::assertSensorResult in tests/
src/ Functional/ MonitoringServicesTest.php - Do sensor result assertions.
- MonitoringTestTrait::runSensor in tests/
src/ Functional/ MonitoringTestTrait.php - Executes a sensor and returns the result.
- MonitoringUiJavascriptTest::testSensorInstalledModulesUI in tests/
src/ FunctionalJavascript/ MonitoringUiJavascriptTest.php - Tests the UI/settings of the installed modules sensor.
File
- ./
monitoring.module, line 138 - Monitoring bootstrap file.
Code
function monitoring_sensor_run($sensor_name, $force_run = FALSE, $verbose = FALSE) {
$results = monitoring_sensor_run_multiple(array(
$sensor_name,
), $force_run, $verbose);
return reset($results);
}