New in Grafana k6: The latest OSS features in v0.48.0 and user-defined project limits in Grafana Cloud k6
Grafana k6 v0.48.0 has been released, featuring support for memory-efficient handling of large files in tests and tons of other improvements for Grafana k6 OSS.
Here’s a quick overview of the latest features in Grafana k6 v0.48.0, as well as some other exciting updates related to Grafana Cloud k6 and the k6 community.
🙌 Grafana k6 v0.48.0 release
The latest release features:
A k6 new
subcommand to generate a test script. This is useful for new users who want to get started quickly, or for experienced users who want to save time when creating test scripts. To use the subcommand, open your terminal and type:
k6 new [filename]
A k6/experimental/fs
module for file interactions. This new module provides a memory-efficient way to handle file interactions within your test scripts. It currently offers support for opening files, reading their content, searching them, and retrieving metadata about them.
Unlike the traditional open()
function, which loads a file multiple times into memory, the filesystem module reduces memory usage by loading the file as little as possible, and sharing the same memory space between virtual users (VUs). This approach significantly reduces the memory footprint of your test script and lets you load and process large files without running out of memory. You can check out our documentation for more information and an example of the new functionality.
The v0.48.0 release includes more internal improvements, minor changes, and fixes from the k6 team and the community. Check out the full list in the k6 release notes.
🌐 k6 browser updates
k6 browser lets you automate browser actions and collect web performance metrics for your k6 tests. With the k6 0.48.0 release, the k6 browser now supports CPU and network throttling! 🥳
With this new feature, you can use page.throttleNetwork
to limit network bandwidth and simulate users with slow network connections. For example, if you want to simulate users connecting to your application via Slow 3G, you can use the following code snippet.
import { browser, networkProfiles } from 'k6/experimental/browser';
...
const context = browser.newContext();
const page = context.newPage();
page.throttleNetwork(networkProfiles['Slow 3G']);
...
You can also now use page.throttleCPU
to slow down your machine’s performance and simulate users with slower devices. For example, the following code snippet will slow down your machine’s performance by four times.
const context = browser.newContext();
const page = context.newPage();
page.throttleCPU({ rate: 4 });
As always, make sure to read the full release notes for k6 0.48.0 for all the information, and ask in the Community forum if you need our help!
☁️ New in Grafana Cloud k6
This year, we announced the general availability of Grafana Cloud k6, our fully managed performance testing solution in Grafana Cloud. If you want to try it out, Grafana Cloud has a forever-free plan with 500 virtual user hours per month and more. Sign up for free today!
Note: Existing k6 Cloud customers will be migrated to Grafana Cloud k6 at a later date.
We continue to add more features to Grafana Cloud k6. Some of the latest additions include:
- User-defined project limits and quotas: When creating performance tests in Grafana Cloud k6, you have to define a few parameters, such as VUs and test duration. This new feature allows admins to set parameter limits and quotas for individual projects to avoid unexpected charges at the end of the billing cycle.
- Improvements to Distributed Tracing in Grafana Cloud k6: These include the new trace tree view, trace comparison view, and trace support in Query Editor and Explore.
- Browser support in Performance Insights: You now have insights related to web vitals when running a browser in a test.
We are actively seeking customers to try out Private Load Zones v2, which is currently in Public Preview. This enhancement of the k6-operator makes it even easier for users to create “load generators” in their K8s cluster to test internal services. Learn more about how to set up Private Load Zones in our documentation.
🔧 k6-operator
During this cycle, we released k6-operator v0.0.12.
This release primarily improves the PrivateLoadZone
workflow introduced with the previous release.
Other updates include:
- The long-awaited removal of DNS restrictions by changing to
ClusterIP
, thanks to @CarlJi. - Enabling the use of
topologySpreadConstraints
to control how load test jobs are spread across a cluster, as well as documentation updates, thanks to @aslafy-z. - Several Helm chart improvements based on contributions from @MarkDPierce, @josh-ferrell, @illrill, and @edwintye.
- Fixes to the linter issues and improvements to the codebase from Hacktoberfest contributor @u5surf.
Thank you to all of our contributors to this release! 💗
⚙️ The latest on k6 Extensions
As usual, there were some exciting changes within the extensions ecosystem with this release cycle!
The following updates were made to official extensions:
- xk6-dashboard v0.6.1: Actively undergoing development, as we hope to include this as part of core k6 functionality.
- xk6-sql v0.3.0: Now uses the official Microsoft JDBC Driver for SQL Server.
- xk6 v0.10.0: Updates base Docker image to address issues from vulnerability scans.
We’ve deprecated and archived the xk6-amqp and xk6-docker extensions. A community member may pick up AMQP support going forward, but we’ll learn more about this later.
From the community, we’ve seen various updates and fixes for several extensions:
- golioth/xk6-coap
- thotasrinath/xk6-couchbase
- oleiade/xk6-encoding
- mostafa/xk6-kafka
- pmalhaire/xk6-mqtt
- elastic/xk6-output-elasticsearch
- leonyork/xk6-output-timestream
- Juandavi1/xk6-prompt
- walterwanderley/xk6-stomp
- kubeshop/xk6-tracetest
In addition, at least seven new extensions have been discovered in the wild:
- Mistyrain520/xk6-zap: Provides support for structured logging output.
- MATRIXXSoftware/xk6-diameter: Adds support for the Diameter protocol.
- akiomik/xk6-nostr: Allows you to test relay servers using the Nostr protocol.
- fernandoescolar/xk6-azservicebus: Allows you to send and receive messages from Azure Service Bus.
- kelseyaubrecht/xk6-webtransport: Supports bidirectional streams using the WebTransport protocol.
- nikosn/xk6-ocsp: Allows you to test Online Certificate Status Protocol (OCSP) responders.
- szkiba/tygor: Experimental tooling from Ivan Szkiba for creating new extensions using an API-first approach via TypeScript declaration files.
It’s amazing to see the new ways folks are extending the functionality of k6!
As always, a huge thank you to our community! We look forward to celebrating more contributor successes!
💜 k6 Champions
The Grafana k6 Champions Program aims to recognize experts within our community to amplify their contributions and partner with the k6 team.
This time, we have accepted Paul Maxwell-Walters as our latest k6 Champion! Paul has been a big advocate of k6 and is also the acting chair of the Sydney Testers group. Going forward, he’ll be helping us organize a few remote and in-person meetups, focusing on k6 and Grafana. We look forward to having Paul in the program!
Our existing k6 Champions have also been busy within the community:
- Carlos Gauto was a recent guest at Café con Grafana, where he shared his experiences at the Workshop On Performance and Reliability (WOPR) event and spoke about the evolution of performance.
- Yusuf Tayman spoke at TestBash Autumn about fault injection testing and how the k6 extension xk6-disruptor can help. Yusuf, who is also a Grafana Champion, recently attended ObservabilityCON 2023, where he was recognized alongside other members of the Grafana Champions Program. 💜
- Grzegorz Piechnik created a helpful video sharing his thoughts on how k6 differs from JMeter. He also made a short video explaining Grafana Loki and how it can streamline your log management process.
- Rafał Krząpa wrote an introductory article on how you can run your k6 tests on GitHub.
- Donald Le also wrote an article on how to quickly generate a k6 test using the browser recorder and running it on Grafana Cloud k6.
- Monish Correia delivered a hands-on workshop about k6 at the 8th edition of the Global Testing Retreat. The workshop showed attendees how to install k6, create a basic script, and use ChatGPT to generate more k6 scripts.
- Sarah Zipkin wrote an insightful article on how to take your k6 tests from development to operations and showed how to re-use performance tests with different
options
files. - Last but not least, John Hill shared how to combine frontend and backend performance with k6 at Grafana Office Hours. John also spoke at a Grafana & Friends in-person meetup about automated performance modeling with Open MCT, Grafana Cloud, and k6.
We are incredibly grateful for all these amazing contributions from our k6 Champions!
If you love using k6 and have done advocacy and education work on behalf of the project, you can apply to be part of our growing program by filling out this Grafana k6 Champions application form.
Also, if you are interested in upcoming k6 news or want to connect with the k6 community, please join us on Slack, Twitter, LinkedIn, or YouTube. Happy testing!
Download the latest version of k6 OSS today, or get started with performance testing on Grafana Cloud, which has a generous forever-free tier that includes 500 Virtual User Hours (VUh) and plans for every use case. Sign up for free now!