php memcache测试,PHP 监控memcache
PHP 學習監控memcache 的代碼(剛剛學習PHP,感覺功能挺強大的)
下面的代碼是監控了memcache幾個參數 ,通過入數據庫,然后再次展示在頁面中的代碼.具體的代碼如下所示:
Memcache montior ...Memcache Monitor perform. data!
//memcache t����
include 'cmysql.php';
$memcache = new Memcache();
$memcache->connect("10.1.71.102","11211");
$arrConn=$memcache->getstats();
$curr_connections = $arrConn["curr_connections"];
$total_connections = $arrConn["total_connections"];
$get_hits = $arrConn["get_hits"];
$get_misses = $arrConn["get_misses"];
$cmd_get = $arrConn["cmd_get"];
$cmd_set = $arrConn["cmd_set"];
$memcache->close();
//��?�,?��������
$mnow = time();
$sql = "insert into memcache(curr_connections,total_connections,get_hits,get_misses,cmd_get,cmd_set,mdate)values($curr_connections,$total_connections,$get_hits,$get_misses,$cmd_get,$cmd_set,$mnow)";
$mysql = new Mysql();
$mysql->mysql_conn();
$mysql->mysql_insert($sql);
$mysql->mysql_close();
//����?�?��?�?��??��4
$select_sql = "select * from memcache order by mdate limit 10";
$mysql = new Mysql();
$mysql->mysql_conn();
$arrData = $mysql->mysql_select($select_sql);
echo "
echo "
";echo "
curr_connections";echo "
total_connections";echo "
cmd_get";echo "
cmd_set";echo "
get_hits";echo "
get_misses";echo "
delete_hits";echo "
threads";echo "";
foreach ( $arrData as $k => $v ) {
echo"
{$v['curr_connections']}{$v['total_connections']}{$v['cmd_get']}{$v['cmd_set']}{$v['get_hits']}{$v['get_misses']}{$v['delete_hits']}{$v['threads']}";}
echo"
$mysql->mysql_close();
?>
總結
以上是生活随笔為你收集整理的php memcache测试,PHP 监控memcache的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 李彦宏称将引领搜索体验的代际变革 百度要
- 下一篇: 股票加权是什么意思