protected function MonitoringApiTest::loadSensorData in Monitoring 7
Load sensor log data for a given sensor.
Parameters
$sensor_name: The sensor name.
Return value
array All log records of given sensor.
1 call to MonitoringApiTest::loadSensorData()
- MonitoringApiTest::testLogging in test/
tests/ monitoring.api.test - Test logging with different settings.
File
- test/
tests/ monitoring.api.test, line 439 - Contains \MonitoringApiTest.
Class
- MonitoringApiTest
- Tests for Monitoring API.
Code
protected function loadSensorData($sensor_name) {
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'monitoring_sensor_result');
$query
->propertyCondition('sensor_name', $sensor_name);
$result = $query
->execute();
if (isset($result['monitoring_sensor_result'])) {
return entity_load('monitoring_sensor_result', array_keys($result['monitoring_sensor_result']));
}
return array();
}