PHP.mk документација

Memcache::getStats

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

memcache.getstats.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека memcache.getstats.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
Memcache::getStats

Референца за `memcache.getstats.php` со подобрена типографија и навигација.

memcache.getstats.php

Memcache::getStats

memcache_get_stats

(PECL memcache >= 0.2.0)

Memcache::getStats -- memcache_get_statsДобијте статистика на серверот

= NULL

Memcache::getStats(string $type = ?, int $slabid = ?, int $limit = 100): array|false
memcache_get_stats(
         — Lightweight Directory Access Protocol $memcache,
         string $type = ?,
         int $slabid = ?,
         int $limit = 100
): array|false

Memcache::getVersion() враќа асоцијативен список со статистика на серверот. Клучовите на списокот соодветствуваат на параметрите за статистика, а вредностите на вредностите на параметрите.

Параметри

type
Типот на статистика што треба да се преземе. Валидни вредности се {reset, malloc, maps, cachedump, slabs, items, sizes}. Според спецификацијата на протоколот memcached, овие дополнителни аргументи „се предмет на промена за погодност на развивачите на memcache“.
slabid
Се користи во комбинација со type поставено на cachedump за да се идентификува плочата од која треба да се исфрлат податоци. Командата cachedump го оптоварува серверот и строго треба да се користи за цели на отстранување грешки.
limit
Се користи во комбинација со type поставено на cachedump за да се ограничи бројот на записи што треба да се исфрлат.

Вратени вредности

Враќа асоцијативен список со статистика на серверот или false при неуспех.

Види Исто така

Белешки од корисници 4 белешки

(PECL memcache >= 0.2.0)
19 години пред
pid                        Process id of this server process
uptime                    Number of seconds this server has been running
time                    Current UNIX time according to the server
version                    Version string of this server
rusage_user                Accumulated user time for this process
rusage_system            Accumulated system time for this process
curr_items                Current number of items stored by the server
total_items                Total number of items stored by this server ever since it started
bytes                    Current number of bytes used by this server to store items
curr_connections        Number of open connections
total_connections        Total number of connections opened since the server started running
connection_structures    Number of connection structures allocated by the server
cmd_get                    Cumulative number of retrieval requests
cmd_set                    Cumulative number of storage requests
get_hits                Number of keys that have been requested and found present
get_misses                Number of items that have been requested and not found
bytes_read                Total number of bytes read by this server from network
bytes_written            Total number of bytes sent by this server to network
limit_maxbytes            Number of bytes this server is allowed to use for storage.
Амиангшу С. Босу
пред 17 години
Here is a memcache stats analyzer method that can be used to print memcache stats in a nice informative tabular format.

<?php

function printDetails($status){

echo "<table border='1'>";

        echo "<tr><td>Memcache Server version:</td><td> ".$status ["version"]."</td></tr>";
        echo "<tr><td>Process id of this server process </td><td>".$status ["pid"]."</td></tr>";
        echo "<tr><td>Number of seconds this server has been running </td><td>".$status ["uptime"]."</td></tr>";
        echo "<tr><td>Accumulated user time for this process </td><td>".$status ["rusage_user"]." seconds</td></tr>";
        echo "<tr><td>Accumulated system time for this process </td><td>".$status ["rusage_system"]." seconds</td></tr>";
        echo "<tr><td>Total number of items stored by this server ever since it started </td><td>".$status ["total_items"]."</td></tr>";
        echo "<tr><td>Number of open connections </td><td>".$status ["curr_connections"]."</td></tr>";
        echo "<tr><td>Total number of connections opened since the server started running </td><td>".$status ["total_connections"]."</td></tr>";
        echo "<tr><td>Number of connection structures allocated by the server </td><td>".$status ["connection_structures"]."</td></tr>";
        echo "<tr><td>Cumulative number of retrieval requests </td><td>".$status ["cmd_get"]."</td></tr>";
        echo "<tr><td> Cumulative number of storage requests </td><td>".$status ["cmd_set"]."</td></tr>";

        $percCacheHit=((real)$status ["get_hits"]/ (real)$status ["cmd_get"] *100);
        $percCacheHit=round($percCacheHit,3);
        $percCacheMiss=100-$percCacheHit;

        echo "<tr><td>Number of keys that have been requested and found present </td><td>".$status ["get_hits"]." ($percCacheHit%)</td></tr>";
        echo "<tr><td>Number of items that have been requested and not found </td><td>".$status ["get_misses"]."($percCacheMiss%)</td></tr>";

        $MBRead= (real)$status["bytes_read"]/(1024*1024);

        echo "<tr><td>Total number of bytes read by this server from network </td><td>".$MBRead." Mega Bytes</td></tr>";
        $MBWrite=(real) $status["bytes_written"]/(1024*1024) ;
        echo "<tr><td>Total number of bytes sent by this server to network </td><td>".$MBWrite." Mega Bytes</td></tr>";
        $MBSize=(real) $status["limit_maxbytes"]/(1024*1024) ;
        echo "<tr><td>Number of bytes this server is allowed to use for storage.</td><td>".$MBSize." Mega Bytes</td></tr>";
        echo "<tr><td>Number of valid items removed from cache to free memory for new items.</td><td>".$status ["evictions"]."</td></tr>";

echo "</table>";

    }

?>

Sample usage:
<?php

  $memcache_obj = new Memcache;
  $memcache_obj->addServer('memcache_host', 11211);
   printDetails($memcache_obj->getStats());
?>
mikael at synd dot info
пред 2 години
Official up to date Memcached explanation of stats command output on the github page:

https://github.com/memcached/memcached/blob/master/doc/protocol.txt

Please check you current version
Анонимен
19 години пред
The stats output from this function and what is output from the getExtendedStats() are identical except that getExtendedStats() provides information for all servers used.
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.