cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Wrong total_count ?

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Sat, 9 Jul 2016 16:22:06 -0400

On Sat, Jul 9, 2016 at 1:33 PM, Jan Birk <jan.g.birk_at_gmail.com> wrote:

> Hi,
>
> I am not sure I understand the -w option completely :
>
> Using
>
> curl -w @curl-format.txt .....
>
> and curl-format.txt is:
> ---------------
> cat curl-format.txt
> time_namelookup: %{time_namelookup}\n
> time_connect: %{time_connect}\n
> time_appconnect: %{time_appconnect}\n
> time_pretransfer: %{time_pretransfer}\n
> time_redirect: %{time_redirect}\n
> time_starttransfer: %{time_starttransfer}\n
> -------------------- ---------------------\n
> time_total (sec): %{time_total}\n
>
> The %time_total don’t add up? It gives:
>
> time_namelookup: 0,125
> time_connect: 0,127
> time_appconnect: 0,000
> time_pretransfer: 0,127
> time_redirect: 0,000
> time_starttransfer: 0,160
> -------------------- ---------------------
> time_total (sec): 0,160
>
>
> Isn't time_total supposed to be the sum of all variables or are some of
> the variable not included or included?

Some of those timings overlap. From the man page:

time_namelookup - the time, in seconds, it took from the start until the
name resolving was completed.

time_connect - the time, in seconds, it took from the start until the TCP
connect to the remote host (or proxy) was completed.

time_pretransfer - the time, in seconds, it took from the start until the
file transfer was just about to begin.

So, time_connect includes the time taken to do the name lookup, and
time_pretransfer includes time_connect.

Ralph Mitchell

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-07-09