MCPcopy
hub / github.com/nakabonne/ali

github.com/nakabonne/ali @v0.8.0 sqlite

repository ↗ · DeepWiki ↗ · release v0.8.0 ↗
197 symbols 528 edges 23 files 61 documented · 31%
README

ali

Release Go Reference

A load testing tool capable of performing real-time analysis, inspired by vegeta and jplot.

Screenshot

ali comes with an embedded terminal-based UI where you can plot the metrics in real-time, so lets you perform real-time analysis on the terminal.

Installation

Binary releases are available through here.

Via Homebrew

brew install nakabonne/ali/ali

Via MacPorts

sudo port selfupdate
sudo port install ali

Via APT

wget https://github.com/nakabonne/ali/releases/download/v0.7.3/ali_0.7.3_linux_amd64.deb
apt install ./ali_0.7.3_linux_amd64.deb

Via RPM

rpm -ivh https://github.com/nakabonne/ali/releases/download/v0.7.3/ali_0.7.3_linux_amd64.rpm

Via Pacman

pacman -S ali

Via APK

After enabling the community repo:

apk add ali

Via Go

Note that you may have a problem because it downloads an untagged binary.

go install github.com/nakabonne/ali@latest

Via Docker

docker run --rm -it nakabonne/ali ali

Usage

Quickstart

ali http://host.xz

Replace http://host.xz with the target you want to issue the requests to. Press Enter when the UI appears, then the attack will be launched with default options (rate=50, duration=10s).

Options

ali -h
Usage:
  ali [flags] <target URL>

Flags:
  -b, --body string                A request body to be sent.
  -B, --body-file string           The path to file whose content will be set as the http request body.
      --cacert string              PEM ca certificate file
      --cert string                PEM encoded tls certificate file to use
  -c, --connections int            Amount of maximum open idle connections per target host (default 10000)
      --debug                      Run in debug mode.
  -d, --duration duration          The amount of time to issue requests to the targets. Give 0s for an infinite attack. (default 10s)
      --export-to string           Export results to the given directory
  -H, --header stringArray         A request header to be sent. Can be used multiple times to send multiple headers.
      --insecure                   Skip TLS verification
      --key string                 PEM encoded tls private key file to use
      --local-addr string          Local IP address. (default "0.0.0.0")
  -M, --max-body int               Max bytes to capture from response bodies. Give -1 for no limit. (default -1)
  -W, --max-workers uint           Amount of maximum workers to spawn. (default 18446744073709551615)
  -m, --method string              An HTTP request method for each request. (default "GET")
      --no-http2                   Don't issue HTTP/2 requests to servers which support it.
  -K, --no-keepalive               Don't use HTTP persistent connection.
      --query-range duration       The results within the given time range will be drawn on the charts (default 30s)
  -r, --rate int                   The request rate per second to issue against the targets. Give 0 then it will send requests as fast as possible. (default 50)
      --redraw-interval duration   Specify how often it redraws the screen (default 250ms)
      --resolvers string           Custom DNS resolver addresses; comma-separated list.
  -t, --timeout duration           The timeout for each request. 0s means to disable timeouts. (default 30s)
  -v, --version                    Print the current version.
  -w, --workers uint               Amount of initial workers to spawn. (default 10)

Examples:
  ali --duration=10m --rate=100 http://host.xz

Author:
  Ryo Nakao <ryo@nakao.dev>

Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

Examples

For basic usage:

ali --rate=500 --duration=5m http://host.xz

For an infinite attack:

ali --duration=0 http://host.xz

For an attack with the POST method:

ali --body-file=/path/to/foo.json --method=POST http://host.xz

Charts

Press l (or h) to switch the displayed chart. On all charts, you can click and drag to select a region to zoom into.

Latency

Screenshot

The X-axis represents the request counts and the Y-axis represents latencies in milliseconds.

Percentiles

Screenshot

You can see how the 50th, 90th, 95th, and 99th percentiles are changing.

Bytes

TBA

Histogram

TBA

Features

Plot in real-time

Screenshot

Visualize the attack progress

This will help you during long tests.

Screenshot

Mouse support

With the help of mum4k/termdash can be used intuitively.

Screenshot

Export results

You can persist load test results for downstream processing.

ali --export-to ./results/

See here more details.

Acknowledgements

This project would not have been possible without the effort of many individuals and projects but especially vegeta for the inspiration and powerful API. Besides, ali is built with termdash (as well as termbox-go) for the rendering of all those fancy graphs on the terminal. They clearly stimulated an incentive to creation. A big "thank you!" goes out to all those who helped.

Extension points exported contracts — how you extend this code

Attacker (Interface)
(no doc) [3 implementers]
attacker/attacker.go
Storage (Interface)
Storage provides goroutine safe capabilities of insertion into and retrieval from the time-series storage. Backed by "na
storage/storage.go
LineChart (Interface)
(no doc) [2 implementers]
gui/widgets.go
Writer (Interface)
(no doc) [2 implementers]
storage/storage.go
Text (Interface)
(no doc) [2 implementers]
gui/widgets.go
Reader (Interface)
(no doc) [2 implementers]
storage/storage.go
Gauge (Interface)
(no doc) [2 implementers]
gui/widgets.go

Core symbols most depended-on inside this repo

Close
called by 29
export/export.go
Write
called by 14
gui/widgets.go
newText
called by 11
gui/widgets.go
Series
called by 10
gui/widgets.go
StartRun
called by 9
export/export.go
durationToMillis
called by 8
attacker/summary.go
WriteResult
called by 8
export/export.go
NewFileExporter
called by 7
export/export.go

Shape

Method 77
Function 73
Struct 37
Interface 8
FuncType 1
TypeAlias 1

Languages

Go100%

Modules by API surface

gui/widgets.mock.go42 symbols
export/export.go22 symbols
attacker/attacker.go16 symbols
gui/widgets.go13 symbols
main.go11 symbols
storage/storage.go10 symbols
export_pending_test.go9 symbols
export_golden_test.go9 symbols
export/export_test.go9 symbols
attacker/fake_attacker.go8 symbols
gui/gui.go7 symbols
gui/drawer.go7 symbols

Dependencies from manifests, versioned

github.com/davecgh/go-spewv1.1.1 · 1×
github.com/gdamore/encodingv1.0.0 · 1×
github.com/golang/mockv1.6.0 · 1×
github.com/influxdata/tdigestv0.0.0-2018071115192 · 1×
github.com/lucasb-eyer/go-colorfulv1.0.3 · 1×
github.com/mailru/easyjsonv0.7.0 · 1×
github.com/mattn/go-runewidthv0.0.12 · 1×
github.com/miekg/dnsv1.1.43 · 1×
github.com/nakabonne/tstoragev0.3.5 · 1×
github.com/nsf/termbox-gov0.0.0-2020110720090 · 1×

For agents

$ claude mcp add ali \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact