Building a UI for the k6 load testing tool

Load Impact
Aug 31, 2018 · 2 min read

This article describes how to build an external command-and-control UI for exploratory load testing with k6. The UI is written in Python and features some awesome ASCII graphics using the Python curses library.

If you by any chance happened to read the earlier article about how to control a running k6 instance remotely, this blog post takes it to the next level! We’ll describe how to use the REST API exposed by k6 to extract information about a running test and also to control it.

The resulting little Python app actually implements a feature that, at the time of writing, you cannot get anywhere else: the ability to dynamically alter the load level of a running load test!

This lets you do “exploratory” load testing with k6, where you start your load test at some fixed load level and then adjust the load up or down during the test, depending on what you see happening on the target system. Just press “+” or “-” on your keyboard to alter the load level! You can also pause the whole test — temporarily halting all traffic — with the push of a button. Cool, isn’t it?

The Python code can be found at https://github.com/ragnarlonn/k6control if you want to contribute. Feel free also to steal things and build your own UI of course!

Note that this article assumes you’re already familiar with k6 and that you have some software development skillz (even better if you’ve used Python a bit). Read the loooong article on our blog!

Load Impact

Written by

Ship better performing applications, faster. Run a free test today at loadimpact.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade