ToolFk is a free test kit that programmers use online. ToolFk focuses on the tools that programmers use every day. You don’t need to install any software, just paste the content and press the execute button to get the results you want. ToolFk also supports BarCode BarCode generation online, QueryList collector, PHP code running online, PHP obfuscation, encryption, decryption, Python code online running, JavaScript online running, YAML Formatting Tool, HTTP simulation query tool, HTML online toolbox, JavaScript online toolbox, CSS online toolbox, JSON online toolbox, Unixtime timestamp conversion, Base64/URL/N Ative2Ascii conversion, CSV conversion toolbox, XML online toolbox, WebSocket online tool, Markdown online toolbox, Htaccess2nginx Transition, hexadecimal conversion online, online encryption tool box, pseudo original tools online, online APK decompiling, online web page screenshots tools, online random password generation, online generated qr code Qrcode, online Crontab expression, online short url generation, on-line calculator tool, commonly used Linux command daquan, text comparison tool, in the online Line mind mapping tool, online database design tool, free CDN acceleration service, online stress testing tool. Such as more than 20 daily programmer development tools, is a very comprehensive programmer toolbox site.


Site name: ToolFk Site Link: www.toolfk.com/ Tool link: www.toolfk.com/tool-online…

The code of teaching

This tool/online stress test tools rely on the code base for https://github.com/rakyll/hey

STEP 1



STEP 2

The core code is as follows

 #-n Number of requests to run. Default is 200.
 $number_n   =   intval(request('n', 200));$number_n   =   $number_n> 10000? 10000:$number_n;
 $number_n   =   $number_nThe < 10? 10:$number_n;

 $cmd. =" -n {$number_n}";

 #-c Number of requests to run concurrently. Total number of requests cannot be smaller than the concurrency level. Default is 50.
 $number_c   =   intval(request('c', 50));$number_c   =   $number_c> 1000? 1000:$number_c;
 $number_c   =   $number_cThe < 10? 10:$number_c;
 $cmd. =" -c {$number_c}";

 #Rate limit, in queries per second (QPS). Default is no Rate limit.
 $number_q   =   intval(request('q', 0));$number_q   =   $number_q> 1000? 1000:$number_q;
 $number_q   =   $number_q< 0? Zero:$number_q;
 if($number_q) {$cmd. =" -q {$number_q}";
 }


 #-z How long to execute
 $number_z   =   intval(request('z', 0)); //10s,3m$number_z   =   $number_z> 60? 60:$number_z; # 60 s at most
 $number_z   =   $number_z< 0? Zero:$number_z;
 if($number_z) {$cmd. =" -z {$number_z}";
 }

 #-m HTTP method, one of GET, POST, PUT, DELETE, HEAD, OPTIONS.
 $number_m   =   request('m'.'GET'); //GET,POSTif(! in_array($number_m["GET"."POST"])){
     $number_m = "GET";
 }

 $cmd. =" -m {$number_m}";


 # -t Timeout for each request in seconds. Default is 20, use 0 for infinite.
 $number_t   =   intval(request('t', 20));$number_t   =   $number_t> 60? 60:$number_t; # 60 s at most
 $number_t   =   $number_t< 0? Zero:$number_t;

 if($number_t) {$cmd. =" -t {$number_t}";
 }


 # -T Content-type, defaults to "text/html".
 $number_T     =   request('T'."text/html");
 if(! in_array($number_T["text/html"."application/json"."multipart/form-data"])){
     $number_T = "text/html";
 }

 $cmd. =" -T {$number_T}";


 # -d HTTP request body.
 $number_d     =   request('d');
 if($number_m= ="POST") {$cmd. =" -d {$number_d}";
 }

// \App\Helper\UtilsHelper::log_debug("CMD".$cmd);
 $cmd. ="2 > &1";
 $content      =   shell_exec($cmd);Copy the code


This paper links: www.hihubs.com/article/395