X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fcloudtaf.git;a=blobdiff_plain;f=resources%2Ftest_containers%2Fhttp-traffic-gen%2Fhttp_traffic_gen.py;fp=resources%2Ftest_containers%2Fhttp-traffic-gen%2Fhttp_traffic_gen.py;h=df19fa5daa2fd3cfadbcbb7411904dc0ec64e2cc;hp=0000000000000000000000000000000000000000;hb=af5eb3ff36b92ab1d9c156ffa0391eadc73eb6ba;hpb=025a45508d009db84c34076fb4a668f712628d6d diff --git a/resources/test_containers/http-traffic-gen/http_traffic_gen.py b/resources/test_containers/http-traffic-gen/http_traffic_gen.py new file mode 100644 index 0000000..df19fa5 --- /dev/null +++ b/resources/test_containers/http-traffic-gen/http_traffic_gen.py @@ -0,0 +1,26 @@ +#!/usr/bin/python + +import thread +import time +import traceback +import requests + + +URL = "http://podinfo.kube-system.svc.rec.io:9898" +LOCATION = "nokia" +PARAMS = {'address': LOCATION} +DELTA = 0.01 + + +def worker(): + for _ in range(0, 1000): + time.sleep(DELTA) + requests.get(url=URL, params=PARAMS) + +try: + for x in range(0, 3): + thread.start_new_thread(worker, ("Thread-" + str(x), )) +except Exception as e: + traceback.print_exc() + +time.sleep(40)