This is a presentation template.
It's intended to help you create your own presentation. Feel free to take the slides you want and delete the rest!
Please do not make changes directly in this deck– make a copy of it and modify to fit your use case.
These slides are a work in progress. If you have any feedback, join the public Grafana Slack and let us know in the #k6 channel.
Introduction to k6
Your Name
Your Role at Your Company
What is load testing?
What is k6?
How to integrate and extend k6
How k6 fits into the Grafana Labs vision
k6.io
Overview
1
2
3
4
5
What is load testing?
"Load testing is the process of putting demand on a system and measuring its response."
Load
Testing
✅ ❌
Load
Testing
Accept Errors: 9s of Reliability
Accept Outliers: percentiles 90/95/99/..
✅
“Load testing is the process of putting demand on a system and measuring its response”
What is load testing?
“Load testing is the process of putting demand on a system and measuring its response”
Scalability/Elasticity 📈
Resilience 💥
Availability 🟢
Reliability ✔️
Latency 🏎️
“Applications and Systems perform differently under [distinct] traffic“
Common types of load tests
Breakpoint test
Spike test
Soak test
Average and peak test
Common types of load tests
Test Load
Test Duration
Smoke tests
Average load tests
Stress tests
Spike tests
Soak tests
Breakpoint tests
Why do load testing?
Myths about load testing
Why do load testing today?
UX
Why load testing today?
Distributed systems
Why load testing today?
SLOs - Reliability
Be proactive
Why load testing today?
Fragility
Embrace and Prevent Failures
Modern testing
Why k6?
Release frequency
How is initiated
Testing environment
Testing frequency
PT Checklist / OLD WAY
Before releases
Test and Production
Manually
Quarterly or biannually
Modern testing. Why k6?
QA bottleneck
Lower Test Coverage
Test Often - Continuous Testing
Release frequency
How is initiated
Testing environment
Testing frequency
DevOps / MODERN WAY
Weekly
AND nightly, feature branches, continuous, synthetic monitoring
Scheduled. Automatically as part of CI/CD
AND Staging, Long-lived and Short-lived ephemerals environment
PT Checklist / OLD WAY
Before releases
Test and Production
Manually
Quarterly or biannually
Modern testing. Why k6?
Iterative:
Start simple
Modern testing. Why k6?
Team Effort
Modern testing. Why k6?
Modern testing. Distributed systems
End-to-end
Integration
Component
Browser / HTTP / WS
HTTP / gRPC / SQS
Modern testing. Distributed systems
Store
(PostgreSQL)
Frontend
Proxy
API
Feature Flag
Ads
Payment
Accounting
Fraud Detection
Cart
Currency
Recommendations
Quote
Products
Checkout
Shipping
Queue
(Kafka)
Cache
(Redis)
Protocols
HTTP gRPC TCP Other
Services
Technologies
Java
JavaScript
Kotlin
PHP
.NET
C++
Erlang
Go
Python
Ruby
Rust
Modern load testing
End-to-end
Integration
Component
Scalability
Resilience
Availability
Reliability
Latency
Breaking
Soak
Stress
Spike
Average
Dev/QA
Pre-prod
Production
Start Simple and Test Frequently.
Fail Early.
Make Reliability a Team effort.
What is k6?
Free and open source tool
Paid performance testing platform
Open source�
Same k6 test script for multiple execution modes
👉
Test as Code - Programmable�
Test as Code - Programmable�
Test as Code - Programmable�
Limitations with NodeJS and browser libraries
40K VUs in one load generator
JAVASCRIPT RUNTIME
GOJA
GOLANG
*.js / *.ts
Performant�
Protocols
Outputs
Use cases
Extensible�
InfluxDB
Prometheus
TimescaleDB
Grafana Cloud
NewRelic
Dynatrace
….
HTTP
Websocket
SQL / NoSQL
AMQP / Kafka
Crypto
Redis
….
Browser testing
Infrastructure testing
Chaos testing
JAVASCRIPT RUNTIME
GOJA
GOLANG
xk6 EXTENSIONS
….
k6 Concepts
57 configurable options -> https://k6.io/docs/using-k6/k6-options/reference/
CLI flags
ENV variables
Script options
Default
Config file
Order of preference
Scenarios: Options
VU
Iterations
Scenario
VU
While (true) {� runScenario();�}
VU
While (true) {� runScenario();�}
VU
VU
While (true) {� runScenario();�}
VU
While (true) {� runScenario();�}
Duration
Built-in Metrics
Custom Metrics
new Trend(‘metric_name’);
new Rate(‘metric_name’);
new Counter(‘metric_name’);
new Gauge(‘metric_name’);
Checks
Thresholds
Like Unit testing, for Performance
Multiple Scenarios
Constant Arrival Rate
Ramping Arrival Rate
Per VU iterations
Ramping VUs
Shared iterations
Constant VUs
Session recording�
👩💻
🌐
HAR file
HAR to k6 Converter
Response Correlation
Variable Parameterization
VU Data
Parameterization
K6 Studio�
👩💻
🌐
Response Correlation
Variable Parameterization
VU Data
Parameterization
Open API Converter�
$ openapi-to-k6 petstore-api.yaml petstore-test.ts
$ k6 run petstore-test.ts
Test data
SharedArray Best performant for larger arrays of data: CSV, JSON, ….
Faker Generate realistic data at runtime
📚
Extensible (Full-stack / Hybrid testing)
Mimic Playwright API
Webvital metrics
k6 Browser 📚�
Infrastructure testing / benchmarking
xk6-amqp
xk6-kafka
xk6-amqp
xk6-ethereum
xk6-celery
k6 extension JS API
k6 extension (GO)
xk6-sql
….
Failure Injection Testing
“From the distributed systems perspective, almost all interesting availability experiments can be driven by affecting latency or
response type“
Chaos Engineering: System Resiliency in Practice.
👤
Full-stack / hybrid performance testing
End to end browser test
News API: average load test
Full-stack / hybrid performance testing
Account API: 100ms delay
End to end browser test
News API: average load test
UI
News
Account
🏋️
💣
👤
k6 Results
Terminal
Web dashboard
Visualization
Storage
k6 run script.js -o output-xyz
k6 run script.js
k6 Results�
Healthy performance looks flat
Validate
SLOs and Quality gates
Test
result
Baseline
comparison
Correlate
with
system’s
data
Test
comparison
What’s Grafana Cloud k6?
When Grafana Cloud k6 fits
scale,
UX,
instant,
managed,
flexibility
dashboards,
role access,
projects,
activity,
collaboration
dashboards,
baselines,
test comparisons,
storage,
integrations
Convenience
Better for teams
Continuous testing
How k6 fits into the Grafana Labs vision
The 4 golden signals
Testing needs observability
Testing needs observability
Observability needs testing
Observability needs testing
Pre-production
Production
Virtual User traffic
Real User traffic
Virtual User traffic
Proactively improve reliability
System in
Pre-prod
System in
production
Grafana IRM
Grafana O11y
Performance testing automation
Continuous performance testing
(1) Start simple. Iterate.
Dev/QA
Pre-release
Staging
Production
Scenario1: Smoke test
- verify with 1 iteration
- commit/branch changes
Scenario1: Average & Stress tests
- 3 times per day during QA period
- Regressions & SLOs
Scenario1
- 50% Average Once Nightly
- Smoke synthetic
Scenario1: Average
- Twice per week (baseline)
Continuous performance testing
CI/CD pitfalls
1. Continuous == Consistently and Frequently
2. Assume Thresholds / Quality gates will fail
Explore further - more features and examples!�
Get involved
Thank you!