mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Script to check memcache stats.
This commit is contained in:
parent
e94b49b6af
commit
8d96cf2bd3
26
webtools/addons/shared/bin/memcache-stats.php
Normal file
26
webtools/addons/shared/bin/memcache-stats.php
Normal 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.");
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user