You are here

public function MetricService::getActiveSessionsCount in Drupalmonitor 8

Get Active Sessions Count.

Return value

int Active Sessions Count.

File

src/MetricService.php, line 58

Class

MetricService
Class MetricService.

Namespace

Drupal\drupalmonitor

Code

public function getActiveSessionsCount() {
  $query = "SELECT count(*) FROM {users_field_data} u WHERE NOW()-300 > u.access";
  return (int) $this->database
    ->query($query)
    ->fetchField();
}