Score:0

How to get actual latency when downloading with curl?

sv flag

I have an http software that let people be logged and download data according to sent bytes. It's an infinite download until connection stopped. I want to know the time for each download.

The connection is like that:

  • Curl start login with header/user etc
  • HTTP server answer and start connection
  • curl send bytes -> the server answer each times

Before, I were using only curl -so /dev/null -w '%{time_total}\n' http://my-ip.com:port/something -u login:passwd to know the total time, but it's only for the connection, not really the actual latency as real users could have, so it's not what I want.

I tried something like that:

curl http://my-ip.com:port/something -u login:passwd --header "Connection: Keep-Alive;User-Agent: curl;<omitted output>" --output "<output file>"

Where

  • omitted output correspond to internal values
  • output file correspond to the answered data by the server

But the -w 'thing' filter no longer works, as the request never finished. How can I make it works to get the latency each time I get answer?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.