2019年12月26日 星期四

curl check connection time

#!/bin/sh


while :; do

TIME=`date "+%Y%m%d"`
TIMEMM=`date "+%Y-%m-%d %H:%M:%S"`
DELTIME=`date --date='7 days ago' "+%Y%m%d"`
echo $TIMEMM >> /path/8.10_$TIME.txt

curl  --write-out "%{http_code},%{time_total}\n" -X POST https://xxx.xxx.xxx/api                              /product/termproduct \
  -H 'Accept: */*' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Host:xxx.xxx.xxx.xxx:xxxx' \
  -H 'cache-control: no-cache' \
  -d '{
 "Key":"測試"
}' \
--insecure >> /path/8.10_$TIME.txt



echo "" >> /path/8.10_$TIME.txt

sleep 60

rm -rf  /path/8.10_${DELTIME}.txt
done

沒有留言:

張貼留言