Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Another notable change is the microgrid API client being moved to its own [repos

- Warning messages are logged when multiple instances of `*Pool`s are created for the same set of batteries, with the same priority values.

- A warning message will now be logged if no relevant samples are found in a component for resampling.

## Bug Fixes

- A bug was fixed where the grid fuse was not created properly and would end up with a `max_current` with type `float` instead of `Current`.
Expand Down
2 changes: 2 additions & 0 deletions src/frequenz/sdk/timeseries/_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,8 @@ def resample(self, timestamp: datetime) -> Sample[Quantity]:
# So if we need more performance beyond this point, we probably need to
# resort to some C (or similar) implementation.
relevant_samples = list(itertools.islice(self._buffer, min_index, max_index))
if not relevant_samples:
_logger.warning("No relevant samples found for component: %s", self._name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it could be interesting to log the contents of the self._buffer here too? Just to know which samples where the last received and when?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think logging self._buffer could indeed be useful for debugging the resampler itself. However, for operational purposes, only the component name is necessary, as information can be obtained from the component logs and querying the current state of the component is enough.
In our specific operational scenario, we didn't find a need for accessing self._buffer. Should I still add a _logger.debug() for self._buffer?

value = (
conf.resampling_function(relevant_samples, conf, props)
if relevant_samples
Expand Down