fixes for worker process profiling
Signed-off-by: Ava Hahn <a.hahn@f5.com>
This commit is contained in:
parent
71990d3988
commit
78baa850a8
7 changed files with 46 additions and 25 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
N=$(nproc --all)
|
||||
|
||||
function log_request_to () {
|
||||
return_code=$(curl -Sikl -o /dev/null -w "%{http_code}" $1 2>/dev/null)
|
||||
case ${return_code:0:1} in
|
||||
|
|
@ -13,10 +15,6 @@ function log_request_to () {
|
|||
esac
|
||||
}
|
||||
|
||||
function do_wrk_on () {
|
||||
/wrk/wrk -t1 -c10 $1 &
|
||||
}
|
||||
|
||||
function sigint_handler() {
|
||||
jobs -p | xargs kill -9
|
||||
exit
|
||||
|
|
@ -26,10 +24,13 @@ trap 'sigint_handler' INT
|
|||
|
||||
# TODO: make this a more elegant item
|
||||
# maybe a while loop with curl
|
||||
sleep 0.5
|
||||
sleep 2
|
||||
|
||||
for iter in {0.999}; do
|
||||
do_wrk_on "https://kaproxy:8080/$iter"
|
||||
echo "[+] client making request loop"
|
||||
for iter in {0..999}; do
|
||||
((i=i%N)); ((i++==0)) && wait
|
||||
echo "request to $iter"
|
||||
log_request_to "https://kaproxy:8080/$iter" &
|
||||
done
|
||||
|
||||
wait $(jobs -p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue