Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thaddeusjiang/k6-starter
Load testing using k6, InfluxDB + Grafana.
https://github.com/thaddeusjiang/k6-starter
grafana influxdb k6
Last synced: 21 days ago
JSON representation
Load testing using k6, InfluxDB + Grafana.
- Host: GitHub
- URL: https://github.com/thaddeusjiang/k6-starter
- Owner: ThaddeusJiang
- Created: 2021-08-08T14:26:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-12T07:15:43.000Z (over 3 years ago)
- Last Synced: 2024-12-09T09:57:47.966Z (25 days ago)
- Topics: grafana, influxdb, k6
- Language: TypeScript
- Homepage:
- Size: 297 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![banner](assets/ts-js-k6.png)
# Alexander
![.github/workflows/push.yml](https://github.com/k6io/template-typescript/workflows/.github/workflows/push.yml/badge.svg?branch=master)
This repository provides a scaffolding project to start using TypeScript in your k6 scripts.
## Rationale
## Prerequisites
- [docker](https://www.docker.com/get-started)
- [NodeJS](https://nodejs.org/en/download/)
- [Yarn](https://yarnpkg.com/getting-started/install) (optional)## Installation
**Creating a project from the `template-typescript` template**
To generate a TypeScript project that includes the dependencies and initial configuration, navigate to the [template-typescript](https://github.com/k6io/template-typescript) page and click **Use this template**.
![](assets/use-this-template-button.png)
**Install dependencies**
Clone the generated repository on your local machine, move to the project root folder and install the dependencies defined in [`package.json`](./package.json)
```bash
$ yarn install
```## Running the test
To run a test written in TypeScript, we first have to transpile the TypeScript code into JavaScript and bundle the project
```bash
$ yarn build
```This command creates the final test files to the `./dist` folder.
Start InfluxDB and Grafana.
```bash
$ docker-compose up -d \
influxdb \
grafana
```Once that is done, we can run our script the same way we usually do, for instance:
```bash
$ docker-compose run -v \
$PWD/dist:/scripts \
k6 run /scripts/test1.js
```open http://localhost:3000
![](./assets/k6-load-testing-results.jpg)
## How to
1. Write your scenario of load testing
2. Write your test of load testing
3. confirm the result## folder structure
```
.
├── data // Converters for API testing tools TODO: postman / openapi
├── dist
├── grafana
│ ├── dashboards
│ └── datasources
└── src
├── consts
├── fixtures // Your data for your request
└── modules // Your test
└── utils.ts
└────── webpack.config.js
```## TODO:
- [ ] customize Grafana dashboard
- [ ] Group
- [ ] http method
- [ ] Error
- [ ] docs
- [ ] how to debug?
- [ ] isolate apis