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 @@ -13,6 +14,9 @@ from swh.storage import get_storage from swh.storage.interface import StorageInterface +logger = logging.getLogger(__name__) + + LObjectType = Literal[ "content", "skipped_content", @@ -162,6 +166,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) @@ -179,7 +185,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: