You are here

function performance_data_stores in Performance Logging and Monitoring 7

Same name and namespace in other branches
  1. 6 performance.module \performance_data_stores()

List of available data stores. For each store you must provide the following functions: performance_enabled_store($form = FALSE, $message = FALSE) performance_log_summary_store($params) performance_get_data_store($timestamp = 0) performance_prune_store($timestamp = 0, $threshold = 0) performance_clear_store() where the 'store' part is the machine name (key used in the array) of your data store.

13 calls to performance_data_stores()
drush_performance_summary in ./performance.drush.inc
Summary page callback. Differs a little from the version in the module because drush_print_table() works differently.
performance_caching_message in ./performance.module
Display message on settings form.
performance_clear_access in ./performance.module
Access callback for the clear logs page.
performance_clear_form in ./performance.module
Clear logs form. This is actually a multistep form: first choose the data store you want to clear, second confirm that you actually want this.
performance_clear_form_confirm in ./performance.module
Clear data store confirm form callback.

... See full list

File

./performance.module, line 151
Logs detailed and/or summary page generation time and memory consumption for page requests. Copyright Khalid Baheyeldin 2008 of http://2bits.com

Code

function performance_data_stores() {

  // No drupal_static(). Don't want this to be reset.
  static $stores = array();
  if (!empty($stores)) {
    return $stores;
  }
  $function = 'performance_enabled_';

  // Array key is the 'machine readable' name, used in the functions.
  $stores['db'] = array(
    '#name' => t('Database'),
    // Human readable name.
    '#prod_use' => FALSE,
    // Whether this store is OK to be enabled on a production environment.
    '#enabled' => call_user_func($function . 'db'),
  );
  $stores['apc'] = array(
    '#name' => t('APC'),
    '#prod_use' => TRUE,
    '#enabled' => call_user_func($function . 'apc'),
  );
  $stores['memcache'] = array(
    '#name' => t('Memcache'),
    '#prod_use' => TRUE,
    '#enabled' => call_user_func($function . 'memcache'),
  );
  $stores['zend'] = array(
    '#name' => t('Zend Datacache'),
    '#prod_use' => TRUE,
    '#enabled' => call_user_func($function . 'zend'),
  );
  return $stores;
}