You are here

protected function SensorDatabaseAggregator::buildQueryAggregate in Monitoring 7

Adds aggregate expressions to the query.

Defaults to COUNT(*), override this method to use a different aggregation.

Parameters

\SelectQueryInterface $query: The select query that should be aggregated.

1 call to SensorDatabaseAggregator::buildQueryAggregate()
SensorDatabaseAggregator::buildQuery in lib/Drupal/monitoring/Sensor/Sensors/SensorDatabaseAggregator.php
Builds the database query.

File

lib/Drupal/monitoring/Sensor/Sensors/SensorDatabaseAggregator.php, line 189
Contains \Drupal\monitoring\Sensor\Sensors\SensorDatabaseAggregator.

Class

SensorDatabaseAggregator
Base for database aggregator sensors.

Namespace

Drupal\monitoring\Sensor\Sensors

Code

protected function buildQueryAggregate(\SelectQueryInterface $query) {
  $query
    ->addExpression('COUNT(*)', 'records_count');
}