Visualizing Load Test Data in Grafana with WK6

Bilal İnal
Wingie / Enuygun Tech
3 min readMar 26, 2024

Today, performance testing of web applications is crucial. Using the right tools to understand how the application is perceived by users and to detect potential performance issues is critical. In this article, I will show you how to create a performance testing scenario using WK6 and how to visualize the results.

First, let’s talk about WK6, which we developed with K6. In the project, we conduct load tests at different levels. There are three different levels: LEVEL 1, LEVEL 2, and LEVEL 3. At each level, we target a different number of users for a specific period.

What Were Our Expectations?

During performance testing, we had certain expectations. WK6 significantly guided us in creating test scenarios and analyzing the results.

1. Multi-Level Scenarios

In our test scenarios, we planned to conduct load tests at different levels. At each level, we targeted a different number of users and directed these users to the application for a specific period.

2. Visualizing the Results

Visualizing the test results helped us better understand the performance. Using tools like Grafana, we displayed the data obtained during the tests in the form of graphs.

3. Analyzing the Results

By analyzing the data we obtained, we gained deeper insights into the performance of the application. We examined the data in detail to understand at which levels the performance declined or improved.

In line with these expectations, we easily conducted performance tests using WK6. The results helped us better understand the performance of the application and detect potential issues.

Load Testing with WK6

  • LEVEL 1
[
{
'duration': '20s',
'target': 10
},
{
'duration': '20s',
'target': 20
},
{
'duration': '20s',
'target': 30
}
]
  • LEVEL 2
[
{
'duration': '20s',
'target': 30
},
{
'duration': '20s',
'target': 60
},
{
'duration': '20s',
'target': 90
}
]
  • LEVEL 3
[
{
'duration': '20s',
'target': 50
},
{
'duration': '20s',
'target': 100
},
{
'duration': '20s',
'target': 150
}
]

We can see the level scripts of the scenarios under the app/scenario path. The duration and target values of these scenario levels vary according to the level. Of course, we can change these values according to our needs or create new scenarios :)

To visualize the load tests at these levels in Grafana, we first need to integrate Grafana with K6. To visualize the data in Grafana, we collect the data generated by K6 and create a Grafana dashboard in the .docker/grafana/dashboards path to view this data. This way, we will be able to observe the performance of the load tests at each level and how the application responds in Grafana.

For example, we can start a load test for LEVEL 1 with the command:docker-compose run k6 k6 run -e URI=https://example.com/ -e LEVEL=1 /application/app/main.js

These results can be quite valuable. For example, we can see how the application responds when a certain target number of users is reached and detect performance issues

Using the right tools and analyzing the data correctly are crucial when conducting performance tests. With WK6, you can better understand how to proceed with load tests :)

Resources:

WK6 Documentation

K6 Documentation

If you want to join our team, share your CV with us: kariyer@enuygun.com and follow us on LinkedIn.

--

--