• PHP Video Tutorials

PHP - Memcache::getExtendedStats() Function



Memcache::getExtendedStats() function can get the statistics from all servers in a pool.

Syntax

array Memcache::getExtendedStats([ string $type [, int $slabid [, int $limit = 100 ]]] )

Memcache::getExtendedStats() function can return a two-dimensional associative array with server statistics. Array keys correspond to the host-port of the server, and values contain individual server statistics. A failed server can have its corresponding entry set to false. We can also use the memcache_get_extended_stats() function.

Memcache::getExtendedStats() function can return a two-dimensional associative array of server statistics or false on failure.

Example

<?php
   $memcache_obj = new Memcache;
   $memcache_obj->addServer("memcache_host", 11211);
   $memcache_obj->addServer("failed_host", 11211);
   $stats = $memcache_obj->getExtendedStats();
   
   print_r($stats);
?>
Advertisements