<<
path:
root/public/blog.git/html/tests/main.jai
blob: 6555d29eea30d1bdccc8ff478c7b9800d5d59ce9
[raw]
[clear marker]
6#load "backend_curl.jai";
7#load "backend_socket.jai";
10/** Stress test with wrk
12 wrk -t12 -c400 -d30s http://127.0.0.1:8081/search?q=test+rust
14 t = threads c = connections d = duration
16 First run achieved 4,7k rps - without the server crashing.
17 But it was busy closing FDs for a few seconds.
19 htop -p $(pgrep search)
24 ok, args, is_set := parse_arguments(Args);
32 if is_set.curl { curl_dispatch(args, is_set); }
33 else if is_set.sock { socket_dispatch(args, is_set); }
35 log_error("No backend set");
44HELP :: #string STR_END
45Usage: tests [q | cq] [os | stream [d]]
49 Simple one-shot GET request
55 One-Shot with predefined query
56 `tests -os get -q umlaut`
58 One-Shot with custom query
59 `tests -os get -cq http://localhost:8080/?ts=123`
61 Stream with 3.2 MB payload and dripping in msec
62 `tests -stream 3.2 -d 1600`