robot tcs, test charts, robot container added
[ta/cloudtaf.git] / resources / test_containers / http-traffic-gen / http_traffic_gen.py
1 #!/usr/bin/python
2
3 import thread
4 import time
5 import traceback
6 import requests
7
8
9 URL = "http://podinfo.kube-system.svc.rec.io:9898"
10 LOCATION = "nokia"
11 PARAMS = {'address': LOCATION}
12 DELTA = 0.01
13
14
15 def worker():
16     for _ in range(0, 1000):
17         time.sleep(DELTA)
18         requests.get(url=URL, params=PARAMS)
19
20 try:
21     for x in range(0, 3):
22         thread.start_new_thread(worker, ("Thread-" + str(x), ))
23 except Exception as e:
24     traceback.print_exc()
25
26 time.sleep(40)