From 209275cce09d50dda2c3212d4b8c3003627edb0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Henrique=20Ivanchechen?= Date: Thu, 31 Aug 2023 19:46:13 -0300 Subject: [PATCH] change --- scripts/testes.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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: