Skip to content

Conversation

@shsms
Copy link
Contributor

@shsms shsms commented Oct 25, 2022

Closes #30

@shsms shsms requested a review from a team as a code owner October 25, 2022 15:11
@github-actions github-actions bot added part:actor Affects an actor ot the actors utilities (decorator, etc.) part:tests Affects the unit, integration and performance (benchmarks) tests labels Oct 25, 2022
@shsms shsms force-pushed the 30-data-sourcing-actor branch 2 times, most recently from f74f173 to b6a173b Compare October 26, 2022 10:26
Copy link
Contributor

Choose a reason for hiding this comment

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

The microgrid source was a bit hard to follow, not sure if there is a simpler way to do it because I guess it has quite a bit of inherent complexity, but maybe more comments can be added. I feel I lacked a more high-level overview when reviewing about what are the responsibilities of each part, or the general algorithm, or even comments on the main attributes for microgrid source class.

Copy link
Contributor Author

@shsms shsms left a comment

Choose a reason for hiding this comment

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

I will add some more comments tomorrow as well.



@dataclass
class ComponentMetricRequest:
Copy link
Contributor Author

@shsms shsms Oct 26, 2022

Choose a reason for hiding this comment

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

Both ComponentMetricId and ComponentMetricRequest need to be accessible for other actors, and will probably be accepted by the resampling actor too? So I put it in the frequenz/sdk/types.py (EDIT: I meant frequenz/sdk/data_pipeline/types.py). Does that sound ok?



@dataclass
class ComponentMetricRequest:

Choose a reason for hiding this comment

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

For me it doesn't sound like a general interface, I see it more owned by the data sourcing actor, even if other actors use it. It is completely coupled with how the data sourcing actor works and will have to be updated if the data sourcing actor interface changes, this is why I think they belong together.

Yes, probably the resampling actor will use it, but it can expose an alias, because eventually the resampling actor could have other parameters in the request (I was thinking that maybe, just maybe, we could want at some point to request a metric to be resampled with a particular resampling function after we talked about resampling a xxx_max metric for example). In that case it will have to define it's own request.

All that said, it is still a style issue I guess, so I won't oppose if you want to leave it like this. :)

Comment on lines +24 to +26
class DataSourcingActor:
"""An actor that provides data streams of metrics as time series."""

def __init__(
self,
request_receiver: Receiver[ComponentMetricRequest],
registry: ChannelRegistry,
Copy link
Contributor

@sahas-subramanian-frequenz sahas-subramanian-frequenz Oct 27, 2022

Choose a reason for hiding this comment

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

we probably need a global singleton registry as well, before this PR can be merged.

Choose a reason for hiding this comment

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

Why? I mean why it is a requirement for this to be merged?

Choose a reason for hiding this comment

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

Because we're passing the registry as an argument to an actor, and that's not ideal.

We can of course merge, but then we'll have to come back and fix this afterwards.

@shsms shsms force-pushed the 30-data-sourcing-actor branch 3 times, most recently from 6f713b1 to e0a563f Compare October 27, 2022 16:02
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, I can approve after the fixups are squashed (otherwise I will have to approve again anyway :)

shsms added 2 commits October 28, 2022 13:55
Signed-off-by: Sahas Subramanian <[email protected]>
@shsms shsms force-pushed the 30-data-sourcing-actor branch from ee5b6c6 to ebca3fa Compare October 28, 2022 11:56
@sahas-subramanian-frequenz sahas-subramanian-frequenz merged commit e6b4b89 into frequenz-floss:v0.x.x Oct 28, 2022
@shsms shsms deleted the 30-data-sourcing-actor branch November 1, 2022 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:actor Affects an actor ot the actors utilities (decorator, etc.) part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a data sourcing actor

3 participants