Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trsnium/indulgences
📚Distributed load test framework
https://github.com/trsnium/indulgences
distributed elixir load-testing
Last synced: 25 days ago
JSON representation
📚Distributed load test framework
- Host: GitHub
- URL: https://github.com/trsnium/indulgences
- Owner: TrsNium
- License: mit
- Created: 2019-08-31T06:07:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-05T21:08:08.000Z (over 1 year ago)
- Last Synced: 2024-10-14T19:04:02.239Z (25 days ago)
- Topics: distributed, elixir, load-testing
- Language: Elixir
- Homepage:
- Size: 102 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Indulgences
![badge](https://action-badges.now.sh/TrsNium/Indulgences?workflow=test)### Work In Progress
- Output report in html format## Usage
Basically you can use like following.
```elixir
Indulgences.Scenario.new("Test Scenario",
fn ->
Indulgences.Http.new("Test Local Request")
|> Indulgences.Http.get("http://localhost")
|> Indulgences.Http.set_header("header", "value")
|> Indulgences.Http.check(
fn(%HTTPoison.Response{}=response, %{}=state)->
Indulgences.Http.is_status(response, 200)
state
|> Map.put(:body, response.body)
end)
|> Indulgences.Http.new("Test Local Request2")
|> Indulgences.Http.get("http://localhost")
|> Indulgences.Http.set_header("set-header-body", fn(state)->Map.get(state, :body)end)
|> Indulgences.Http.check(
fn(%HTTPoison.Response{}=response)->
Indulgences.Http.is_status(response, 200)
end)
end)
|> Indulgences.Scenario.inject(
fn ->
Indulgences.Activation.constant_users_per_sec(100, 10)
end)
|> Indulgences.Simulation.start
```When you wanna use indulgences on a module basis.
```elixir
defmodule Test do
use Indulgences@scenario_title "Test Scenario"
@impl true
def scenario() do
Indulgences.Http.new("Test Local Request")
|> Indulgences.Http.get("https://localhost")
|> Indulgences.Http.set_header("hoge", "huga")
|> Indulgences.Http.check(
fn(%HTTPoison.Response{}=response)->
Indulgences.Http.is_status(response, 404)
end)
end@impl true
def activation() do
Indulgences.Activation.constant_users_per_sec(100, 10)
end
endTest.start
```## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `indulgences` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:indulgences, "~> 0.1.0"}
]
end
```Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/indulgences](https://hexdocs.pm/indulgences).