You are here

class Monitoring in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Agent/Remote/Monitoring.php \Drupal\drd_agent\Agent\Remote\Monitoring

Implements the Monitoring class.

Hierarchy

Expanded class hierarchy of Monitoring

1 file declares its use of Monitoring
Info.php in src/Agent/Action/Info.php

File

src/Agent/Remote/Monitoring.php, line 8

Namespace

Drupal\drd_agent\Agent\Remote
View source
class Monitoring extends Base {

  /**
   * {@inheritdoc}
   */
  public function collect() : array {
    $review = [];
    if ($this->moduleHandler
      ->moduleExists('monitoring')) {

      /* @var \Drupal\monitoring\Result\SensorResultInterface $result */
      foreach (monitoring_sensor_run_multiple() as $result) {
        $review[$result
          ->getSensorId()] = $result
          ->toArray();
        $review[$result
          ->getSensorId()]['label'] = $result
          ->getSensorConfig()
          ->getLabel();
      }
    }
    return $review;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Base::$accountSwitcher protected property
Base::$configFactory protected property
Base::$container protected property
Base::$database protected property
Base::$entityTypeManager protected property
Base::$moduleHandler protected property
Base::$time protected property
Base::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
Base::__construct public function Base constructor.
Monitoring::collect public function Collect the security review results. Overrides BaseInterface::collect