Skip to content

The fastest way to load test your APIs. Multi-endpoint, SLA thresholds, and professional visual reports built-in.

Notifications You must be signed in to change notification settings

Roti18/k6-instant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K6 Instant Pro

Preview

This project is designed to run k6 load tests instantly and flexibly with premium visual reporting.

Requirements

  • k6 installed on your system (accessible via command line).
  • PowerShell or Command Prompt.

Project Structure

  • tests/: Contains workload configurations (smoke, slow, hard, spike, soak).
  • utils/: Helper modules for HTTP, environment variables, and report generation.
  • reports/: Storage for test results (HTML and JSON).
  • k6.bat: Main command wrapper to execute tests.

Usage

Use the .\k6 command with the following format:

.\k6 [test_name] [target_url] [paths_list] [api_key]

Command Examples

  1. Running a Smoke Test on Root:
.\k6 smoke http://localhost:3000
  1. Running a Test on Multiple Endpoints Simultaneously:
.\k6 smoke http://localhost:3000 tracks,albums,users
  1. Running a Test with an API Key:
.\k6 smoke http://localhost:3000 tracks,albums secret123
  1. Running a Hard Test (Stress Test) for specific endpoints:
.\k6 hard http://localhost:3000 login,profile
  1. View the HTML Report (File mode):
.\k6 report
  1. View the HTML Report (Server mode - Recommended for logs):
.\k6 server
  1. Cleaning the Reports Folder:
.\k6 clean

Shortcuts via npm

If you prefer using npm, you can use these shortcuts:

  • npm run k6 -- smoke http://localhost:3000 (Run test)
  • npm run report (Open file directly)
  • npm run server (Live preview with logs)
  • npm run clean (Clear all report files)

Test Profiles

  • smoke: 1 user, 10s duration. Best for quick verification if the API is up.
  • slow: Constant arrival rate configuration. Best for long-term stability testing.
  • hard: Stress test with gradual load increases up to high levels.
  • spike: Sudden traffic surges to test server resilience against unexpected shocks.
  • soak: Sustained medium load over long durations to find memory leaks.

Test Reporting

After each test execution, a premium visual report is automatically updated at: reports/summary.html

Open this file in your browser to see latency statistics (P95), success rates, and other metrics in a modern dark-mode dashboard.

Default Configuration

If arguments are not fully provided, the system uses these defaults:

  • Test Name: (Required)
  • Target URL: (Required)
  • Paths List: / (root)
  • API Key: Uses the default value from utils/env.js

About

The fastest way to load test your APIs. Multi-endpoint, SLA thresholds, and professional visual reports built-in.

Topics

Resources

Stars

Watchers

Forks