From 039c4546d71846d2955c892da3d0dd6a846afe65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Mon, 9 Dec 2024 15:25:37 +0100 Subject: [PATCH] Log when evaluator is leaving events 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. --- src/ert/ensemble_evaluator/evaluator.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ert/ensemble_evaluator/evaluator.py b/src/ert/ensemble_evaluator/evaluator.py index 786f6241a7c..b0c2de73a76 100644 --- a/src/ert/ensemble_evaluator/evaluator.py +++ b/src/ert/ensemble_evaluator/evaluator.py @@ -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]]