You are here

protected function StatsPro::get_watchdog_data in Statistics Pro 6.2

Helper function for all data gathering related to the watchdog table.

Parameters

int $watchdog_level:

bool $get_all_users Indicates if all users should be included or: only authenticated ones (uid > 0).

10 calls to StatsPro::get_watchdog_data()
StatsPro::get_data_alert in ./statspro.inc
Returns the number of total alerts per day since the last run.
StatsPro::get_data_critical in ./statspro.inc
Returns the number of total critical conditions per day since the last run.
StatsPro::get_data_emergency in ./statspro.inc
Returns the number of total emergencies per day since the last run.
StatsPro::get_data_error in ./statspro.inc
Returns the number of total errors per day since the last run.
StatsPro::get_data_ualert in ./statspro.inc
Returns the number of alerts generated by authenticated users per day since the last run.

... See full list

File

./statspro.inc, line 855
statspro class for Statistics Pro module.

Class

StatsPro
Manages the data saving and retrieval according to the user defined parameters.

Code

protected function get_watchdog_data($watchdog_level, $get_all_users) {
  $where_user = $get_all_users ? '' : 'AND uid > 0';
  $result = db_query('SELECT COUNT(*) AS num, DATE(FROM_UNIXTIME(timestamp)) AS dategroup
        FROM {watchdog}
        WHERE severity = %d
          AND timestamp >= %d
          %s
        GROUP BY dategroup', $watchdog_level, $this->last_run, $where_user);
  while ($row = db_fetch_array($result)) {
    $this
      ->add_day_data($row['dategroup'], $row['num']);
  }
}