Skip to content

Conversation

@flora-hofmann-frequenz
Copy link
Collaborator

Implemented comments from #169 for components.

@github-actions github-actions bot added the part:docs Affects the documentation label May 8, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements naming changes for component data retrieval functions as requested in #169, shifting from “list_…” functions to “receive_…” functions and updating the receiver handling.

  • Renames functions in the Reporting API client and CLI to reflect the new naming convention.
  • Updates the RELEASE_NOTES.md to document the renaming changes.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/frequenz/client/reporting/cli/main.py Updates function call from list to receive (with a misspelling noted)
src/frequenz/client/reporting/_client.py Renames several functions and methods for component data retrieval (inconsistently spelled)
RELEASE_NOTES.md Documents renaming from list to receive in component data retrieval functions

@flora-hofmann-frequenz flora-hofmann-frequenz force-pushed the change_components branch 3 times, most recently from 90a60e4 to c593f14 Compare May 8, 2025 15:35
include_bounds: Whether to include the bound data.
Yields:
Returns:
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to change the return type a receiver as well.

receiver = broadcaster.new_receiver()
async for data in receiver:
yield data
return broadcaster.new_receiver()
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to be creating a new GrpcStreamBroadcaster everytime a new receiver is requested. But that would create a new connection to the API service each time. Instead you should hold on to the broadcaster instance and reuse it, like here:

@shsms
Copy link
Contributor

shsms commented May 19, 2025

Hi Flora, just realized why this was complicated. Christoph and I had solved this some time back. I've made a PR with it into your branch: flora-hofmann-frequenz#1

@github-actions github-actions bot added the part:tests Affects the unit, integration and performance (benchmarks) tests label May 30, 2025
@shsms shsms force-pushed the change_components branch from b70675a to 47be611 Compare June 3, 2025 12:49
@shsms shsms force-pushed the change_components branch from 47be611 to dc0537f Compare June 3, 2025 12:50
@shsms
Copy link
Contributor

shsms commented Jun 3, 2025

@flora-hofmann-frequenz I pushed to your branch directly because I was too lazy to create a new PR.

@cwasicki fyi

cwasicki
cwasicki previously approved these changes Jun 4, 2025
Copy link
Contributor

@cwasicki cwasicki left a comment

Choose a reason for hiding this comment

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

Just minor doc suggestion.

include_bounds: Whether to include the bound data.
Yields:
Returns:
Copy link
Contributor

Choose a reason for hiding this comment

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

Returns:
A receiver of MetricSamples?

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed.

include_bounds: Whether to include the bound data.
Yields:
Returns:
Copy link
Contributor

Choose a reason for hiding this comment

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

See above

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed.

@shsms
Copy link
Contributor

shsms commented Jun 4, 2025

I just realized we need to do the same BatchUnrollReceiver for the sensor data as well. Let me do that as well quickly in this PR.

shsms added 5 commits June 4, 2025 14:07
This turns a `Receiver[ComponentDataBatch]` into a
`Receiver[MetricSample]` by unrolling `ComponentDataBatch` objects
into multiple `MetricSample`s.

Then this receiver is used in the client to return `Receiver`s instead
of iterators for component data streams.

Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
@shsms shsms force-pushed the change_components branch from 72e2eba to fd54888 Compare June 4, 2025 12:09
@shsms
Copy link
Contributor

shsms commented Jun 4, 2025

Also did for the AggregatedDataStream, and some more simplification and cleanup.

@shsms shsms merged commit 07842a9 into frequenz-floss:v0.x.x Jun 4, 2025
5 checks passed
flora-hofmann-frequenz added a commit that referenced this pull request Jun 10, 2025
Think we forgot to take out 'async' when refactoring in #177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants