Member-only story

Trick how to separate Locust for Admin and Viewer

Hafiq Iqmal
3 min readMar 9, 2021

--

Locust is Open-source Python-based load testing. All you need is to write a script using locust library. Its very simple and easy-to-use which for me as python beginner easier to understand. For more info, you can read here.

Locust currently only support admin view which the page with input like below

When it goes to public or internal network and you want to show to your colleagues or clients, you might want to prevent them from tampering the input from their side. For example, if spectators open the IP/URL for the locust, they will see like below

Spectators view
Admin view

Okay, here’s the trick.

  1. Custom locust path
  2. Adjust Nginx for Reverse Proxy

Custom Locust Path

Create a static folder at the root directory and create file named as extend.js. Add this code in it

$('#swarm_form,#edit,#new_test,#box_stop,.edit_test').remove()…

--

--

Hafiq Iqmal
Hafiq Iqmal

Written by Hafiq Iqmal

Technical Lead | Software Engineer | Laravel Enthusiasts | Tech writer | UiTM Alumni | Husband | Proud father of a beautiful daughter

No responses yet