#import "Basic"; #import "String"; #import "Print_Vars"; #import "Command_Line"; #load "main.h"; #load "backend_curl.jai"; #load "backend_socket.jai"; /** Stress test with wrk wrk -t12 -c400 -d30s http://127.0.0.1:8081/search?q=test+rust t = threads c = connections d = duration First run achieved 4,7k rps - without the server crashing. But it was busy closing FDs for a few seconds. htop -p $(pgrep search) */ main :: () { ok, args, is_set := parse_arguments(Args); if !ok return; if is_set.h { log(HELP); return; } if is_set.curl { curl_dispatch(args, is_set); } else if is_set.sock { socket_dispatch(args, is_set); } else { log_error("No backend set"); } } #scope_file HELP :: #string STR_END Usage: tests [q | cq] [os | stream [d]] Examples Simple one-shot GET request `tests -os get` Simple stream test `tests -stream 1` One-Shot with predefined query `tests -os get -q umlaut` One-Shot with custom query `tests -os get -cq http://localhost:8080/?ts=123` Stream with 3.2 MB payload and dripping in msec `tests -stream 3.2 -d 1600` STR_END;