Memcached::getStats

(PECL memcached >= 0.1.0)

Memcached::getStats獲取服務器池的統(tǒng)計信息

說明

public Memcached::getStats(): array

Memcached::getStats()返回一個包含所有可用memcache服務器狀態(tài)的數(shù)組. 返回的統(tǒng)計信息的詳細描述參見? memcache protocol。 (譯注:經(jīng)實驗,服務器池中有不可用服務器時,返回false)

參數(shù)

此函數(shù)沒有參數(shù)。

返回值

服務器統(tǒng)計信息數(shù)組, 每個服務器一項。

范例

示例 #1 Memcached::getStats() 示例

<?php
$m 
= new Memcached();
$m->addServer('localhost'11211);

print_r($m->getStats());
?>

以上例程的輸出類似于:

Array
(
    [localhost:11211] => Array
        (
            [pid] => 4933
            [uptime] => 786123
            [threads] => 1
            [time] => 1233868010
            [pointer_size] => 32
            [rusage_user_seconds] => 0
            [rusage_user_microseconds] => 140000
            [rusage_system_seconds] => 23
            [rusage_system_microseconds] => 210000
            [curr_items] => 145
            [total_items] => 2374
            [limit_maxbytes] => 67108864
            [curr_connections] => 2
            [total_connections] => 151
            [connection_structures] => 3
            [bytes] => 20345
            [cmd_get] => 213343
            [cmd_set] => 2381
            [get_hits] => 204223
            [get_misses] => 9120
            [evictions] => 0
            [bytes_read] => 9092476
            [bytes_written] => 15420512
            [version] => 1.2.6
        )

)