Timing with Curl (2010)
susam.net
susam.net
Also, curl can talk ftp, upload and download. Which is super useful when dealing with legacy things.
C:>curl --version
curl 8.2.1 (x86_64-w64-mingw32) libcurl/8.2.1 OpenSSL/3.1.2 (Schannel) zlib/1.2.13 brotli/1.0.9 zstd/1.5.5 WinIDN libssh2/1.11.0 nghttp2/1.55.1 ngtcp2/0.18.0 nghttp3/0.14.0 libgsasl/2.2.0
Release-Date: 2023-07-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI threadsafe UnixSockets zstd
However, Microsoft also distributes its own version of curl.exe, with vastly less capability: C:\>cd temp
C:\Temp>curl --version
curl 8.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN
Release-Date: 2023-03-20
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets
I don't know why Microsoft removes all of this functionality. They should not do this.Kind of like the sysadmins removing any scripting languages and compilers from servers to avoid giving rogue processes any leg up. It's legitimately making it harder for baddies to exploit a way in. ...Though it's never been easier to package your own interpreter (micropython or equivalent), so I don't expect it slows people down much.
In the mindset of MS: legit devs should package their own tooling, and baddies shouldn't get the freebies.
There's also Skytrace (made by yours truly), which provides timing info as a waterfall visualization inspired by HTTPStat + lots more (syntax highlighting for responses, built-in JMESPath support, command-line assertions and checks etc) - https://github.com/artilleryio/artillery/tree/main/packages/...
> Here is the same command written as a one-liner
Maybe don't include the "\n" in the triple-click selection so that one can inspect it before hitting enter. Currently it copies the "\n" to the clipboard and then when you paste in the terminal it directly executes.
But even better is to just put such commands in .bashrc as functions. e.g.
curltime() {
curl -L -w "time_namelookup: %{time_namelookup}\ntime_connect: %{time_connect}\ntime_appconnect: %{time_appconnect}\ntime_pretransfer: %{time_pretransfer}\ntime_redirect: %{time_redirect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" "$1"
}What was that API end point that was failing 3 months ago with a weird status?
1. Hit C-r for reverse search (bonus if you've got fzf installed) 2. Type a partial URL 3. Identify the curl command you want, and hit enter.
I recently used timing support (as described in the article). I actually found it in AWS docs when I was trying to understand why things weren't as fast as expected. Now it's in permanent record in my shell.
Anyway, +1 for curl.