You are here

protected function MonitoringApiTest::loadSensorLog in Monitoring 8

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::loadSensorLog()
MonitoringApiTest::testLogging in tests/src/Kernel/MonitoringApiTest.php
Test logging with different settings.

File

tests/src/Kernel/MonitoringApiTest.php, line 388
Contains \Drupal\Tests\monitoring\Kernel\MonitoringApiTest.

Class

MonitoringApiTest
Tests for Monitoring API.

Namespace

Drupal\Tests\monitoring\Kernel

Code

protected function loadSensorLog($sensor_name) {
  $result = \Drupal::entityQuery('monitoring_sensor_result')
    ->condition('sensor_name', $sensor_name)
    ->execute();
  return SensorResultEntity::loadMultiple($result);
}