Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Memcache Functions : Memcache::getExtendedStats

Memcache::getExtendedStats

Get statistics from all servers in pool ()
array Memcache::getExtendedStats ( [string type [, int slabid [, int limit]]] )

Example 1315. Memcache::getExtendedStats() 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);
?>

The above example will output:

Array
(
   [memcache_host:11211] => Array
       (
           [pid] => 3756
           [uptime] => 603011
           [time] => 1133810435
           [version] => 1.1.12
           [rusage_user] => 0.451931
           [rusage_system] => 0.634903
           [curr_items] => 2483
           [total_items] => 3079
           [bytes] => 2718136
           [curr_connections] => 2
           [total_connections] => 807
           [connection_structures] => 13
           [cmd_get] => 9748
           [cmd_set] => 3096
           [get_hits] => 5976
           [get_misses] => 3772
           [bytes_read] => 3448968
           [bytes_written] => 2318883
           [limit_maxbytes] => 33554432
       )

   [failed_host:11211] => false
)

Code Examples / Notes » memcache_getextendedstats

alex dot dean

Apparently, a notice-level error is raised when the memcache client discovers a failed memcached server. (mod_php 5.1.2 on Apache 2.2)
<?php
$memcache = new Memcache;
$memcache->addServer( 'good_host.example.com', 11211 );
$memcache->addServer( 'dead_host.example.com', 11211 );
// get stats for all servers
$stats = $memcache->getExtendedStats();
print_r( $stats );
?>
Output includes :
Notice: Memcache::getextendedstats() [function.getextendedstats.html]: marked server 'dead_host.example.com' as failed in memcache.php on line 12


Change Language


Follow Navioo On Twitter
Memcache::add
Memcache::addServer
Memcache::close
Memcache::connect
memcache_debug
Memcache::decrement
Memcache::delete
Memcache::flush
Memcache::get
Memcache::getExtendedStats
Memcache::getServerStatus
Memcache::getStats
Memcache::getVersion
Memcache::increment
Memcache::pconnect
Memcache::replace
Memcache::set
Memcache::setCompressThreshold
Memcache::setServerParams
eXTReMe Tracker