You are here

function drupalmonitor_connector_shutdow in Drupalmonitor 7

Save log entry to db for performance monitoring.

1 string reference to 'drupalmonitor_connector_shutdow'
drupalmonitor_connector_boot in ./drupalmonitor_connector.module
Register shutdown function.

File

./drupalmonitor_connector.module, line 60
This file is the core of drupalmonitor_connector

Code

function drupalmonitor_connector_shutdow() {
  if (variable_get('drupalmonitor_performance_monitoring', 1) == 1) {
    db_insert('drupalmonitor_log')
      ->fields(array(
      'q' => $_GET['q'],
      'memory' => memory_get_peak_usage(),
      'dt' => REQUEST_TIME,
      'execution_time' => timer_read('page'),
    ))
      ->execute();
  }
}