使用curl命令将时间戳和延迟输出到文件

使用curl命令将时间戳和延迟输出到文件,curl,Curl,我使用curl命令来测量日期/时间(或时间戳)以及请求的延迟。在这里,同样的命令被执行1000次,以对系统进行压力测试,我的代码如下: curl-s-v-i-ihttp://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_redirec

我使用
curl
命令来测量日期/时间(或时间戳)以及请求的延迟。在这里,同样的命令被执行1000次,以对系统进行压力测试,我的代码如下:

curl-s-v-i-ihttp://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}、%{time_download}、%{speed_download}、test time_time.txt


我的问题是我一次只能保存一个信息,如果保存了日期,延迟就不能保存,反之亦然。我不熟悉shell命令,所以请告诉我哪里做错了。

谢谢,Maxim我也找到了一种可以帮助我的方法

从timestamp
ts
上的答案中,我尝试了这个方法,效果很好:


curl-s-v-i-ihttp://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},%{size(下载},%{ts'[%Y-%m-%d%H:%S]'>>test_file.txt

对我来说,要么使用,要么像符咒一样有效!