The following are required to run the application:
- Python 3.7 or above: You can download it from Python's official site.
- pip: It comes pre-installed with Python 3.4 and above. If for some reason, it's not installed, you can refer to pip's official installation guide.
- Tkinter: It is included in the Python standard library.
- k6: This is used for load testing. You can download it from k6's official site.
- Clone this repository to your local machine.
- Open a terminal/command prompt.
- Navigate to the directory where the repository is cloned.
- Run the following command to start the application.
./k6-ui-runner
- The application window should open, and you can now use the application.
-
Add the URL of your application that you would like to apply the load test on in the URL field.
-
Write the number of durations you would like to apply then
Generate Fields
then add how long each duration should be and how many targets to apply in each duration as shown in the image.
Here we are having 3
times to run load-test the first duration is 4 Seconds
will apply 50 targets
then 10 Seconds
with 20 targets
and finally for 30 Seconds
with 100 target
.
- When you click
RUN
you should be able to see the results in the output area as shown below.
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '4s', target: 50 },{ duration: '10s', target: 20 },{ duration: '30s', target: 100 }
],
};
export default function () {
const res = http.get('http://test.k6.io');
check(res, { 'status was 200': (r) => r.status == 200 });
sleep(1);
}