Load test framework, written in Elixir, that targets HTTP APIs.
It is currently only able to run from the command line, but I have plans to integrate it into a web-based interface built in Phoenix (inspired by Locust).
If you have Elixir 1.15+ installed you can install blast
as an escript:
$ mix do escript.build + escript.install
If you're using nix checkout the flake!
As mentiod above, it is currently only supported running from your shell.
When started a simple non-interactive TUI will appear that renders the status of the application: requests per second, which requests are sent, etc.
However, to be able to start blast
you need a spec file.
The spec file defines which requests to send and is written in YAML.
By default blast will lock for blast.y[a]ml
in the current working directory,
but you can point to another file with the --specfile
option.
Example:
base-url: http://localhost:8080
requests:
- path: "/test"
- path: "/withbody"
method: post
body: "{\"test\": true}"
headers:
- name: content-type
value: application/json
You can read more about it in the docs.
Blast support hooks via external Elixir modules using the --hooks FILEPATH
option.
This will load a filepath as an elixir file, expecting a single module that exports zero or more hooks.
You can read more about it in the docs.
I recommend using the nix flake, like so:
$ nix develop # It takes a while the first time
...
$ mix deps.get # Fetch dependencies
You can start blast using:
$ mix run --no-halt main.exs [ARGS]