5 ms·
Timing with Curl (2010)
- dheera 3y agoNit: > 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.
- Jach 3y agoDid they fix it? Triple clicking and pasting doesn't lead to immediate execution for me. 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" }
- kitanata 3y ago[flagged]
- donatj 3y agoOh this is fantastic. I had no idea curl could even do this sort of thing. Every time I think I have my head around everything curl can do, I am proven wrong. It really is an amazing tool that enables so many things.
- solarist 3y agoI had the same reaction upon learning that curl can talk LDAP.
- InvaderFizz 3y agoThat's really cool. TIL. Also, curl can talk ftp, upload and download. Which is super useful when dealing with legacy things.
- naikrovek 3y agoWHAT
- chasil 3y agoIf I download the latest version of curl.exe for Windows, I will find that all of these subsystems are enabled: 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.
- FrenchyJiby 3y agoVery straightforward reason: less capabilities for naughty executables to "live off the land" from. 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.
- chasil 3y agoI didn't really think about it from that perspective. It makes sense.
- flas9sd 3y agogreat for doing measurements in a cron to later plot them. Here someone measured TLS version latencies on gov.uk - https://nooshu.com/blog/2020/07/30/measuring-tls-13-ipv4-ipv6-performance/ https://nooshu.com/blog/2020/07/30/measuring-tls-13-ipv4-ipv... and has a good graph explaining the time_* variables
- tra3 3y agocurl is such an amazing tool. Most of my coworkers are not comfortable with the command line and prefer to use GUI tools like postman. Having curl as part of your shell's history is a minor super power. 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.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- hassy 3y agocurl is fantastic. There's also HTTPStat which provides a waterfall visualization on top of curl timings: https://github.com/reorx/httpstat https://github.com/reorx/httpstat 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/skytrace#skytrace-ping https://github.com/artilleryio/artillery/tree/main/packages/...
- AdamJacobMuller 3y ago--trace-time is also great in curl