diff --git a/lib/SimpleSAML/Memcache.php b/lib/SimpleSAML/Memcache.php
index d997498b8c27a42289de6a7ac044e0548f31b1fd..0a0aca682cc1271eb1867f82cd80ec5aa1fdd731 100644
--- a/lib/SimpleSAML/Memcache.php
+++ b/lib/SimpleSAML/Memcache.php
@@ -408,5 +408,23 @@ class SimpleSAML_Memcache {
 		return $ret;
 	}
 
+
+	/**
+	 * Retrieve statistics directly in the form returned by getExtendedStats, for
+	 * all server groups.
+	 *
+	 * @return Array with the extended stats output for each server group.
+	 */
+	public static function getRawStats() {
+		$ret = array();
+
+		foreach(self::getMemcacheServers() as $sg) {
+			$stats = $sg->getExtendedStats();
+			$ret[] = $stats;
+		}
+
+		return $ret;
+	}
+
 }
 ?>
\ No newline at end of file