xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
/** monitor begin */
include ‘common.php‘ ;
$host = ‘127.0.0.1‘ ;
$port = 11216;
$objMc = new Memcache();
$objMc ->addServer( $host , $port ,true,1,1,15,true );
$key = ‘test‘ ;
$value = file_get_contents ( ‘b.js‘ );
$str = md5( $value );
dump( $str );
$objMc ->set( $key , $value );
md5( base64_encode (pack( ‘N6‘ , mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), uniqid())));
$rs = $objMc ->get( $key );
dump( md5( $rs ) );
dump( $rs ) ;
$data = xhprof_disable();
include_once "xhprof_lib/utils/xhprof_lib.php" ;
include_once "xhprof_lib/utils/xhprof_runs.php" ;
$objXhprofRun = new XHProfRuns_Default();
$run_id = $objXhprofRun ->save_run( $data , ‘memcache‘ );
/** monitor end */
dump( $run_id );
exit ;
|