https://github.com/ukho/k6-workshop
https://github.com/ukho/k6-workshop
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ukho/k6-workshop
- Owner: UKHO
- License: mit
- Created: 2021-10-31T14:30:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-20T16:38:47.000Z (over 2 years ago)
- Last Synced: 2025-10-22T10:55:43.442Z (9 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# K6 Workshop
The workshop is designed for a novice to get started writing some load tests. These are written using [K6](https://k6.io)
This repository contains the instructions for the UKHO K6 workshop, some example code for each exercise and the code for the mock API that will be load tested.
## Pre-requisites
- k6 [installed](https://k6.io/docs/getting-started/installation/)
- Grafana Cloud [account](https://grafana.com/auth/sign-up/create-user?pg=prod-cloud&plcmt=hero-btn-1) created
- IDE (VS Code recommended)
- This repo cloned onto your local dev environment
- A running instance of the 'Cricket API'. This will either be provided by the person running the workshop, or you can run this locally (open /sut/CricketAPI.sln in Visual Studio and run; it requires .Net 8).
You will need the following information to run exercise 2 onwards:
- The host name of the system you are going to load (`SUT_HOSTNAME`) which will be given to you at the start of the workshop
- Your personal API token which can be found in your Grafana Cloud account settings (`API_TOKEN`)
You will see these labels referenced in the exercises in { }. Substitute in the correct values.
## How to do the workshop
This workshop sets you some load testing challenges, in /exercises/EXERCISES.md, to be solved using K6
If you are confident with coding each exercise can be solved by reading the referenced documentation. If you are less confident, or get stuck, each exercise has a suggested solution in the /exercises/src folder which you can play around with instead.
Most of exercises involve calling a "Cricket API". At the start of the workshop, you will be given the host name for this service (SUT_HOSTNAME). More information on the API can be found at http://{SUT_HOSTNAME}/swagger
If you run the Cricket API locally from Visual Studio then SUT_HOSTNAME will be localhost:7258