   'phpDocumentor\Descriptor\FileDescriptor * hash 931ac998c58c261f9819b695f0a894c7 * pathControllers/Bench.php	 * source^<?php
/**
 * 性能压测
 *
 * @author camera360_server@camera360.com
 * @copyright Chengdu pinguo Technology Co.,Ltd.
 */

namespace PG\MSF\Controllers;

use PG\MSF\Marco;
use PG\MSF\Client\Http\Client;

/**
 * Class Bench
 * @package PG\MSF\Controllers
 */
class Bench extends Controller
{
    private $client;

    public function actionRedisPoolSet()
    {
        $this->getRedisPool('bench')->set('bench_set', 'set')->break();
        $this->outputJson('ok');
    }

    public function actionRedisPoolGet()
    {
        $val = $this->getRedisPool('bench')->get('bench_set');
        $this->getContext()->getOutput()->end($val);
    }

    public function actionRedisGetCallBack()
    {
        if (empty($this->client)) {
            $this->client = new \swoole_redis();
            $this->client->connect('127.0.0.1', 6379, function (\swoole_redis $client, $result) {
                if ($result === false) {
                    $this->getContext()->getOutput()->end("connect to redis server failed");
                    return;
                } else {
                    $this->getContext()->getOutput()->end("connect success");
                }
            });
        } else {
            $this->client->get('bench_set', function (\swoole_redis $client, $result) {
                $this->getContext()->getOutput()->end($result);
            });
        }
    }

    public function actionHttpCallBack()
    {
        $cli = new \swoole_http_client('127.0.0.1', 80);
        $cli->setHeaders([
            'Host' => 'localhost',
        ]);
        $cli->get('/', function($client) {
            $this->getContext()->getOutput()->end($client->body);
        });
    }

    public function actionHttpCoroutine()
    {
        $data = $this->getObject(Client::class)->goSingleGet('http://127.0.0.1/');
        $this->getContext()->getOutput()->end($data['body']);
    }
}
 * namespaceAliases#phpDocumentor\Descriptor\Collection * itemsMarco\PG\MSF\MarcoClient\PG\MSF\Client\Http\Client * includes	  * constants	  * functions	 
 * classes	\PG\MSF\Controllers\Bench(phpDocumentor\Descriptor\ClassDescriptor	 * parent\PG\MSF\Controllers\Controller * implements	  * abstract * final	  * properties	client+phpDocumentor\Descriptor\PropertyDescriptor" * types 
 * default 	 * static * visibilityprivate * fqsen!\PG\MSF\Controllers\Bench::client * name * namespace 
 * package
 * summary * description * fileDescriptor  * line * tags	var	 	 * errors	 (phpDocumentor\Descriptor\Validator\Error * severityerror * codePPC:ERR-50007)
 * context $client * inheritedElement 
 * methods	actionRedisPoolSet)phpDocumentor\Descriptor\MethodDescriptor"public * arguments	 !/\PG\MSF\Controllers\Bench::actionRedisPoolSet()#6$ %&'( )*	return	 param	 ,	 -./0PPC:ERR-50008)2{{ value }}"" actionRedisPoolSet()4 actionRedisPoolGet7"89	 !/\PG\MSF\Controllers\Bench::actionRedisPoolGet()#A$ %&'( )*	;	 <	 ,	 -./0=)2>? actionRedisPoolGet()4 actionRedisGetCallBack7"89	 !3\PG\MSF\Controllers\Bench::actionRedisGetCallBack()#D$ %&'( )"*	;	 <	 ,	 -./0=)"2>? actionRedisGetCallBack()4 actionHttpCallBack7"89	 !/\PG\MSF\Controllers\Bench::actionHttpCallBack()#G$ %&'( )5*	;	 <	 ,	 -./0=)52>? actionHttpCallBack()4 actionHttpCoroutine7"89	 !0\PG\MSF\Controllers\Bench::actionHttpCoroutine()#J$ %&'( )@*	;	 <	 ,	 -./0=)@2>? actionHttpCoroutine()4  * usedTraits	 !#Bench$\PG\MSF\Controllers%PG\MSF\Controllers&Class Bench'(" )*	package	 &phpDocumentor\Descriptor\TagDescriptor#R'P,	 
subpackage	 ,	 4  * interfaces	 	 * traits	 
 * markers	 !#	Bench.php$ %Default&性能压测'( ) *	author	 -phpDocumentor\Descriptor\Tag\AuthorDescriptor#['camera360_server@camera360.com,	 	copyright	 S#^'"Chengdu pinguo Technology Co.,Ltd.,	 R	 S#R'Y,	 T	 ,	 4 