diff --git a/scripts/testes.py b/scripts/testes.py index 3f88715..faa11d6 100644 --- a/scripts/testes.py +++ b/scripts/testes.py @@ -14,7 +14,7 @@ if len(sys.argv) != 3 or sys.argv[1] == '-h' or sys.argv[1] == '--help': THREADS = 10 FRAMEWORK_NAME = sys.argv[1] CONTAINER_NAME = sys.argv[2] -URL_BASE = 'http://172.26.48.1:9080' +URL_BASE = 'http://localhost:9080' API_REQUESTS = [ ('/status/ok', range(0, 30_000, 5000)), ('/image/load-image', range(0, 30_000, 5000)), @@ -80,12 +80,16 @@ def run_tests(endpoint, num_requests): futures = [] #with requests.Session() as session: # futures = [executor.submit(send_request, session, url) for _ in range(num_request)] - futures = [executor.submit(send_request, url) for _ in range(num_request)] + + half = floor(num_request/2) + for i in range(num_request): + futures.append(executor.submit(send_request, url)) + + if i == half: + cpu, ram = get_resource_usage() concurrent.futures.wait(futures) - cpu, ram = get_resource_usage() - elapsed_time = time.time() - start_time for future in futures: