Start locust master on local
pip3 install pipenv
# One time setup
# Set below in .zshrc or .bash_profile depending upon the type of shell you are using
export WORKON_HOME=~/virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Start pipenv shell such that a virtualenv is created which has locust python module already installed
pipenv shell
# Start locust master on local
locust -f locust_master.py --master --master-bind-host=127.0.0.1 --master-bind-port=5557
[2024-05-26 12:22:02,412] Gauravs-Laptop/INFO/locust.main: Starting web interface at http://0.0.0.0:8089
[2024-05-26 12:22:02,416] Gauravs-Laptop/INFO/locust.main: Starting Locust 2.28.0
Ensure all relevant proto files are generated by executing below (you only need to run this if you've made some changes to the proto)
./gradlew installDist
Start gRPC server
./build/install/grasp-grpc/bin/route-guide-server
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
May 25, 2024 10:39:06 PM io.automationhacks.routeguide.RouteGuideServer start
INFO: Server started, listening on 8980
Start locust slave by running the main function
public static void main(String[] args) {
new RouteGuideLoadTest().getFeatureLoad();
}
Now you can go to the locust master URL and start your load test using locust UI
- Locust python notes on Grpc testing https://docs.locust.io/en/stable/testing-other-systems.html#grpc
- Grpc Test Infra https://github.com/grpc/test-infra
- Distributed Load Testing of REST/gRPC APIs using Locust https://github.com/pedrodeoliveira/locust-rest-grpc
- Blog from blazemeter https://www.blazemeter.com/blog/locust-performance-testing
- Locust4j https://github.com/myzhan/locust4j
- Example Main.java file https://github.com/myzhan/locust4j/blob/master/examples/task/Main.java to start a locust test
- Locust Http load example project https://github.com/nejckorasa/locust4j-http-load
- Locust Http load another example project https://github.com/nejckorasa/locust4j-http-load
- wrk an example HTTP benchmarking tool https://github.com/wg/wrk