-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstress.py
More file actions
58 lines (54 loc) · 1.37 KB
/
stress.py
File metadata and controls
58 lines (54 loc) · 1.37 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from time import sleep
import requests
import json
import time
URL = 'https://cs-server-1.herokuapp.com/auth'
for i in range(100000):
authrequest = {
"id": i,
"password": str(i*i),
"server": {
"ip": "127.0.0.1",
"port": 0
},
"actions": {
"delay": 0,
"steps": [
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"DECREASE 1",
"DECREASE 1",
"DECREASE 1",
"DECREASE 1",
"DECREASE 1",
"DECREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"INCREASE 1",
"DECREASE 1",
"DECREASE 1",
"DECREASE 1",
"DECREASE 1",
"DECREASE 1",
"DECREASE 1"
]
}
}
r = requests.post(url = URL, json=authrequest)
print('r',r)
print('count:', i)
print('r2',r.text)
if r.status_code == '404':
break
time.sleep(1)