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 @@ -21,6 +22,9 @@ from swh.storage import get_storage from swh.storage.interface import StorageInterface +logger = logging.getLogger(__name__) + + LObjectType = Literal[ "content", "skipped_content", @@ -191,6 +195,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) @@ -208,7 +214,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: