• Stars
    star
    5,588
  • Rank 7,027 (Top 0.2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

curl statistics made simple

httpstat

screenshot

httpstat visualizes curl(1) statistics in a way of beauty and clarity.

It is a single file🌟 Python script that has no dependencyπŸ‘ and is compatible with Python 3🍻.

Installation

There are three ways to get httpstat:

  • Download the script directly: wget https://raw.githubusercontent.com/reorx/httpstat/master/httpstat.py

  • Through pip: pip install httpstat

  • Through homebrew (macOS only): brew install httpstat

For Windows users, @davecheney's Go version is suggested. β†’ download link

Usage

Simply:

python httpstat.py httpbin.org/get

If installed through pip or brew, you can use httpstat as a command:

httpstat httpbin.org/get

cURL Options

Because httpstat is a wrapper of cURL, you can pass any cURL supported option after the url (except for -w, -D, -o, -s, -S which are already used by httpstat):

httpstat httpbin.org/post -X POST --data-urlencode "a=b" -v

Environment Variables

httpstat has a bunch of environment variables to control its behavior. Here are some usage demos, you can also run httpstat --help to see full explanation.

  • HTTPSTAT_SHOW_BODY

    Set to true to show response body in the output, note that body length is limited to 1023 bytes, will be truncated if exceeds. Default is false.

  • HTTPSTAT_SHOW_IP

    By default httpstat shows remote and local IP/port address. Set to false to disable this feature. Default is true.

  • HTTPSTAT_SHOW_SPEED

    Set to true to show download and upload speed. Default is false.

    HTTPSTAT_SHOW_SPEED=true httpstat http://cachefly.cachefly.net/10mb.test
    
    ...
    speed_download: 3193.3 KiB/s, speed_upload: 0.0 KiB/s
  • HTTPSTAT_SAVE_BODY

    By default httpstat stores body in a tmp file, set to false to disable this feature. Default is true

  • HTTPSTAT_CURL_BIN

    Indicate the cURL bin path to use. Default is curl from current shell $PATH.

    This exampe uses brew installed cURL to make HTTP2 request:

    HTTPSTAT_CURL_BIN=/usr/local/Cellar/curl/7.50.3/bin/curl httpstat https://http2.akamai.com/ --http2
    
    HTTP/2 200
    ...

    cURL must be compiled with nghttp2 to enable http2 feature (#12).

  • HTTPSTAT_METRICS_ONLY

    If set to true, httpstat will only output metrics in json format, this is useful if you want to parse the data instead of reading it.

  • HTTPSTAT_DEBUG

    Set to true to see debugging logs. Default is false

For convenience, you can export these environments in your .zshrc or .bashrc, example:

export HTTPSTAT_SHOW_IP=false
export HTTPSTAT_SHOW_SPEED=true
export HTTPSTAT_SAVE_BODY=false

Related Projects

Here are some implementations in various languages:

  • Go: davecheney/httpstat

    This is the Go alternative of httpstat, it's written in pure Go and relies no external programs. Choose it if you like solid binary executions (actually I do).

  • Go (library): tcnksm/go-httpstat

    Other than being a cli tool, this project is used as library to help debugging latency of HTTP requests in Go code, very thoughtful and useful, see more in this article

  • Bash: b4b4r07/httpstat

    This is what exactly I want to do at the very beginning, but gave up due to not confident in my bash skill, good job!

  • Node: yosuke-furukawa/httpstat

    b4b4r07 mentioned this in his article, could be used as a HTTP client also.

  • PHP: talhasch/php-httpstat

    The PHP implementation by @talhasch

Some code blocks in httpstat are copied from other projects of mine, have a look:

More Repositories

1

awesome-chatgpt-api

Curated list of apps and tools that not only use the new ChatGPT API, but also allow users to configure their own API keys, enabling free and on-demand usage of their own quota.
Python
5,617
star
2

sui2

a startpage for your server and / or new tab page
JavaScript
391
star
3

Share-to-ChatGPT-Shortcut

An Apple Shortcut for sharing text to ChatGPT using personalized prompts
303
star
4

jsoncv

A toolkit for building your CV with JSON and creating stylish HTML/PDF files.
JavaScript
249
star
5

obsidian-paste-image-rename

Renames pasted images and all the other attachments added to the vault
TypeScript
234
star
6

cht-colors

Chinese Traditional Colors
HTML
216
star
7

ai.py

A single-file Python script that interacts with ChatGPT API in the command-line.
Python
114
star
8

python-terminal-color

Drop-in single file library for printing color in terminal
Python
69
star
9

torext

[WORKING ON] The missing tornado mate
Python
61
star
10

minimal-bilibili

η»™δ½ ηΊ―ε‡€ηš„ Bilibili θ§†ι’‘ε‘ηŽ°δ½“ιͺŒ
TypeScript
60
star
11

xiami_exporter

Export your data from Xiami
JavaScript
59
star
12

github-toc-sidebar

Show GitHub Readme TOC as a sidebar
TypeScript
44
star
13

n8n-workflows

My workflows for n8n automation
Python
38
star
14

obsidian-people-link

Easily create links to people within your documents.
TypeScript
37
star
15

obsidian-telegraph-publish

Publish your Obsidian note to a Telegraph page.
TypeScript
36
star
16

refgen

JavaScript
34
star
17

flomo-to-obsidian

JavaScript
30
star
18

cx-extractor

Automatically exported from code.google.com/p/cx-extractor
HTML
29
star
19

autotagger

Tag .mp3 and .m4a audio files from iTunes data automatically.
Python
28
star
20

substance

Extract substance from the web
HTML
23
star
21

obsidian-daily-notes-opener

Easily open daily notes and periodic notes in new pane; customize periodic notes background; quick append new line to daily notes.
TypeScript
21
star
22

project_sketch

A nerd's boilerplate for your Python project.
Python
20
star
23

readability

html main body extractor
HTML
17
star
24

dotfiles

my rcs
Vim Script
15
star
25

deptest

dependent testing framework
Python
15
star
26

chatroom

simple chatroom using tornado long polling feature
JavaScript
14
star
27

rdl

Redis dump & load tool.
Python
12
star
28

squared

JavaScript
11
star
29

simplemongo

A Simple & Clear MongoDB ORM
Python
9
star
30

ts

Twitter Search CLI
Python
9
star
31

xiamifav

xiami html5 client
JavaScript
7
star
32

miniflux-on-railway

miniflux deployed on railway.app
Python
7
star
33

drawtable

Draw ASCII art box with text.
Python
7
star
34

getenv

Environment variable definition with type
Python
7
star
35

userscripts

My UserScripts
JavaScript
7
star
36

blog

HTML
6
star
37

params

A Python package that does better in request parameters validation than django.forms, wtforms, web_args or so.
Python
6
star
38

n8n-on-railway

Shell
6
star
39

eurasia

Automatically exported from code.google.com/p/eurasia
Python
5
star
40

things-to-ticktick

Export tasks from Things.app to TickTick format
Shell
5
star
41

pyconv

Text file code conversion tool
Python
4
star
42

dbflip

flip reading for douban note
JavaScript
4
star
43

beatles

Data and tools to enjoy The Beatles better.
Python
4
star
44

rss-filter

Modify and regenerate RSS source piped in
TypeScript
4
star
45

V2EXWitch

Chrome Extension - V2EX Account Switcher & Notifier
JavaScript
3
star
46

python-playground

Python
3
star
47

scripts

miscellaneous scripts I use
Shell
3
star
48

litekv

Simple kv store for Python
Python
3
star
49

cv

My CV site.
JavaScript
3
star
50

window-opener

TypeScript
3
star
51

pex_uwsgi_demo

Python
3
star
52

json_include

An extension for JSON to support file including
Python
3
star
53

feishu-exporter

Export Feishu docs with ease
JavaScript
3
star
54

fuload

Automatically exported from code.google.com/p/fuload
C++
2
star
55

gouken

Go microservice framework built on top of grpc
Go
2
star
56

aima-python

Automatically exported from code.google.com/p/aima-python
Python
2
star
57

django_starter_pack

My personal starter pack for Django projects
Python
2
star
58

learn_applescript

Notes & code pieces recorded during my exploration to AppleScript.
AppleScript
2
star
59

minireact

A minimal react project boilerplate
JavaScript
2
star
60

stexplorer

Download songs from SongTaste
Python
2
star
61

gopkg_opml

Python
1
star
62

qdan-archives

my archives on qdan.me
CSS
1
star
63

papermodx-example

HTML
1
star
64

rime_dict

Tools for manipulating userdict of rime input method
Python
1
star
65

pinback

Pinboard backup tool
Python
1
star
66

apibox

[WORKING ON] Building blocks for HTTP API development
Python
1
star
67

learn_spider

Practicing code to learn to write a spider
Python
1
star
68

whuspec

My graduation project.
HTML
1
star
69

obsidian-chatgpt

TypeScript
1
star
70

go-to-douban

I am Xiao Meng, and I want to work in Douban, I create this repository for announcing and yelling
1
star
71

start

Shell
1
star
72

python-installer

Shell
1
star
73

printable-css

HTML
1
star
74

kindle_ebook_template

for publishing kindle ebook - specially for chinese
1
star
75

pinyindep

essentials for implement pinyin transforming capability in your projects with python
Python
1
star
76

quiverweb

Web service for Quiver note app
Python
1
star
77

gatsby-starter-netlify-cms

JavaScript
1
star
78

alfred-workflows

my alfred workflows
Python
1
star
79

awesome-javascript-editors

A collection of awesome javascript editors
1
star
80

torext-admin

Python
1
star
81

html-cutter

A Chrome extension to cut out HTML fragments from a page.
JavaScript
1
star
82

simplate

Created with CodeSandbox
JavaScript
1
star
83

tomorrow

A new task scheduler, aimed at quick, clean, and clear
1
star
84

webpack-chrome-boilerplate

A boilerplate for building Chrome extensions with Webpack
TypeScript
1
star
85

SMU-MScCDA-ProgrammingTest-2023

Python
1
star
86

nasdaqtrader-rss

Python
1
star
87

n8n-on-fly

1
star
88

proto-typist

generate proto code from proto code
Python
1
star
89

project-nowhere

Automatically exported from code.google.com/p/project-nowhere
PHP
1
star