Skip to content

VladimirRamirez07/k6-github-api-performance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k6 GitHub API Performance Testing

Performance testing suite for the GitHub REST API using k6, Grafana and GitHub Actions.

GitHub Actions k6 JavaScript Grafana GitHub Actions License Docker

🎯 Test Scenarios

Script Type VUs Description
search-repos.js Load Test 2 Repository search under sustained load
list-issues.js Load Test 5 Issue listing across popular repos
traffic-spike.js Spike Test 2→8→2 Traffic burst simulation with recovery

✅ Thresholds

Metric Threshold
http_req_duration p(95) < 3000ms
http_req_failed rate < 5%

🚀 Run Locally

k6 run -e GITHUB_TOKEN=your_token tests/search-repos.js
k6 run -e GITHUB_TOKEN=your_token tests/list-issues.js
k6 run -e GITHUB_TOKEN=your_token tests/traffic-spike.js

📊 Local Visualization (Grafana + InfluxDB)

# Start InfluxDB and Grafana
docker compose up -d

# Run tests sending metrics to InfluxDB
k6 run -e GITHUB_TOKEN=your_token --out influxdb=http://localhost:8086/k6 tests/search-repos.js

Open Grafana at http://localhost:3001 (user: admin, password: admin)
Import grafana/dashboard.json to visualize results.

📁 Project Structure

k6-github-api-performance/
├── .github/
│   └── workflows/
│       └── performance.yml
├── config/
│   └── thresholds.js
├── grafana/
│   └── dashboard.json
├── tests/
│   ├── search-repos.js
│   ├── list-issues.js
│   └── traffic-spike.js
├── .gitignore
├── docker-compose.yml
└── README.md

🛠️ Tech Stack

  • k6 — Performance testing engine
  • JavaScript — Test scripting
  • GitHub Actions — CI/CD automation
  • Grafana — Metrics visualization
  • InfluxDB — Metrics storage
  • Docker — Container orchestration

👤 Author

LinkedIn GitHub

About

Performance testing suite for the GitHub REST API using k6, Grafana and GitHub Actions. Covers repo search, issue listing and traffic spike scenarios with defined thresholds.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors