Load testing APIs
-
Install Jmeter https://jmeter.apache.org/
-
Open .jmx file in jmeter and run test.
-
This is optional unless you are doing it on cloud. To run tests against any server you will need jwt. You can get jwt from swagger request. Or there are other ways, just get he jwt already .
-
This is optional unless you are doing it on cloud. Add the jwt to corresponding Http Header Manager.
-
This is optional unless you are doing it on cloud. If you want to bypass load balancer, setup to hit nginx-ingress directly
-
Should be able to run tests now.
-
Once the test is built or modified in jmeter, it can be run through command line also.
-
Tests cycles through users.csv file
To run
jmeter -n -t pathTo\UserServiceTests.jmx -l pathTo\UserServiceTestResults.csv
To generate the report though command line
jmeter -g pathTo\UserServiceTestResults.csv -o pathTo\UserServiceTestResults
- Install kubectl
gcloud components install kubectl
- Get credentials
Run gcloud --project my-project-name container clusters get-credentials project-name
- Forward the port
Run kubectl --namespace nginx-ingress port-forward nginx-name 80 (get running ingin-ingress from cloud)