Script to check memcache stats.

This commit is contained in:
mike.morgan%oregonstate.edu 2006-04-05 21:40:57 +00:00
parent e94b49b6af
commit 8d96cf2bd3

View File

@ -0,0 +1,26 @@
<?php
/**
* memcache configuration.
*
* The memcache_config array lists all possible memcached servers to use in case the default server does not have the appropriate key.
*/
require_once('../../public/inc/config.php');
$memcacheConnected = false;
$cache = new Memcache();
foreach ($memcache_config as $host=>$options) {
if ($cache->addServer($host, $options['port'], $options['persistent'], $options['weight'], $options['timeout'], $options['retry_interval'])) {
$memcacheConnected = true;
}
}
if ($memcacheConnected) {
echo '<pre>';
print_r($cache->getExtendedStats());
echo '<pre>';
} else {
die("Unable to connect to any servers.");
}
?>