Dies ist eine modifizierte Version von Simons Antwort, die die mehrzeilige Ausgabe zu einer einzigen Zeile macht. Es führt auch den aktuellen Zeitstempel ein, damit es einfacher ist, jede Ausgabezeile zu verfolgen.
Beispiel Formatdatei
$ cat time-format.txt
time_namelookup:%{time_namelookup} time_connect:%{time_connect} time_appconnect:%{time_appconnect} time_pretransfer:%{time_pretransfer} time_redirect:%{time_redirect} time_starttransfer:%{time_starttransfer} time_total:%{time_total}\n
Beispielbefehl
$ while [ 1 ];do echo -n "$(date) - " ; curl -w @time-format.txt -o /dev/null -s https://myapp.mydom.com/v1/endpt-http; sleep 1; done | grep -v time_total:0
Ergebnisse
Mon Dec 16 17:51:47 UTC 2019 - time_namelookup:0,004 time_connect:0,015 time_appconnect:0,172 time_pretransfer:0,172 time_redirect:0,000 time_starttransfer:1,666 time_total:1,666
Mon Dec 16 17:51:50 UTC 2019 - time_namelookup:0,004 time_connect:0,015 time_appconnect:0,175 time_pretransfer:0,175 time_redirect:0,000 time_starttransfer:3,794 time_total:3,795
Mon Dec 16 17:51:55 UTC 2019 - time_namelookup:0,004 time_connect:0,017 time_appconnect:0,175 time_pretransfer:0,175 time_redirect:0,000 time_starttransfer:1,971 time_total:1,971
Mon Dec 16 17:51:58 UTC 2019 - time_namelookup:0,004 time_connect:0,014 time_appconnect:0,173 time_pretransfer:0,173 time_redirect:0,000 time_starttransfer:1,161 time_total:1,161
Mon Dec 16 17:52:00 UTC 2019 - time_namelookup:0,004 time_connect:0,015 time_appconnect:0,166 time_pretransfer:0,167 time_redirect:0,000 time_starttransfer:1,434 time_total:1,434
Mon Dec 16 17:52:02 UTC 2019 - time_namelookup:0,004 time_connect:0,015 time_appconnect:0,177 time_pretransfer:0,177 time_redirect:0,000 time_starttransfer:5,119 time_total:5,119
Mon Dec 16 17:52:08 UTC 2019 - time_namelookup:0,004 time_connect:0,014 time_appconnect:0,172 time_pretransfer:0,172 time_redirect:0,000 time_starttransfer:30,185 time_total:30,185
Mon Dec 16 17:52:39 UTC 2019 - time_namelookup:0,004 time_connect:0,014 time_appconnect:0,164 time_pretransfer:0,164 time_redirect:0,000 time_starttransfer:30,175 time_total:30,176
Mon Dec 16 17:54:28 UTC 2019 - time_namelookup:0,004 time_connect:0,015 time_appconnect:3,191 time_pretransfer:3,191 time_redirect:0,000 time_starttransfer:3,212 time_total:3,212
Mon Dec 16 17:56:08 UTC 2019 - time_namelookup:0,004 time_connect:0,015 time_appconnect:1,184 time_pretransfer:1,184 time_redirect:0,000 time_starttransfer:1,215 time_total:1,215
Mon Dec 16 18:00:24 UTC 2019 - time_namelookup:0,004 time_connect:0,015 time_appconnect:0,181 time_pretransfer:0,181 time_redirect:0,000 time_starttransfer:1,267 time_total:1,267
Ich habe das oben genutzt, um langsame Antworten auf den genannten Endpunkt zu erfassen.