Ramping VUs in k6
RedLine13 Blog
by David Koziel
1w ago
When creating a load test, it is sometimes desirable to control how the rate of requests are scaled over time. k6 provides this behavior through the ramping-vus executor, which allows gradual scaling of virtual users over a specified duration. This enables realistic simulations of user traffic patterns as expected in real-world use cases. In this brief post, we will outline the basics of using this feature in k6. Example Script of Ramping VUs The following k6 script outlines the syntax and usage of the ramping-vus executor. You can also find a similar script example in the official ..read more
Visit website
Large-Scale and Distributed Load Testing with k6
RedLine13 Blog
by David Koziel
3w ago
Owing to an efficient design and low overhead, k6 tests have an inherent ability to scale well. Compared to other testing frameworks, users of k6 can often expect less resource utilization. As described in the official documentation, k6 tests scale well on single instances, lending to reduced requirements when performing distributed load testing. In this brief article, we will show you how cloud-based platforms like RedLine13 allow you scale your k6 tests across multiple load generator servers easily and with minimal effort. Transitioning to Distributed Tests Even with the efficiencies offere ..read more
Visit website
The k6 Browser Recorder
RedLine13 Blog
by David Koziel
1M ago
When creating your test plans in k6, it is a common practice to write the script with a bottom-up approach. In other words, each request is explicitly coded in sequence with a series of http request methods wrapped in flow control. While this method provides the ultimate means of control, tests can also be built using the k6 Browser Recorder. With this alternative, a browser plugin allows you to record a series of interactions with a page. These interactions can then be directly converted to a k6 test script. In this post, we will show you how to get started with the k6 Browser Recorder to au ..read more
Visit website
Setting k6 Environment Variables
RedLine13 Blog
by David Koziel
1M ago
Building on the concept of extensibility, k6 has the ability to read variables set in the local environment and apply them to test scripts.  Reusable scripts often only require minor changes to be used in different contexts, and k6 environment variables provide this.  In addition, there are some k6 extensions that depend on environment variables to set their configuration.  In this post, we will show you how to set k6 environment variables both in your local development environment, and in tests that run on RedLine13. Local Environment Natively, k6 supports environment variable ..read more
Visit website
Tags and Thresholds in k6
RedLine13 Blog
by David Koziel
1M ago
In this brief post, we will cover how to add individual requests to groups using the tags feature of k6. This feature can be used to label thresholds for reporting on grouped requests. By separating result metrics generated by your k6 test, it can become possible to isolate the performance of individual or related requests. Suppose for a given test we have identified a performance issue; however the test is made up of several different requests. These separate requests each call essential endpoints for the process tested, and therefore would not be feasible to test them individually out of co ..read more
Visit website
Importing User Modules in k6
RedLine13 Blog
by David Koziel
1M ago
In previous posts we have commented on extensibility as a hallmark of the k6 architecture. While there are a wide variety of official modules you can easily import into your k6 tests, it is also possible to import custom JavaScript code. In this brief post we will show you how to easily import code from your own modules. This can potentially accelerate your development efforts by reusing these modules across multiple tests, while at the same time decluttering your scripts away from repetitive lines of code. Creating Your Own Modules Since k6 tests are built in JavaScript, you can create exten ..read more
Visit website
K6 Error Handling
RedLine13 Blog
by David Koziel
2M ago
When testing at scale, it is inevitable that at some point your load test will encounter error states. It may even be a condition itself that is tested. Therefore, it is essential that we have a capability to capture and analyze error information. In this brief article, we will detail how to intercept and log errors in your k6 load tests. Intercepting and Logging Errors Ideally, we would like to save errors to a retrievable log file that can be reviewed after the test completes. In order to do this, we must implement a class that instructs k6 on what to do with error information. Here is the ..read more
Visit website
Common Tasks in k6
RedLine13 Blog
by David Koziel
2M ago
When writing your k6 test scripts, there are certain common tasks that are recurrently encountered. In this post, we will discuss examples on how to accomplish several of these common tasks. Most of these examples are illustrated in the official k6 documentation pages. Entering Data into Web Forms User submission forms are a common target test endpoint. Tests such as these must be designed in a way that form fields are identified and mapped to useful values prior to submission. In k6, we can use the submitForm() method on a Response object. This comes as part of the k6 JavaScript API, and can ..read more
Visit website
Functional Testing with k6
RedLine13 Blog
by David Koziel
2M ago
In previous posts we have covered the ability to use k6 for scalable load testing, however k6 is also a suitable framework for creating functional tests. In this brief post, we will show you how to get started with using k6 as a functional testing tool. Assertions in k6 There are two basic ways to write assertions in k6. One is using the built-in check and group functions. Perhaps a better alternative is to use the ChaiJS extension (k6chaijs), which is actually the favored approach in the official k6 documentation. The latter allows use of the expect function making functional tests more huma ..read more
Visit website
The k6 Graphical Test Builder
RedLine13 Blog
by David Koziel
3M ago
Most examples that illustrate how to create a k6 load test center around using a bottom-up approach with code. This is in contrast with frameworks such as JMeter where it is typical for tests to be created visually. However, there is a utility by Grafana Labs for creating k6 load tests with a GUI. In this post, we will show you how to use the graphical Test Builder to create k6 load tests. The Graphical k6 Test Builder In order to take advantage of this tool, you will need a Grafana account. If you don’t already have one, you can create one on the Grafana Labs website. Once you log in, the Te ..read more
Visit website

Follow RedLine13 Blog on FeedSpot

Continue with Google
Continue with Apple
OR