3

I am using the curl command to measure date/time(or timestamp) also the latency of the request. Here the same command is executed, 1000 times to stress test the system and my code is as follows:

curl -s -v -i -I http://172.16.20.8:8000/files_to_curl/vid.mp4?[1-1000] | grep "Date:","%{http_code},%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer},%{time_total},%{size_download},%{speed_download}\n" >> test_time.txt

My problem is I can only save one information at a time, if Date is saved, latency can't and vise versa. I am new to shell commands so please advise me where I am doing wrong.

  • use either [ab](https://stackoverflow.com/questions/12732182/ab-load-testing) or [curl in parallel](https://stackoverflow.com/a/49401039/12396017) – Maxim Sagaydachny Mar 06 '20 at 12:10

1 Answers1

2

Thanks, Maxim I have also worked out a way which can be helpful.

From this answer on timestamp ts, I tried this and it works well:

curl -s -v -i -I http://xxx.xx.xx.x:8000/files_to_curl/vid.mp4?[1-1000] -o /dev/null -w ",%{http_code},%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer},%{time_total},%{size_download},%{speed_download} \n" | ts '[%Y-%m-%d %H:%M:%S]' >> test_file.txt