Skip to content

Commit e1fdbf9

Browse files
Log when no relevant samples are found for resampling
These additional logs will help in understanding why certain microgrid components, such as meters, fail to provide relevant samples for resampling. Signed-off-by: Daniel Zullo <[email protected]>
1 parent 8467009 commit e1fdbf9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/frequenz/sdk/timeseries/_resampling.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,8 @@ def resample(self, timestamp: datetime) -> Sample[Quantity]:
745745
# So if we need more performance beyond this point, we probably need to
746746
# resort to some C (or similar) implementation.
747747
relevant_samples = list(itertools.islice(self._buffer, min_index, max_index))
748+
if not relevant_samples:
749+
_logger.warning("No relevant samples found for component: %s", self._name)
748750
value = (
749751
conf.resampling_function(relevant_samples, conf, props)
750752
if relevant_samples

0 commit comments

Comments
 (0)