Skip to content

Commit

Permalink
Log when evaluator is leaving events
Browse files Browse the repository at this point in the history
The batching interval and size can maybe be tuned slightly, before that
it will be quite interesting to know how often message processing
is postponed.

This logging feature existed in the sync version of the ensemble
evaluator, but was not carried over in 509c224.
  • Loading branch information
berland committed Dec 9, 2024
1 parent a5bfbdb commit 039c454
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ert/ensemble_evaluator/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,14 @@ def set_event_handler(event_types: Set[Type[Event]], func: Any) -> None:
except asyncio.TimeoutError:
continue
self._complete_batch.set()
batch_start_time = asyncio.get_running_loop().time()
await self._batch_processing_queue.put(batch)
if batch and self._events.qsize() > 0:
logger.info(
f"Processed {len(batch)} events in "
f"{(asyncio.get_running_loop().time() - batch_start_time):.6f}s "
f"{self._events.qsize()} left in queue"
)

async def _fm_handler(
self, events: Sequence[Union[FMEvent, RealizationEvent]]
Expand Down

0 comments on commit 039c454

Please sign in to comment.