<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Test_bian extends MY_Controller 
{
    
    private $uid_arr;
    
    /**
    * 解析函数
	* 租售宝测试页面
    */
    public function __construct()
    {
        parent::__construct();
        
        $this->config_cityflag = 'nj';
 
       
 
        //$this->load->model('test_bian_model'); 
		//$this->load->model('broker_model');
    }

	function test(){
		
 
error_reporting(E_ALL);
ini_set("display_errors",TRUE);
   


   

		 $mc = new Memcache;
		 //session存入服务器ip
         $mc->connect('172.17.1.168', 12000) or die ("Could not connect");


		

         //$mc->addServer('172.17.1.97', 12000);

         //$mc->addServer('172.17.1.168', 12000);

         //$mc->addServer('localhost', 11213);

		// $a =  $mc->getStats();

		  //  print_r($a);die;

          //print_r($this->mc->getStats());die;


         //测试172.17.1.22
        $mem_key = '22dddddddddqq11';

		$n=30000;
 
		for($i=0;$i<$n;$i++){
			$mem_key = md5($mem_key.$i);


			//$cache = $mc->get($mem_key);

            //var_dump($cache);
			$temp = "update mobile_taofun_pv set num = num + 1 where  uid = 2432087 and countdate = '2015-06-12' and tbl = 1;update mobile_taofun_pv set num = num + 1 where  uid = 2432087 and countdate = '2015-06-12' and tbl = 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT `valid_flag`, `pic1` FROM (`broker_certificate`) WHERE `uid` = '831056' and kind='p_2' ORDER BY `id` desc;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
select refresh_single_limit,refresh_total_limit,refresh_num_limit from broker_refresh where uid=844916;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
INSERT INTO `log_login` (`kind`, `uid`, `logintime`, `ip`) VALUES ('brokercp', 826937, 1434073205, '49.77.228.114');
update mobile_taofun_pv set num = num + 1 where  uid = 2432087 and countdate = '2015-06-12' and tbl = 1;update mobile_taofun_pv set num = num + 1 where  uid = 2432087 and countdate = '2015-06-12' and tbl = 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT `valid_flag`, `pic1` FROM (`broker_certificate`) WHERE `uid` = '831056' and kind='p_2' ORDER BY `id` desc;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
select refresh_single_limit,refresh_total_limit,refresh_num_limit from broker_refresh where uid=844916;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
INSERT INTO `log_login` (`kind`, `uid`, `logintime`, `ip`) VALUES ('brokercp', 826937, 1434073205, '49.77.228.114');
update mobile_taofun_pv set num = num + 1 where  uid = 2432087 and countdate = '2015-06-12' and tbl = 1;update mobile_taofun_pv set num = num + 1 where  uid = 2432087 and countdate = '2015-06-12' and tbl = 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT `valid_flag`, `pic1` FROM (`broker_certificate`) WHERE `uid` = '831056' and kind='p_2' ORDER BY `id` desc;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
select refresh_single_limit,refresh_total_limit,refresh_num_limit from broker_refresh where uid=844916;
SELECT COUNT(*) AS num FROM growth_bid_attention  WHERE broker_id = '866091' and bid_periods_id='268' limit 1;
INSERT INTO `log_login` (`kind`, `uid`, `logintime`, `ip`) VALUES ('brokercp', 826937, 1434073205, '49.77.228.114');
";
            
            $mc->set($mem_key,$i."aaabbb".$temp,false,300);


		    $cache = $mc->get($mem_key);



            if($cache === false){
				echo $i.'+++++++++++++++++++++ </br>';
			}else{
				echo $i."%%%%%%%%%%%%{$cache} </br> ";
			}


		    // var_dump($cache);die;
			
	        if($i == $n) die('over');
		}
         

 


        //
        $mem_key = 'jjksssss';

		$n=1000;
 
		for($i=0;$i<$n;$i++){
			$mem_key = md5($mem_key.$i);


			$cache = $this->mc->get($mem_key);

            //var_dump($cache);

            $this->mc->set($mem_key,$i,false,300);


		    $cache = $this->mc->get($mem_key);



            if($cache === false){
				echo $i.'+++++++++++++++++++++ </br>';
			}else{
				echo $i."%%%%%%%%%%%%{$cache} </br> ";
			}


		    // var_dump($cache);die;
			
	        if($i == $n) die('over');
		}






	         
	  //$this->test_bian_model->test();

	}
    
    
 
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
