# [[k6 (tool)]]
![[k6 (tool).svg]]
k6 OSS is a protocol-level, code-only, open-source load testing tool written in [[Go]] and scriptable in [[JavaScript]]. ^f87e77
## What's new in k6 v1.0?

Talk by k6 engineers Theo Crevon and Ayush Goyal at GrafanaCON 2025 about k6 v1.0. [^crevon]
k6 now has:
- semantic versioning
- support guarantees
- easy extension support that doesn't require you to create a new binary
- full [[TypeScript]] support
- a better end-of-test summary (compact vs. full mode possible)
- [[k6 Studio]] is a downloadable app that lets you record and create tests on the UI without needing to create a script. It can export to a k6 script.
- [[k6 OpenAPI Generator]] creates a script from [[OpenAPI]] specs.
## Using k6
### Getting started
[[JMeter-to-k6 Converter]]
[[k6 HAR Converter]]
[[Grafana Cloud k6 Browser Recorder]]
[[postman-to-k6 Converter]]
[[k6 OpenAPI Generator]]
[[Installing and upgrading k6]]
### Scripting
#### Generating a script
[[k6 Test Builder]]
[[postman-to-k6 Converter]]
### Writing a script
[[Grafana Cloud k6 Browser Recorder]]
[[The k6 CLI]]
[[Correlation in k6]]
[[Organizing code in k6]]
[[Parallel requests in k6]]
[[Debugging in k6]]
[[Variables in k6]]
[[Caching in k6]]
[[Assertions in k6]]
[[Checks in k6]]
[[Thresholds in k6]]
[[Dynamic think time in k6]]
[[Modular scripting in k6]]
[[Test data generation in k6]]
[[Connection reuse in k6]]
[[Using proxies in k6]]
[[Requests by percentages in k6]]
[[Tips for writing protocol-based load testing scripts with k6]]
#### Developer extensions
[[k6 for Visual Studio Code]]
[[k6 TypeScript Type Definition]]
#### Customizing k6
- [[k6 jslib]] - A JavaScript library of most commonly used functions.
- [[Extensions for k6 using xk6]] - A way to extend k6 using code in Go.
- Experimental features
- [[Experimental modules in k6]] - High-value extensions that can be imported instead of requiring a custom k6 build.
- [[k6 Prometheus Remote Write]] output extension
### Test execution
[[Environment variables in k6]]
[[Executors in k6]]
[[k6 results output]]
[[Running on k6 Cloud from CLI]]
[[Using k6 Operator for distributed load testing]]
[[How to use k6 with GitHub Actions]]
### Test Analysis
[[handleSummary in k6]]
[[Reporting from k6 CLI]]
[[Grafana integration with k6]]
- [[k6 Cloud App for Grafana]]
- [[k6 Prometheus Remote Write]]
[[k6 + Grafana + Prometheus]]
### Integrations
- [[CircleCI]]
- [[Grafana Faro]]
- with [[Grafana Tempo|Tempo]]: [[k6 Insights]] (via [[xk6-distributed-tracing]])
## Use cases for k6
- [[Performance benchmarking]]: [[databases/video-database/kOH 89 - How Supabase does performance benchmarking using k6 - Egor Romanov|kOH 89 - How Supabase does performance benchmarking using k6 - Egor Romanov]]
- [[Site Reliability Engineering]]
- [[databases/video-database/kOH 90 - How to use k6 for SRE|kOH 90 - How to use k6 for SRE]]
- [[kOH 92 - From load testing to reliability testing tool]]
## k6's place in the market
[[First impressions of k6]]
[[K6 OSS Competitive Advantages]]
[[K6 OSS Competitive Disadvantages]]
Below is a graph of the test runs of k6 (not in the Cloud) per month from June 2020 to July 2022:
![[k6-oss-test-runs-july2022.png]]
### My content assessing k6
- [[k6 Week of Testing Content]]
- [[k6 vs JMeter]]
- [[Qué es k6]]
### What others think of k6
- [[K6 Review - Open Source Load Testing Tool for Developers - Abstracta by Juan Pablo Sobral]]
- [[Load Tests - Jmeter vs K6 – Rafaela Azevedo]]
- [[k6 is more resource efficient than JMeter or Gatling]]
## [[k6 Wishlist]]
## [[k6 Licensing]]
## Key features
### Scripting
#### Creating a script
- [x] [[Recorder]]
- [[Grafana Cloud k6 Browser Recorder]] and [[k6 HAR Converter]], but not packaged into k6.
- [x] [[Exclude third-party or configured domains]]
- [ ] [[Sample script packaged in]]
- [ ] [[GUI Test Builder]]
- [x] [[Code-based scripting]]
- [x] [[Protocol-based load testing]]
- [ ] [[Browser-based testing]]
#### Making the script robust
- Protocols Supported
- [x] [[HTTP/1.1]]
- [x] [[HTTP/2]]
- [x] [[WebSockets]]
- [x] [[gRPC]]
- [ ] [[Citrix ICA]]
- [ ] [[LDAP]]
- [x] [[Modify headers]]
- [x] [[Response assertions]]
- [[Error handling]]
- [x] [[Output to log upon error]]
- [ ] [[Screenshots]]
- [x] [[Continue on error or restart iteration]]
- [[Debugging]]
- [x] [[See request and response headers and bodies on single iteration]]
- [x] [[Change log levels]]
- [x] [[Transaction groups]]
- [x] [[Custom functions or test fragments]]
#### Making the script realistic
- [[Correlation of dynamic values]]
- [x] [[JMeter Regular Expression Extractor]]
- [x] [[CSS Selector]]
- [x] [[JSON Extractor]]
- [x] [[Dynamic think time and pacing]]
- [x] [[Conditional logic]]
- [x] [[Parallel execution of requests]]
- [x] [[Download embedded resources]]
- [x] [[Follow redirects]]
- [ ] [[Network bandwidth throttling]]
- No, and there's an [issue for it](https://github.com/loadimpact/k6/issues/1098).
- [ ] [[Cache management]]
- No. [Issue here](https://github.com/loadimpact/k6/issues/142).
- [x] [[Startup and teardown thread groups]]
#### Test data
- [x] [[Static test data]]
- [x] [[Unique data generation during runtime]]
- [ ] [[Virtual Table Server]]
#### Collaborating on a script
- [x] [[Version Control System]]
- [x] [[Test Scaffolding]]
### Execution
#### [x] [[Test Scenarios]]
#### [x] [[Configurable Load profile]]
- [x] [[Number of virtual users]]
- [x] [[Duration]]
- [x] [[Origin or Region]]
- [x] [[Ramp-up]]
- [x] [[Ramp down]]
- [x] [[Number of iterations]]
- [x] [[Fully customizable load profile]]
#### SLAs
- [x] [[Set multiple thresholds]]
#### [x] [[Execution Parameters]]
#### Memory consumption benchmark
### Analysis
#### Dashboard
- [ ] [[Pre-generated reports]]
- [ ] [[Custom dashboard creation]]
- [ ] [[Reusable dashboards]]
- Easy error troubleshooting
- [ ] [[Screenshots]]
- [x] [[Response bodies]]
- [x] [[Assertion success or failure]]
- [x] [[Log for transaction failure]]
#### Metrics
- [x] [[Response time]]
- [x] [[Request throughput]]
- [x] [[Number of virtual users]]
- [x] [[Error rate]]
- [x] [[Network throughput]]
- [ ] [[Load generator CPU]]
- [ ] [[Load generator memory]]
#### Graphs
- [ ] [[Different Graph Types]]
- [ ] [[View by transaction]]
- [ ] [[View by load generator or region]]
- [ ] [[Custom views]]
#### Results
- [x] [[Raw data]]
- [x] [[At least 1s granularity]]
- [x] [[Export as plain text]]
### Continuous Load Testing
- [x] [[Jenkins]]
- [x] [[Azure Pipelines]]
- [x] [[Travis CI]]
- [x] [[CircleCI]]
[^crevon]: Crevon, T. & Goyal, A. (2025). *k6 1.0: Getting started with testing just got easier*. Talk presented at GrafanaCON 2025. Retrieved from https://www.youtube.com/watch?v=hHvVHi3Tdds
%%
# Excalidraw Data
## Text Elements
## Drawing
```json
{
"type": "excalidraw",
"version": 2,
"source": "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/2.1.4",
"elements": [
{
"id": "4y8R7iOA",
"type": "text",
"x": 118.49495565891266,
"y": -333.44393157958984,
"width": 3.8599853515625,
"height": 24,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
"fillStyle": "solid",
"strokeWidth": 2,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"frameId": null,
"roundness": null,
"seed": 967149026,
"version": 2,
"versionNonce": 939059582,
"isDeleted": true,
"boundElements": null,
"updated": 1713723615080,
"link": null,
"locked": false,
"text": "",
"rawText": "",
"fontSize": 20,
"fontFamily": 4,
"textAlign": "left",
"verticalAlign": "top",
"containerId": null,
"originalText": "",
"lineHeight": 1.2
}
],
"appState": {
"theme": "dark",
"viewBackgroundColor": "#ffffff",
"currentItemStrokeColor": "#1e1e1e",
"currentItemBackgroundColor": "transparent",
"currentItemFillStyle": "solid",
"currentItemStrokeWidth": 2,
"currentItemStrokeStyle": "solid",
"currentItemRoughness": 1,
"currentItemOpacity": 100,
"currentItemFontFamily": 4,
"currentItemFontSize": 20,
"currentItemTextAlign": "left",
"currentItemStartArrowhead": null,
"currentItemEndArrowhead": "arrow",
"scrollX": 583.2388916015625,
"scrollY": 573.6323852539062,
"zoom": {
"value": 1
},
"currentItemRoundness": "round",
"gridSize": null,
"gridColor": {
"Bold": "#C9C9C9FF",
"Regular": "#EDEDEDFF"
},
"currentStrokeOptions": null,
"previousGridSize": null,
"frameRendering": {
"enabled": true,
"clip": true,
"name": true,
"outline": true
}
},
"files": {}
}
```
%%