Skip to content
Snippets Groups Projects
Commit 89b402d2 authored by Olav Morken's avatar Olav Morken
Browse files

MemcacheStore: Added getStats() function.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@262 44740490-163a-0410-bde0-09ae8108e29a
parent fdeb756e
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
/* We need access to the configuration from config/config.php. */ /* We need access to the configuration from config/config.php. */
require_once('SimpleSAML/Configuration.php'); require_once('SimpleSAML/Configuration.php');
/* For access to SimpleSAML_Utilities::transposeArray. */
require_once('SimpleSAML/Utilities.php');
/* /*
* This file is part of SimpleSAMLphp. See the file COPYING in the * This file is part of SimpleSAMLphp. See the file COPYING in the
* root of the distribution for licence information. * root of the distribution for licence information.
...@@ -629,5 +632,30 @@ class SimpleSAML_MemcacheStore { ...@@ -629,5 +632,30 @@ class SimpleSAML_MemcacheStore {
return $expireTime; return $expireTime;
} }
/**
* This function retrieves statistics about all memcache server groups.
*
* @return Array with the names of each stat and an array with the value for each
* server group.
*/
public static function getStats()
{
$ret = array();
foreach(self::getMemcacheServers() as $sg) {
$stats = $sg->getExtendedStats();
if($stats === FALSE) {
throw new Exception('Failed to get memcache server status.');
}
$stats = SimpleSAML_Utilities::transposeArray($stats);
$ret = array_merge_recursive($ret, $stats);
}
return $ret;
}
} }
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment