-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstructions.txt
30 lines (26 loc) · 1.59 KB
/
Instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Basic instructions on how to run the basic stress server:
{PATH_TO_EXECUTABLE}/uvicorn stress_server:app --reload
The --reload flag is for development purposes only to allow changes in code during run time. Remove this flasg for production.
A number of API endpoints are defined.
These endpoints will stress the cpu of the system for a specific time period.
Ways to stress:
Default: Stress 1 cpu for 10 seconds.
Custom: Define CPUs to stress (1-12) and duration (1-100 seconds)
The endpoints are defined as both GET and POST to allow easy use from either browser, console or application like POSTMAN
GET:
default: http://localhost:15000/stress (1 cpu, 1 second)
custom: http://localhost:15000/stress/?cpu=4;duration=20 (4 cpus, 20 seconds)
http://localhost:15000/stress/?cpu=4 (4 cpus, 1 second(default) )
http://localhost:15000/stress/?duration=20 (1 cpu(default), 20 seconds)
CURL examples
GET
curl http://localhost:15000/stress/?cpu=4;duration=20
curl http://localhost:15000/stress/
SIMULATE MULTIPLE CLIENTS:
Another endpoint has been defined:
http://localhost:15000/sim_clients
This will simulate 10 (default) calls to the stress API. This means that 10 stress jobs of 1 second each will be deployed and redirected.
Parameters:
http://localhost:15000/sim_clients?clients=X :Simulate X clients
http://localhost:15000/sim_clients?clients=X;all=True :Simulate X clients
The all parameter checks whether all the api calls will be redirected or the standard redirection algorithm will be used.