Commit 5b1aad6c authored by moshe weitzman's avatar moshe weitzman

Remove performance module. It will hopefully return to http://drupal.org/project/performance.

parent 434773e2
By Khalid Baheyeldin
Copyright 2008 http://2bits.com
Description
-----------
This module provides performance statistics logging for a site, such as page generation
times, and memory usage, for each page load.
This module is useful for developers and site administrators alike to identify pages that
are slow to generate or use excessive memory.
Features include:
* Settings to enable detailed logging or summary logging. The module defaults to no
logging at all.
* Detailed logging causes one database row to be written for each page load of the site.
The data includes page generation time in milliseconds, and the number of bytes allocated
to PHP, time stamp, ...etc.
* Summary logging logs the average and maximum page generation time, average and maximum memory
usage, last access time, and number of accesses for each path.
* Summary can be logged to memcache, if configured, so as to not cause extra load on the database.
This works when APC cannot be used (e.g. certain FastCGI configurations, or when you have many
web servers on different boxes. This mode is recommended for live sites.
* Summary can be logged to APC, if installed, and the APC data cache is shared, so as to not cause
extra load on the database. This mode is recommended for live sites.
* A settings option is available when using summary mode with APC, to exclude pages with less
than a certain number of accesses. Useful for large sites.
* Support for normal page cache.
Note that detailed logging is only suitable for a site that is in development or testing. Do NOT
enable detailed logging on a live site.
The memory measurement feature of this module depends on the memory_get_peak_usage() function,
available only in PHP 5.2.x or later.
Only summary logging with Memcache or APC are recommended mode for live sites, with a threshold of
2 or more.
Note on Completeness:
---------------------
Please note that when summary logging to APC or Memcache, the data captured in the summary will
not be comprehensive reflecting every single page view for every URL.
The reason for this is that there is no atomic locking when updating the data structures that
store per-URL statistics in this module.
This means that the values you get when using these storage caches are only samples, and would
miss some page views, depending on how busy the site is.
For memcache, there is way to implement locking using the $mc->increment and/or $mc->add as well.
However, there is a risk if these are implemented, that there will be less concurrency and we
can cause a site to slow down.
Configuration:
--------------
If you are using memcache, then you need to configure an extra bin for performance.
If you have multiple web server boxes, then it is best to centralize this bin for
all the boxes, so you get combined statistics.
Your settings.php looks like this:
$conf = array(
'cache_inc' => './sites/all/modules/memcache/memcache.inc',
'memcache_servers' => array(
'127.0.0.1:11211' => 'default',
// More bins here ....
'127.0.0.1:11311' => 'performance',
),
'memcache_bins' => array(
'cache_performance' => 'performance',
),
);
Bugs/Features/Patches:
----------------------
If you want to report bugs, feature requests, or submit a patch, please do so at the project page on
the Drupal web site at http://drupal.org/project/performance
Author
------
Khalid Baheyeldin (http://baheyeldin.com/khalid and http://2bits.com)
If you use this module, find it useful, and want to send the author a thank you note, then use the
Feedback/Contact page at the URL above.
The author can also be contacted for paid customizations of this and other modules.
name = Performance Logging
description = Logs detailed and/or summary page generation time and memory consumption for page requests.
package = Development
core = 7.x
tags[] = developer
<?php
/**
* @file
* Install and update for Performance Logging
*
* Copyright Khalid Baheyeldin 2008 of http://2bits.com
*/
// Minimum APC shm memory size to require
define('PERFORMANCE_MIN_MEMORY', 48);
function performance_schema() {
$schema = array();
$schema['performance_summary'] = array(
'fields' => array(
'path' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
'last_access' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'bytes_max' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'bytes_avg' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'ms_max' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'ms_avg' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'query_count_max' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'query_count_avg' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'query_timer_max' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'query_timer_avg' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'num_accesses' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
),
'primary key' => array('path'),
'indexes' => array(
'last_access' => array('last_access')),
);
$schema['performance_detail'] = array(
'fields' => array(
'pid' => array('type' => 'serial', 'not null' => TRUE, 'disp-width' => '11'),
'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'bytes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'ms' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'query_count' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'query_timer' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'anon' => array('type' => 'int', 'not null' => FALSE, 'default' => 1, 'disp-width' => '1'),
'path' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'data' => array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'),
),
'primary key' => array('pid'),
'indexes' => array(
'timestamp' => array('timestamp')),
);
return $schema;
}
function performance_install() {
// Set the weight so this module runs last
db_query("UPDATE {system} SET weight = 3000 WHERE name = 'performance'");
}
function performance_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'performance%'");
}
function performance_requirements($phase) {
$requirements = array();
if ($phase != 'runtime') {
return $requirements;
}
if (variable_get('performance_detail', 0)) {
$requirements['performance_detail'] = array(
'title' => t('Performance logging details'),
'value' => 'Enabled',
'severity' => REQUIREMENT_WARNING,
'description' => t('Performance detailed logging is <a href="@link">enabled</a>. This can cause severe issues on live sites.', array('@link' => url('admin/config/development/performance_logging'))),
);
}
if (variable_get('devel_query_display', FALSE)) {
if (variable_get('performance_detail', 0) ||
variable_get('performance_summary_db', 0) ||
variable_get('performance_summary_apc', 0)) {
$requirements['performance_query'] = array(
'title' => t('Performance logging query'),
'value' => 'Enabled',
'severity' => REQUIREMENT_WARNING,
'description' => t('Query timing and count logging is <a href="@link">enabled</a>. This can cause memory size per page to be larger than normal.', array('@link' => url('admin/config/development/performance_logging'))),
);
}
}
if (!function_exists('apc_fetch')) {
$requirements['performance_apc'] = array(
'title' => t('Performance logging APC'),
'value' => 'Disabled',
'severity' => REQUIREMENT_WARNING,
'description' => t('Performance logging on live web sites works best if APC is enabled.'),
);
}
$shm_size = ini_get('apc.shm_size');
if (function_exists('apc_fetch') && $shm_size < PERFORMANCE_MIN_MEMORY) {
$requirements['performance_apc_mem'] = array(
'title' => t('Performance logging APC memory size'),
'value' => $shm_size,
'severity' => REQUIREMENT_WARNING,
'description' => t('APC has been configured for !size, which is less than the recommended !min_memory MB of memory. If you encounter errors when viewing the summary report, then try to increase that limit for APC.', array('!size' => 1*$shm_size, '!min_memory' => PERFORMANCE_MIN_MEMORY)),
);
}
return $requirements;
}
function performance_update_1() {
$ret = array();
db_drop_field($ret, 'performance_detail', 'title');
db_drop_field($ret, 'performance_summary', 'title');
return $ret;
}
function performance_update_2() {
$ret = array();
db_add_field($ret, 'performance_detail', 'data', array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'));
return $ret;
}
/**
* Harmonize notations for milliseconds to "ms".
*
* @return array
*/
function performance_update_7001() {
$int_field = array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11');
db_change_field('performance_summary', 'millisecs_max', 'ms_max', $int_field);
db_change_field('performance_summary', 'millisecs_avg', 'ms_avg', $int_field);
db_change_field('performance_detail', 'millisecs', 'ms', $int_field);
// We don't have a cache update method, so it's better to clear it
if (function_exists('apc_fetch')) {
apc_clear_cache('user');
}
}
<?php
/**
* @file
* Logs detailed and/or summary page generation time and memory consumption for page requests.
* Copyright Khalid Baheyeldin 2008 of http://2bits.com
*/
define('PERFORMANCE_KEY', 'dru-perf:'. $_SERVER['HTTP_HOST'] .':');
define('PERFORMANCE_MEMCACHE_BIN', 'cache_performance');
function performance_memcache_enabled() {
global $conf;
if (function_exists('dmemcache_set') && isset($conf['memcache_bins']['cache_performance'])) {
return TRUE;
}
return FALSE;
}
function performance_menu() {
$items = array();
$items['admin/config/development/performance_logging'] = array(
'title' => 'Performance logging',
'description' => 'Logs performance data: page generation times and memory usage.',
'page callback' => 'drupal_get_form',
'page arguments' => array('performance_settings'),
'access arguments' => array('administer performance logging'),
);
$items['admin/config/development/performance_logging/apc_clear'] = array(
'title' => 'Clear APC',
'description' => 'Clears performance statistics collected in APC.',
'page callback' => 'drupal_get_form',
'page arguments' => array('performance_clear_apc_confirm'),
'access arguments' => array('administer performance logging'),
);
$items['admin/config/development/performance_logging/memcache_clear'] = array(
'title' => 'Clear Memcache',
'description' => 'Clears performance statistics collected in Memcache.',
'page callback' => 'drupal_get_form',
'page arguments' => array('performance_clear_memcache_confirm'),
'access arguments' => array('administer performance logging'),
);
$items['admin/reports/performance_logging_summary'] = array(
'title' => 'Performance Logs: Summary',
'description' => 'View summary performance logs: page generation times and memory usage.',
'page callback' => 'performance_view_summary',
'access arguments' => array('administer performance logging'),
);
$items['admin/reports/performance_logging_details'] = array(
'title' => 'Performance Logs: Details',
'description' => 'View detailed, per page, performance logs: page generation times and memory usage.',
'page callback' => 'performance_view_details',
'access arguments' => array('administer performance logging'),
);
return $items;
}
/**
* Implementation of hook_permission().
*/
function performance_permission() {
return array(
'administer performance logging' => array(
'title' => t('Administer performance logging'),
'description' => t('Allows both configuring the performance module and accessing its reports.'),
));
}
function performance_settings() {
$options = array(
0 => t('Disabled'),
1 => t('Enabled'),
);
if (function_exists('apc_cache_info')) {
drupal_set_message(t('APC is enabled. It is reasonably safe to enable summary logging on live sites.'), 'status', FALSE);
}
else {
drupal_set_message(t('APC is not enabled. It is <strong>not</strong> safe to enable summary logging to the database on live sites.'), 'error', FALSE);
}
$form['mode'] = array(
'#type' => 'fieldset',
'#title' => t('Logging mode'),
'#collapsible' => TRUE,
);
$form['mode']['performance_detail'] = array(
'#type' => 'select',
'#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_db'] = array(
'#type' => 'select',
'#title' => t('Summary logging (DB)'),
'#default_value' => variable_get('performance_summary_db', 0),
'#options' => $options,
'#description' => t('Log summary data, such as average and maximum page generation times and memory usage to the database. This logging mode is <strong>not</strong> suitable for most live sites.'),
);
$disabled = TRUE;
if (function_exists('apc_cache_info')) {
$disabled = FALSE;
}
$form['mode']['performance_summary_apc'] = array(
'#type' => 'select',
'#title' => t('Summary logging (APC)'),
'#default_value' => variable_get('performance_summary_apc', 0),
'#options' => $options,
'#disabled' => $disabled,
'#description' => t('Log summary data, such as average and maximum page generation times and memory usage to APC, if installed. The summary will be stored in APC memory, and hence there is no load on the database. This logging to APC is suitable for most live sites, unless the number of unique page accesses is excessively high.'),
);
$disabled = TRUE;
if (performance_memcache_enabled()) {
$disabled = FALSE;
}
$form['mode']['performance_summary_memcache'] = array(
'#type' => 'select',
'#title' => t('Summary logging (Memcached)'),
'#default_value' => variable_get('performance_summary_memcache', 0),
'#options' => $options,
'#disabled' => $disabled,
'#description' => t('Log summary data, such as average and maximum page generation times and memory usage to Memcached, if installed. The summary will be stored in Memcached memory, and hence there is no load on the database. This logging to Memcached is suitable for most live sites, unless the number of unique page accesses is excessively high.'),
);
$form['other'] = array(
'#type' => 'fieldset',
'#title' => t('Other'),
'#collapsible' => TRUE,
);
$form['other']['performance_query'] = array(
'#type' => 'select',
'#title' => t('Database Query timing and count'),
'#default_value' => variable_get('performance_query', 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.'),
);
$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 and using APC, only pages with the number of accesses larger than the specified threshold will be shown. Also, when cron runs, pages with that number of accesses or less will be removed, so as not to overflow APC\'s shared 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.'),
);
return system_settings_form($form);
}
function performance_boot() {
register_shutdown_function('performance_shutdown');
if (variable_get('performance_query', 0)) {
//TODO: See if devel.module has changed this ...
@include_once DRUPAL_ROOT . '/includes/database/log.inc';
Database::startLog('performance', 'default');
}
}
function performance_shutdown() {
$queries = Database::getLog('performance', 'default');
// if ($_GET['q']) {
if (isset($_GET['q']) && ($_GET['q'])) {
// q= has a value, use that for the path
$path = $_GET['q'];
}
else {
// q= is empty, use whatever the site_frontpage is set to
$path = variable_get('site_frontpage', 'node');
}
$params = array(
'timer' => timer_read('page'),
'path' => $path,
);
// Memory
if (function_exists('memory_get_peak_usage')) {
$params['mem'] = memory_get_peak_usage(TRUE);
}
else {
$params['mem'] = 0;
}
// Query time and count
$query_count = 0;
$query_timer = 0;
$sum = 0;
if (variable_get('performance_query', 0) && is_array($queries)) {
foreach ($queries as $query) {
$sum += $query['time'];
$query_count++;
}
$query_timer = round($sum * 1000, 2);
}
$params['query_count'] = $query_count;
$params['query_timer'] = $query_timer;
$anon = (!empty($data['anon']))? 'Yes' : 'No';
$header = array(
'path' => $path,
'timer' => $params['timer'],
'anon' => $anon,
);
module_invoke_all('performance', 'header', $header);
if (variable_get('performance_detail', 0)) {
$data = module_invoke_all('performance', 'data');
$params['data'] = !empty($data[0]) ? $data[0] : NULL;
performance_log_details($params);
}
else {
module_invoke_all('performance', 'disable');
}
if (variable_get('performance_summary_db', 0)) {
performance_log_summary_db($params);
}
if (variable_get('performance_summary_apc', 0)) {
if (function_exists('apc_cache_info')) {
performance_log_summary_apc($params);
}
}
if (variable_get('performance_summary_memcache', 0)) {
if (performance_memcache_enabled()) {
performance_log_summary_memcache($params);
}
}
}
function performance_log_summary_apc($params = array()) {
$key = PERFORMANCE_KEY . $params['path'];
if ($data = apc_fetch($key)) {
$data = array(
'path' => $data['path'],
'last_access' => REQUEST_TIME,
'bytes_max' => max($params['mem'], $data['bytes_max']),
'bytes_avg' => ($data['bytes_avg'] + $params['mem']) / 2,
'ms_max' => max($params['timer'], $data['ms_max']),
'ms_avg' => ($data['ms_avg'] + $params['timer']) / 2,
'query_timer_max' => max($params['query_timer'], $data['query_timer_max']),
'query_timer_avg' => ($data['query_timer_avg'] + $params['query_timer']) / 2,
'query_count_max' => max($params['query_count'], $data['query_count_max']),
'query_count_avg' => ($data['query_count_avg'] + $params['query_count']) / 2,
'num_accesses' => $data['num_accesses'] + 1,
);
}
else {
$data = array(
'path' => $params['path'],
'bytes_max' => $params['mem'],
'bytes_avg' => $params['mem'],
'ms_max' => $params['timer'],
'ms_avg' => $params['timer'],
'query_timer_max' => $params['query_timer'],
'query_timer_avg' => $params['query_timer'],
'query_count_max' => $params['query_count'],
'query_count_avg' => $params['query_count'],
'num_accesses' => 1,
'last_access' => REQUEST_TIME,
);
}
apc_store($key, $data);
}
function performance_log_summary_memcache($params = array()) {
$key = PERFORMANCE_KEY . $params['path'];
if ($cache = cache_get($key, PERFORMANCE_MEMCACHE_BIN)) {
$type = 'existing';
$values = $cache->data;
$values = array(
'path' => $params['path'],
'last_access' => time(),
'bytes_max' => max($params['mem'], $values['bytes_max']),
'bytes_avg' => ($values['bytes_avg'] + $params['mem']) / 2,
'ms_max' => max($params['timer'], $values['ms_max']),
'ms_avg' => ($values['ms_avg'] + $params['timer']) / 2,
'query_timer_max' => max($params['query_timer'], $values['query_timer_max']),
'query_timer_avg' => ($values['query_timer_avg'] + $params['query_timer']) / 2,
'query_count_max' => max($params['query_count'], $values['query_count_max']),
'query_count_avg' => ($values['query_count_avg'] + $params['query_count']) / 2,
'num_accesses' => $values['num_accesses'] + 1,
);
}
else {
$type = 'new';
// It is a new key
$values = array(
'path' => $params['path'],
'bytes_max' => $params['mem'],
'bytes_avg' => $params['mem'],
'ms_max' => $params['timer'],
'ms_avg' => $params['timer'],
'query_timer_max' => $params['query_timer'],
'query_timer_avg' => $params['query_timer'],
'query_count_max' => $params['query_count'],
'query_count_avg' => $params['query_count'],
'num_accesses' => 1,
'last_access' => time(),
);
if ($keys_cache = cache_get(PERFORMANCE_KEY, PERFORMANCE_MEMCACHE_BIN)) {
$keys_values = $keys_cache->data;
}
$keys_values[$key] = 1;
cache_set(PERFORMANCE_KEY, $keys_values, PERFORMANCE_MEMCACHE_BIN, CACHE_PERMANENT);
}
cache_set($key, $values, PERFORMANCE_MEMCACHE_BIN, CACHE_PERMANENT);
}
function performance_log_summary_db($params = array()) {
$row = db_query("SELECT * FROM {performance_summary} WHERE path = :path", array(':path' => $params['path']))->fetch();
if ($row) {
db_update('performance_summary')
->condition('path', $params['path'])
->fields(array(
'last_access' => REQUEST_TIME,
'num_accesses' => $row->num_accesses + 1,
'bytes_max' => max($params['mem'], $row->bytes_max),
'bytes_avg' => ($row->bytes_avg + $params['mem']) / 2,
'ms_max' => max($params['timer'], $row->ms_max),
'ms_avg' => ($row->ms_avg + $params['timer']) / 2,
'query_timer_max' => max($params['query_timer'], $row->query_timer_max),
'query_timer_avg' => ($row->query_timer_avg + $params['query_timer']) / 2,
'query_count_max' => max($params['query_count'], $row->query_count_max),
'query_count_avg' => ($row->query_count_avg + $params['query_count']) / 2,
))
->execute();
}
else {
// First time we log this path, write fresh values
$fields = array(
'last_access' => REQUEST_TIME,
'num_accesses' => 1,
'bytes_max' => $params['mem'],
'bytes_avg' => $params['mem'],
'ms_max' => (int)$params['timer'],
'ms_avg' => (int)$params['timer'],
'query_timer_max' => (int)$params['query_count'],
'query_timer_avg' => (int)$params['query_count'],
'query_count_max' => $params['query_timer'],
'query_count_avg' => $params['query_timer'],
'path' => $params['path'],
);
try {
db_insert('performance_summary')
->fields($fields)
->execute();
}
catch (Exception $e) {
echo $e->getMessage();
}
}
}
function performance_log_details($params = array()) {
global $user;
$fields = array(
'timestamp' => REQUEST_TIME,
'bytes' => $params['mem'],
'ms' => (int)$params['timer'],
'query_count' => $params['query_count'],
'query_timer' => (int)$params['query_timer'],
'anon' => ($user->uid) ? 0 : 1,
'path' => $params['path'],
'data' => $params['data'],
);
try {
db_insert('performance_detail')
->fields($fields)
->execute();
}
catch (Exception $e) {
echo $e->getMessage();
}
}
function performance_apc_list_all() {
$key_list = array();
$list = apc_cache_info('user');
if (!empty($list['cache_list'])) {
foreach ($list['cache_list'] as $cache_id => $cache_data) {
$regex = '/^' . PERFORMANCE_KEY . '/';
if (preg_match($regex, $cache_data['info'])) {
$key_list[] = $cache_data['info'];
}
}
}
return $key_list;
}
/**
* Custom sort for summary performance report
*
* @param $x
* @param $y
* @return int
*/
function performance_summary_sort($x, $y) {
// This function does not work
return;
}
function performance_view_summary() {
global
$pager_page_array, // array of element-keyed current page - 1
$pager_total, // array of element-keyed total number of pages
$pager_total_items, // array of element-keyed total number of data rows
$pager_limits; // array of element-keyed number of rows per page
$sum = array();
$data_list = array();
$rows = array();
$sum[] = variable_get('performance_summary_db', 0);
$sum[] = variable_get('performance_summary_apc', 0);
$sum[] = variable_get('performance_summary_memcache', 0);
$go = array_sum($sum);
if (!$go) {
return t('Summary performance log is not enabled. Go to the <a href="!link">settings page</a> to enable it.',
array('!link' => url('admin/config/development/performance_logging')));
}
$header = array();
$header[] = array('data' => t('Path'), 'field' => 'path');
$header[] = array('data' => t('Last access'), 'field' => 'last_access');
$header[] = array('data' => t('# accesses'), 'field' => 'num_accesses');
$header[] = array('data' => t('MB Memory (Max)'), 'field' => 'bytes_max');
$header[] = array('data' => t('MB Memory (Avg)'), 'field' => 'bytes_avg');
$header[] = array('data' => t('ms (Max)'), 'field' => 'ms_max');
$header[] = array('data' => t('ms (Avg)'), 'field' => 'ms_avg');
if (variable_get('performance_query', 0)) {
$header[] = array('data' => t('Query ms (Max)'), 'field' => 'query_timer_max');
$header[] = array('data' => t('Query ms (Avg)'), 'field' => 'query_timer_avg');
$header[] = array('data' => t('Query Count (Max)'), 'field' => 'query_count_max');
$header[] = array('data' => t('Query Count (Avg)'), 'field' => 'query_count_avg');
}
$total_rows = $shown = $last_max = $total_bytes = $total_ms = $total_accesses = 0;
$last_min = REQUEST_TIME;
$threshold = variable_get('performance_threshold_accesses', 0);
$data_list = array();
$pager_height = 50;
if (variable_get('performance_summary_memcache', 0) && function_exists('dmemcache_set')) {
$tablesort = tablesort_init($header);
// Get the data from memcache
if ($keys_cache = cache_get(PERFORMANCE_KEY)) {