Skip to content

fix: handle empty request timing lists and complete compute_metrics in get_numbers_sequential (closes #542)#547

Merged
aiosfoundation merged 1 commit into
agiresearch:mainfrom
botbikamordehai2-sketch:fix/issue-542-1779960608
Jun 18, 2026
Merged

fix: handle empty request timing lists and complete compute_metrics in get_numbers_sequential (closes #542)#547
aiosfoundation merged 1 commit into
agiresearch:mainfrom
botbikamordehai2-sketch:fix/issue-542-1779960608

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown
Contributor

What

The get_numbers_sequential() function in aios/utils/calculator.py had two bugs:

  1. It accessed request_waiting_times[0] and request_turnaround_times[0] without checking if the lists were empty, causing an IndexError.
  2. The compute_metrics helper function at the end of get_numbers_sequential was incomplete/truncated, and the function had no return statement.

Fix

  1. Added guard checks (if request_waiting_times: and if request_turnaround_times:) before accessing index 0 of the timing lists.
  2. Completed the compute_metrics function body and added the return metrics statement, mirroring the pattern already used in get_numbers_concurrent.

Closes #542

@aiosfoundation
aiosfoundation merged commit 634b2e5 into agiresearch:main Jun 18, 2026
2 checks passed
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.

[Bug] Fix IndexError in sequential metrics when request timing lists are empty

2 participants