Mozilla/mozilla/webtools/addons/shared/bin/memcache-stats.php
mike.morgan%oregonstate.edu b19a556193 Script to check memcache stats.
git-svn-id: svn://10.0.0.236/trunk@193629 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-05 21:40:57 +00:00

27 lines
683 B
PHP

<?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.");
}
?>