Skip to content

NashTech-Labs/BaseRepositoryForK6AndGrafana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K6 Performance Testing with Grafana

This automation framework contains a performance testing setup using K6, with results stored in InfluxDB and visualized in Grafana.

Introduction

Pre-requisites

  1. Node.js and npm - https://nodejs.org/en/download
  2. Docker and docker compose - https://docs.docker.com/desktop/setup/install/windows-install/
  3. K6 - https://grafana.com/docs/k6/latest/set-up/install-k6/

📂 Project Structure

K6GRAFANA/
├── .github/
│   └── workflows/
│       └── main.yml        # CI/CD with GitHub Actions
├── config/
│   └── option.js           # K6 options (scenarios, thresholds, etc.)
├── data/                   # Static test data
├── helper/
│   ├── apiHelper.js        # Common API request helpers
│   └── dataHelper.js       # Data manipulation helpers
├── scripts/
│   └── grafana.test.js     # Example test script
├── .env                    # Environment variables
├── docker-compose.yml      # Run InfluxDB + Grafana
├── makefile                # Shortcuts for common commands
├── package.json            # Node.js dependencies
└── README.md               # Project documentation

Run Test

Run test in local using command line

make up           # start service: influxdb, grafana
make test         # run test

Run test on Github action

  1. Go to Actions tab
  2. Select k6 Load Test with Docker Compose Actions
  3. Click Run workflow dropdownlist => select branch and click Run workflow button

Monitoring in Grafana

About

BaseRepositoryForK6AndGrafana

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors