%% date:: [[2022-03-04]], [[2022-02-28]], [[2022-02-07]], [[2022-01-27]], [[2022-01-04]], [[2021-11-05]], [[2021-10-18]], [[2021-10-14]], [[2021-09-17]], [[2021-08-24]], [[2021-08-19]], [[2021-07-13]], [[2021-06-29]], [[2021-06-24]], [[2021-05-12]], [[2021-04-12]], [[2021-02-11]], [[2021-02-09]], [[2021-02-05]], [[2021-02-03]], [[2020-12-07]], [[2022-04-04]], [[2022-07-13]], [[2022-07-25]], [[2022-10-25]], [[2023-01-20]], [[2023-03-17]], [[2023-05-12]], [[2023-06-11]], [[2023-07-03]] %% # [[k6 (tool)]] k6 OSS is a protocol-level, code-only, open-source load testing tool written in [[Go]] and scriptable in [[JavaScript]]. ^f87e77 ## 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]] ### 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]]