菏澤網(wǎng)站建設(shè)公司有哪些百度公司地址在哪里
關(guān)注wx: CodingTechWork
引言
??在服務(wù)器中通過(guò)curl命令調(diào)用接口時(shí),我們經(jīng)常需要分析一些時(shí)長(zhǎng)。本文主要總結(jié)兩種方式進(jìn)行處理。
curl命令
使用time命令
time curl -k -u '<username>':'<password>' https://127.0.0.1/xxxx -vvv
使用文本
編寫time.txt
time_namelookup: %{time_namelookup}s\ntime_connect: %{time_connect}s\ntime_appconnect: %{time_appconnect}s\ntime_pretransfer: %{time_pretransfer}s\ntime_redirect: %{time_redirect}s\ntime_starttransfer: %{time_starttransfer}s\n----------\ntime_total: %{time_total}s\n
命令
curl -k -u '<username>':'<password>' https:///127.0.0.1/xxxx -vvv -w "@time.txt"