17 @date_default_timezone_set(@date_default_timezone_get());
19 require_once
'../inc/hce_node_api.inc.php';
20 require_once
'../inc/drce.ini.php';
28 echo
'Client ['.$Client_Identity.
'] conected, start to send '.
$MAX_QUERIES.
' message requests...'.PHP_EOL.PHP_EOL;
40 echo
'request message '.$i.
' ['.$Request_Id.
'] sent...'.PHP_EOL;
44 if($hce_responses[
'error']===0){
45 foreach($hce_responses[
'messages'] as $hce_message){
49 $rjson=json_decode($hce_message[
'body'],
true);
50 if(isset($rjson[
'data'])){
51 $hce_message[
'body']=
cli_prettyPrintJson(json_encode(json_decode($rjson[
'data'],
true)),
' ');
54 echo $hce_message[
'body'];
57 echo PHP_EOL.
'Raw response:'.PHP_EOL.var_export($hce_message).PHP_EOL.
'msg_id=['.$hce_message[
'id'].
']'.PHP_EOL.
'msg_body=['.$hce_message[
'body'].
']'.PHP_EOL.PHP_EOL;
61 echo
'Data field of cover:'.json_decode($hce_message[
'body'],
true)[
'data'].PHP_EOL;
62 foreach($rjson[
'Data'] as $key=>$val){
63 $rjson[
'Data'][$key][
'stdout']=base64_decode($rjson[
'Data'][$key][
'stdout']);
64 $rjson[
'Data'][$key][
'stderror']=base64_decode($rjson[
'Data'][$key][
'stderror']);
66 echo
'Response decoded:'.PHP_EOL.var_export($rjson,
true).PHP_EOL;
68 echo
'Results:'.count($rjson).PHP_EOL;
72 if($hce_responses[
'error']==HCE_PROTOCOL_ERROR_TIMEOUT){
75 echo
'request timeout'.PHP_EOL;
79 echo
'request unknown error'.PHP_EOL;
87 echo PHP_EOL.
'Finished '.
$MAX_QUERIES.
' queries, '.(time()-$t).
' sec, '.floor(
$MAX_QUERIES/(time()-$t+0.00001)).
' rps, '.$Timedout.
' timedout'.PHP_EOL;
91 echo
'Connection create error '.$hce_connection[
'error'].PHP_EOL;