本文整理汇总了PHP中sendMemcacheCommand函数的典型用法代码示例。如果您正苦于以下问题:PHP sendMemcacheCommand函数的具体用法?PHP sendMemcacheCommand怎么用?PHP sendMemcacheCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sendMemcacheCommand函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_item
function process_item($i)
{
$name = $i;
$content = sendMemcacheCommand("get {$i}");
if (isset($content['VALUE'])) {
$size = $content['VALUE'][$i]['stat']['size'];
global $total_size;
$total_size += $size;
} else {
$size = "?";
}
return array("size" => $size, "key" => $i);
}
示例2: flushServer
function flushServer($server)
{
list($host, $port) = explode(':', $server);
$resp = sendMemcacheCommand($host, $port, 'flush_all');
return $resp;
}
示例3: flushServer
function flushServer($server)
{
list($host, $port) = get_host_port_from_server($server);
$resp = sendMemcacheCommand($host, $port, 'flush_all');
return $resp;
}
示例4: dumpCacheSlab
function dumpCacheSlab($server, $slabId, $limit)
{
list($host, $port) = explode(':', $server);
$resp = sendMemcacheCommand($host, $port, 'stats cachedump ' . $slabId . ' ' . $limit);
return $resp;
}
示例5: bsize
echo "<tr><td>", $theserver, "</td><td>", $theKey, " <br/>flag:", $r['VALUE'][$theKey]['stat']['flag'], " <br/>Size:", bsize($r['VALUE'][$theKey]['stat']['size']), "</td><td>", chunk_split($r['VALUE'][$theKey]['value'], 40), "</td>", '<td><a href="', $PHP_SELF, '&op=5&server=', (int) $_GET['server'], '&key=', base64_encode($theKey), "\">Delete</a></td>", "</tr>";
echo <<<EOB
</tbody></table>
<hr/>
EOB;
break;
case 5:
// item delete
if (!isset($_GET['key']) || !isset($_GET['server'])) {
echo "No key set!";
break;
}
$theKey = htmlentities(base64_decode($_GET['key']));
$theserver = $GLOBALS['MEMCACHE_SERVERS'][(int) $_GET['server']];
list($h, $p) = explode(':', $theserver);
$r = sendMemcacheCommand($h, $p, 'delete ' . $theKey);
echo 'Deleting ' . $theKey . ' : ' . $r;
break;
case 6:
// flush server
$theserver = $GLOBALS['MEMCACHE_SERVERS'][(int) $_GET['server']];
$r = flushServer($theserver);
echo 'Flush ' . $theserver . " : " . $r;
break;
case 7:
// flush stats
$theserver = $GLOBALS['MEMCACHE_SERVERS'][(int) $_GET['server']];
$r = flushStats($theserver);
echo 'Stats reset ' . $theserver . " : " . print_r($r, true);
break;
case 8:
示例6: sendMemcacheCommand
}
}
return $res;
}
$server = $_GET['server'];
$port = $_GET['port'];
if ($server == '') {
$server = 'localhost';
}
if ((int) $port == 0) {
$port = 11211;
}
$stats = sendMemcacheCommand($server, $port, "stats");
$stats = $stats['STAT'];
// calc the amount of memory designated to items of certain size
$stats_slabs = sendMemcacheCommand($server, $port, "stats slabs");
$stats_slabs = $stats_slabs['STAT'];
$slabs = array();
$below1mb = 0;
$below200k = 0;
$below50k = 0;
$below4k = 0;
$below1k = 0;
$below400b = 0;
foreach ($stats_slabs as $name => $value) {
$parts = explode(':', $name);
$slabs[$parts[0]][$parts[1]] = $value;
}
foreach ($slabs as $slab => $values) {
if ($values["chunk_size"] <= 400) {
$below400b += $values["total_pages"] * 1024 * 1024;