This is a simple bash script to get the averages of various website response timings using cURL.
sudo apt-get install curl #cURL command line tool
sudo apt-get install bc #bc command line calculator
git clone [email protected]:chentda/curl-average-timings.git
cd curl-average-timings
./curl_average_timings.sh <"URL for website"> <Number of iterations as integer>
./curl_average_timings.sh "https://www.github.com" 10
Averages of response timings:
time_namelookup: .01380
time_connect: .19130
time_appconnect: .88800
time_pretransfer: .88810
time_redirect: 0
time_starttransfer: 1.07660
--------
time_total: 1.07670
cURL Timings Definitions (According to cURL's manual page)
- namelookup: The time, in seconds, it took from the start until the name resolving was completed.
- connect: The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.
- appconnect: The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed.
- pretransfer: The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.
- redirect: The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections.
- starttransfer: The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result.
- total: The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution.