1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<refentry xml:id="function.memcache-getextendedstats" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>Memcache::getExtendedStats</refname>
<refpurpose>Get statistics from all servers in pool</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>Memcache::getExtendedStats</methodname>
<methodparam choice="opt"><type>string</type><parameter>type</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>slabid</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>limit</parameter></methodparam>
</methodsynopsis>
<para>
<function>Memcache::getExtendedStats</function> returns a two-dimensional
associative array with server statistics. Array keys correspond to
host:port of server and values contain the individual server statistics.
A failed server will have its corresponding entry set to &false;.
You can also use the <function>memcache_get_extended_stats</function> function.
</para>
<note>
<para>
This function has been added to Memcache version 2.0.0.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
The type of statistics to fetch. Valid values are {reset,
malloc, maps, cachedump, slabs, items, sizes}. According to
the memcached protocol spec these additional arguments "are
subject to change for the convenience of memcache developers".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>slabid</parameter></term>
<listitem>
<para>
Used in conjunction with <parameter>type</parameter> set to
cachedump to identify the slab to dump from. The cachedump
command ties up the server and is strictly to be used for
debugging purposes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>limit</parameter></term>
<listitem>
<para>
Used in conjunction with <parameter>type</parameter> set to
cachedump to limit the number of entries to dump. Default value
is 100.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a two-dimensional associative array of server statistics or &false;
on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>Memcache::getExtendedStats</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$memcache_obj = new Memcache;
$memcache_obj->addServer('memcache_host', 11211);
$memcache_obj->addServer('failed_host', 11211);
$stats = $memcache_obj->getExtendedStats();
print_r($stats);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
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
)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>Memcache::getVersion</function></member>
<member><function>Memcache::getStats</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|