Quick download benchmarks with CURL

Posted by nick.stielau on December 07, 2009

CODE:
  1. curl --silent -w "Total:          %{time_total}\nDNS:            %{time_namelookup}\nConnect:        %{time_connect}\nPretransfer:    %{time_pretransfer}\nRedirect:       %{time_redirect}\nStart Transfer: %{time_starttransfer} \n" --output /dev/null google.com

That's about all there is to it. Toss it in your ~/.bash_login thusly:

CODE:
  1. alias dl='curl --silent -w "Total:          %{time_total}\nDNS:            %{time_namelookup}\nConnect:        %{time_connect}\nPretransfer:    %{time_pretransfer}\nRedirect:       %{time_redirect}\nStart Transfer: %{time_starttransfer} \n" --output /dev/null '

And you can access it like this:

CODE:
  1. nick-stielaus-computer-3:~ nick$ dl google.com
  2. Total:          0.205
  3. DNS:            0.053
  4. Connect:        0.126
  5. Pretransfer:    0.126
  6. Redirect:       0.000
  7. Start Transfer: 0.205
  8. nick-stielaus-computer-3:~ nick$ dl bbc.co.uk
  9. Total:          0.614
  10. DNS:            0.221
  11. Connect:        0.414
  12. Pretransfer:    0.414
  13. Redirect:       0.000
  14. Start Transfer: 0.614

Comments

Leave a response

Comments