Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Jahmilli/k6-example
https://github.com/Jahmilli/k6-example
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/Jahmilli/k6-example
- Owner: Jahmilli
- License: mit
- Created: 2023-06-05T11:11:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-27T02:45:16.000Z (about 1 year ago)
- Last Synced: 2024-08-02T02:05:41.705Z (4 months ago)
- Language: TypeScript
- Size: 42 KB
- Stars: 9
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-k6 - Jahmilli/k6-example - Starter template using Vite (Rollup) bundler to write k6 tests in TypeScript. (Examples/Templates)
- awesome-k6 - Jahmilli/k6-example - Starter template using Vite (Rollup) bundler to write k6 tests in TypeScript. (Examples/Templates)
README
# K6 Example
This repository contains a starting point for running k6 tests in typescript. It uses a publicly hosted endpoint so that anyone with internet access can test out the API themselves and then use this repo as a starting point to continue building their own tests.
## Pre-Reqs
- Download `k6` from here https://k6.io/docs/get-started/installation/
- Install dependencies `yarn install`
- Docker### Installing xk6-dashboard with Docker
[xk6-dashboard](https://github.com/grafana/xk6-dashboard) is a k6 extension that can be used to visualise your performance test in real time.
To run the tests with monitoring with xk6-dashboard extension, we need to install it. The simplest way to install is via docker and can be done via
`docker pull ghcr.io/grafana/xk6-dashboard:0.6.1`
## Tests
### reqres
We use the [reqres](https://reqres.in/) publicly hosted REST API to showcase the testing with k6
To execute the first sample test that showcases how `per-vu-iterations` works, you can run:
`yarn test:demo`
To test with monitoring in place, run:
`yarn test-with-monitoring:demo`
To execute the second sample test that showcases how to use `stages`, you can run:
`yarn test:demo-stages`
To test with monitoring in place, run:
`yarn test-with-monitoring:demo-stages`