Skip to content

Commit 719eea7

Browse files
committed
Add debug log to resampler when no samples are found
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 1de07a6 commit 719eea7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/frequenz/sdk/timeseries/_resampling.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,16 @@ def resample(self, timestamp: datetime) -> Sample[Quantity]:
747747
relevant_samples = list(itertools.islice(self._buffer, min_index, max_index))
748748
if not relevant_samples:
749749
_logger.warning("No relevant samples found for: %s", self._name)
750+
_logger.debug("Requested: %s - %s", minimum_relevant_timestamp, timestamp)
751+
if self._buffer:
752+
_logger.debug(
753+
"Buffer: %s - %s",
754+
self._buffer[0].timestamp,
755+
self._buffer[-1].timestamp,
756+
)
757+
else:
758+
_logger.debug("Buffer is empty")
759+
750760
value = (
751761
conf.resampling_function(relevant_samples, conf, props)
752762
if relevant_samples

0 commit comments

Comments
 (0)