Visualizzare le statistiche di curl con httpstat

Mattepuffo's logo
Visualizzare le statistiche di curl con httpstat

Visualizzare le statistiche di curl con httpstat

Ho trovato questo script Python, che in pratica ci permette di visualizzare in maniera leggibile le statistiche delle richieste fatte con curl: httpstat!

Se siamo su Debian, possiamo procedere ad installarlo così:

# aptitude install curl python3-pip

Così ci assicuriamo di installare curl (ovviamente richiesto) e pip3 (la versione di pip per Python 3).

Adesso possiamo installare lo script:

# pip3 install httpstat

Procediamo con un esempio:

$ httpstat httpbin.org/get
Connected to 23.21.145.230:80 from 194.1.1.130:59284

HTTP/1.1 200 OK
Connection: keep-alive
Server: meinheld/0.6.1
Date: Mon, 22 May 2017 13:59:57 GMT
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
X-Powered-By: Flask
X-Processed-Time: 0.00100612640381
Content-Length: 213
Via: 1.1 vegur

Body stored in: /tmp/tmpj0or4kdp

  DNS Lookup   TCP Connection   Server Processing   Content Transfer
[    29ms    |      119ms     |       126ms       |        0ms       ]
             |                |                   |                  |
    namelookup:29ms           |                   |                  |
                        connect:148ms             |                  |
                                      starttransfer:274ms            |
                                                                 total:274ms

Enjoy!


Condividi

Commentami!