https://github.com/form3tech-oss/f1-example
An example of writing asynchronous load tests using f1
https://github.com/form3tech-oss/f1-example
golang load-generator load-testing performance performance-testing
Last synced: 11 months ago
JSON representation
An example of writing asynchronous load tests using f1
- Host: GitHub
- URL: https://github.com/form3tech-oss/f1-example
- Owner: form3tech-oss
- License: apache-2.0
- Created: 2022-02-21T16:35:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-07T12:18:55.000Z (over 3 years ago)
- Last Synced: 2023-03-02T15:18:47.977Z (over 3 years ago)
- Topics: golang, load-generator, load-testing, performance, performance-testing
- Language: Go
- Homepage:
- Size: 2.83 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# F1 example
This repo demonstrates the use of [`f1`](https://github.com/form3tech-oss/f1) to load test services which provide feedback to the caller asynchonously.
This is demonstrated in this repo by a service (`./cmd/service/main.go`) which accepts HTTP POST request on `/payments` and responds with a `202 Accepted` to indicate that background work will be taking place.
When this "payment" is processed, an SQS message is sent to a local mock of SQS that uses `goaws` (see `docker-compose.yml` file for details.
A load test has been written using `f1` (`./cmd/f1/main.go`) which exercises this flow by making an HTTP POST request, and then waiting for a corresponding message to be delivered on the SQS queue.
## Usage
1. Run the docker compose file: `docker-compose up -d`.
2. Run a load test `go run ./cmd/f1/main.go run constant -r 1/s -d 10s -v testScenario`.