diff --git a/swh/storage/buffer.py b/swh/storage/buffer.py --- a/swh/storage/buffer.py +++ b/swh/storage/buffer.py @@ -4,6 +4,7 @@ # See top-level LICENSE file for more information from functools import partial +import logging from typing import Dict, Iterable, List, Mapping, Sequence, Tuple from typing_extensions import Literal @@ -19,6 +20,9 @@ from swh.storage import get_storage from swh.storage.interface import StorageInterface +logger = logging.getLogger(__name__) + + LObjectType = Literal[ "content", "skipped_content", @@ -177,6 +181,8 @@ ) -> Dict[str, int]: summary: Dict[str, int] = {} + logger.debug("flushing %s", {k: len(self._objects[k]) for k in object_types}) + def update_summary(stats): for k, v in stats.items(): summary[k] = v + summary.get(k, 0) @@ -194,7 +200,7 @@ update_summary(stats) self.clear_buffers(object_types) - + logger.info("flushed %s", summary) return summary def clear_buffers(self, object_types: Sequence[LObjectType] = OBJECT_TYPES) -> None: