k6 Performance Testing

Execute k6 load, smoke, and stress tests against HTTP endpoints and export JSON summaries.

3|Updated May 3, 2026
One-click install
npx skills add https://github.com/ductoanoxo/Agent_SQL --skill k6-performance-testing-ductoanoxo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: k6 Performance Testing
Source: https://github.com/ductoanoxo/Agent_SQL/tree/main/.agents/skills/testing/k6-performance
Command: npx skills add https://github.com/ductoanoxo/Agent_SQL --skill k6-performance-testing-ductoanoxo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

k6 Performance Testing helps teams reliably measure API response time, error rate, and stability under smoke, load, and stress scenarios so performance bottlenecks can be identified before release.

Core Features & Use Cases

  • Scenario-based testing: Run smoke testing for quick validation, load testing for expected traffic levels, and stress testing to find breaking points.
  • K6 scripting for repeatable runs: Define k6 JavaScript test scripts with thresholds (for example, p(95) latency and error rate limits).
  • Machine-readable results for reporting: Export JSON summaries using summary-export so downstream reporting can extract key metrics like p(95), failed request rate, VUs, and request counts.
  • Use Case: Validate that the API health endpoint and critical request paths maintain acceptable latency and low failure rates while virtual users scale up.

Quick Start

Run the k6 test script and export results to .agents/agents/k6-performance/output/k6_summary.json so reporting skills can read the metrics.

Frequently Asked Questions about k6 Performance Testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure API latency and error rates under load?

You measure API latency and error rates by executing k6 load tests against HTTP endpoints, applying thresholds like p(95) latency and failure rate limits. This validates request performance while scaling virtual users to simulate real traffic.

What is the difference between smoke, load, and stress testing in k6?

Smoke testing provides quick validation with minimal traffic, load testing evaluates performance under expected traffic levels, and stress testing identifies breaking points by pushing virtual users beyond normal operating capacity.

How do I export k6 test results to JSON for downstream reporting?

You export k6 test results to JSON by using the summary-export feature, generating a file like k6_summary.json. Downstream reporting tools can then extract key metrics including p(95) latency, failed request rates, and request counts.

Can I use k6 performance testing to validate staging environments before release?

Yes, k6 performance testing is designed for staging and test environments to validate API stability. It measures latency percentiles and request failure rates under varying traffic scenarios to identify bottlenecks before release.

Do I need to write a custom script to run k6 load tests?

Yes, you need to write a k6 JavaScript test script that defines options and thresholds for your HTTP endpoints. This scripting approach ensures repeatable test runs that validate specific latency and error rate criteria.

What API metrics can I extract from a k6 JSON summary export?

You can extract metrics like p(95) latency, failed request rate, virtual user counts, and total request counts from a k6 JSON summary export. These metrics help evaluate API behavior under smoke, load, and stress scenarios.