downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.memcache-getextendedstats.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.memcache.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.memcache-getextendedstats.php',
   
1 => 'Memcache::getExtendedStats',
  ),
 
'up' =>
  array (
   
0 => 'ref.memcache.php',
   
1 => 'Memcache Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.memcache-get.php',
   
1 => 'Memcache::get',
  ),
 
'next' =>
  array (
   
0 => 'function.memcache-getserverstatus.php',
   
1 => 'Memcache::getServerStatus',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.memcache-getextendedstats" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcache::getExtendedStats</h1>
  <p class="verinfo">(PECL memcache &gt;= 2.0.0)</p><p class="refpurpose"><span class="refname">Memcache::getExtendedStats</span> &mdash; <span class="dc-title">Get statistics from all servers in pool</span></p>

 </div>

 <a name="function.memcache-getextendedstats.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><b>Memcache::getExtendedStats</b></span>
    ([ <span class="methodparam"><span class="type">string</span> <tt class="parameter">$type</tt></span>
   [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$slabid</tt></span>
   [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$limit</tt></span>
  ]]] )</div>


  <p class="para rdfs-comment">
   <b>Memcache::getExtendedStats()</b> 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 <b><tt class="constant">FALSE</tt></b>.
   You can also use the <b>memcache_get_extended_stats()</b> function.
  </p>

  <blockquote><p><b class="note">Note</b>:
  
    This function has been added to Memcache version 2.0.0.
   <br />
  </p></blockquote>
 
 </div>


 <a name="function.memcache-getextendedstats.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">type</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="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 &quot;are
       subject to change for the convenience of memcache developers&quot;.
      </p>
     </dd>

   
    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">slabid</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       Used in conjunction with <i><tt class="parameter">type</tt></i>
 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.
      </p>
     </dd>

   
    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">limit</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       Used in conjunction with <i><tt class="parameter">type</tt></i>
 set to
       cachedump to limit the number of entries to dump. Default value
       is 100.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>


 <a name="function.memcache-getextendedstats.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns a two-dimensional associative array of server statistics or <b><tt class="constant">FALSE</tt></b>
   on failure.
  </p>
 </div>


 <a name="function.memcache-getextendedstats.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 <b>Memcache::getExtendedStats()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;$memcache_obj&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Memcache</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addServer</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addServer</span><span style="color: #007700">(</span><span style="color: #DD0000">'failed_host'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$stats&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getExtendedStats</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$stats</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents para"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [memcache_host:11211] =&gt; Array
        (
            [pid] =&gt; 3756
            [uptime] =&gt; 603011
            [time] =&gt; 1133810435
            [version] =&gt; 1.1.12
            [rusage_user] =&gt; 0.451931
            [rusage_system] =&gt; 0.634903
            [curr_items] =&gt; 2483
            [total_items] =&gt; 3079
            [bytes] =&gt; 2718136
            [curr_connections] =&gt; 2
            [total_connections] =&gt; 807
            [connection_structures] =&gt; 13
            [cmd_get] =&gt; 9748
            [cmd_set] =&gt; 3096
            [get_hits] =&gt; 5976
            [get_misses] =&gt; 3772
            [bytes_read] =&gt; 3448968
            [bytes_written] =&gt; 2318883
            [limit_maxbytes] =&gt; 33554432
        )

    [failed_host:11211] =&gt; false
)
</pre></div>
    </div>
   </div><p>
  </p>
 </div>


 <a name="function.memcache-getextendedstats.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.memcache-getversion.php" class="function" rel="rdfs-seeAlso">Memcache::getVersion()</a> - Return version of the server</li>
    <li class="member"><a href="function.memcache-getstats.php" class="function" rel="rdfs-seeAlso">Memcache::getStats()</a> - Get statistics of the server</li>
   </ul><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites