Skip to content

Conversation

@llirikhh
Copy link
Collaborator

No description provided.

@llirikhh llirikhh requested a review from VS-CDR April 16, 2025 18:23
@llirikhh llirikhh self-assigned this Apr 16, 2025
test/main.py Outdated
Comment on lines 20 to 25
for i in range(count):
url_upload = 'http://localhost/api/upload/'
files = {'files': open(get_correct_image_path(size), 'rb')}
response_upload = requests.post(url_upload, files=files, allow_redirects=True)
request_id = json.loads(response_upload.text)['id']
request_ids.append(request_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше конечно не в цикле это делать, а через ThreadPool executor

Comment on lines 36 to 49
for request_id in request_ids:
# Waiting till the end of image proccesing
url_status = f'http://localhost/api/status/{request_id}/'
sleep_duration = 0.0
sleep_addition = 0.5
while json.loads(requests.get(url_status).text)['status'] != 'ready':
sleep_duration += sleep_addition
time.sleep(sleep_duration)

# Get the processing time
url_exec_time = f'http://localhost/request/exec_time/{request_id}/'
response_exec_time = requests.get(url_exec_time)
exec_time = json.loads(response_exec_time.text)['seconds']
exec_times.append(exec_time)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и здесь тоже

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants