function performance_settings_form in Performance Logging and Monitoring 6.2
Same name and namespace in other branches
- 6 performance.module \performance_settings_form()
- 7.2 performance.module \performance_settings_form()
- 7 performance.module \performance_settings_form()
System settings form.
1 string reference to 'performance_settings_form'
- performance_menu in ./
performance.module - Implementation of hook_menu().
File
- ./
performance.module, line 141 - 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_settings_form() {
$options = array(
0 => t('Disabled'),
1 => t('Enabled'),
);
$status = performance_caching_message();
// Setup settings form.
$form['mode'] = array(
'#type' => 'fieldset',
'#title' => t('Logging mode'),
'#collapsible' => TRUE,
);
$form['mode']['performance_detail'] = array(
'#type' => 'radios',
'#title' => t('Detailed logging'),
'#default_value' => variable_get('performance_detail', 0),
'#options' => $options,
'#description' => t('Log memory usage and page generation times for every page. This logging mode is <strong>not</strong> suitable for large sites, as it can degrade performance severly. It is intended for use by developers, or on a test copy of the site.'),
);
$form['mode']['performance_summary'] = array(
'#type' => 'radios',
'#title' => t('Summary logging'),
'#default_value' => variable_get('performance_summary', 0),
'#options' => $options,
'#description' => t('Log summary data, such as average and maximum page generation times and memory usage.'),
);
if ($status != 'error') {
$form['mode']['performance_summary']['#description'] .= ' ' . t('The summary will be stored in an alternative cache, and hence there is no load on the database. This logging is suitable for most live sites, unless the number of unique page accesses is excessively high.');
}
else {
$form['mode']['performance_summary']['#description'] .= ' ' . t('This logging mode is <strong>not</strong> suitable for most live sites.');
}
$form['other'] = array(
'#type' => 'fieldset',
'#title' => t('Other'),
'#collapsible' => TRUE,
);
$form['other'][PERFORMANCE_QUERY_VAR] = array(
'#type' => 'radios',
'#disabled' => TRUE,
'#title' => t('Database Query timing and count'),
'#default_value' => variable_get(PERFORMANCE_QUERY_VAR, 0),
'#options' => $options,
'#description' => t('Log database query timing and query count for each page. This is useful to know if the bottleneck is in excessive database query counts, or the time required to execute those queries is high. Enabling this will incurr some memory overhead as query times and the actual query strings are cached in memory as arrays for each page, hence skewing the overall page memory reported. <strong>Please note that this setting is enabled or disabled in the settings of the devel module.</strong>'),
);
$form['other']['performance_threshold_accesses'] = array(
'#type' => 'select',
'#title' => t('Accesses threshold'),
'#default_value' => variable_get('performance_threshold_accesses', 0),
'#options' => array(
0,
1,
2,
5,
10,
),
'#description' => t("When displaying the summary report, only pages with the number of accesses larger than the specified threshold will be shown. Also, when cron runs and summary is <strong>not</strong> logged to DB, pages with that number of accesses or less will be removed, so as not to overflow the cache's memory. This is useful on a live site with a high volume of hits. On a development site, you probably want this set to 0, so you can see all pages."),
);
$form['other']['performance_nodrush'] = array(
'#type' => 'checkbox',
'#title' => t('Do not log drush access'),
'#default_value' => variable_get('performance_nodrush', 1),
'#description' => t('Prevent !link access to the site from being logged.', array(
'!link' => l(t('drush'), 'http://www.drupal.org/project/drush', array(
'attributes' => array(
'target' => '_blank',
),
)),
)),
);
$form['other']['performance_skip_paths'] = array(
'#type' => 'textarea',
'#title' => t('Paths to exclude'),
'#default_value' => variable_get('performance_skip_paths', ''),
'#description' => t("Enter one path per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array(
'%blog' => 'blog',
'%blog-wildcard' => 'blog/*',
'%front' => '<front>',
)),
);
return system_settings_form($form);
}