Skip to content

Commit ce13ef7

Browse files
add current error rate log
1 parent d5ee018 commit ce13ef7

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/guidellm/scheduler/scheduler.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,17 @@ async def run(
168168
run_info,
169169
)
170170
if iter_result is not None:
171-
if iter_result.request_info.errored \
172-
and not iter_result.request_info.canceled \
173-
and self._is_max_error_rate_reached(iter_result.run_info):
174-
shutdown_event.set()
175-
max_error_rate_reached = True
176-
logger.info(f"Max_error rate of ({iter_result.run_info.max_error_rate}) "
177-
f"reached, sending shutdown signal")
171+
if iter_result.request_info.errored and not iter_result.request_info.canceled:
172+
current_error_rate = run_info.errored_requests / run_info.end_number
173+
is_over_max_error_rate = run_info.max_error_rate < current_error_rate
174+
175+
if is_over_max_error_rate:
176+
shutdown_event.set()
177+
max_error_rate_reached = True
178+
logger.info(f"Max error rate of ({iter_result.run_info.max_error_rate}) "
179+
f"reached, sending shutdown signal")
180+
else:
181+
logger.debug(f"Current error rate: {current_error_rate}")
178182
yield iter_result
179183

180184
# yield control to the event loop
@@ -415,11 +419,6 @@ def _check_result_ready(
415419
)
416420
raise ValueError(f"Invalid process response type: {process_response}")
417421

418-
@staticmethod
419-
def _is_max_error_rate_reached(run_info: SchedulerRunInfo) -> bool:
420-
current_error_rate = run_info.errored_requests / run_info.end_number
421-
return current_error_rate > run_info.max_error_rate
422-
423422
async def _stop_processes(
424423
self,
425424
futures: list[asyncio.Future],

0 commit comments

Comments
 (0)