-
Notifications
You must be signed in to change notification settings - Fork 20
Add DataSourcingActor #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DataSourcingActor #52
Conversation
f74f173 to
b6a173b
Compare
leandro-lucarella-frequenz
left a comment
There was a problem hiding this comment.
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.
shsms
left a comment
There was a problem hiding this 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: |
There was a problem hiding this comment.
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 (EDIT: I meant frequenz/sdk/types.pyfrequenz/sdk/data_pipeline/types.py). Does that sound ok?
|
|
||
|
|
||
| @dataclass | ||
| class ComponentMetricRequest: |
There was a problem hiding this comment.
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. :)
| class DataSourcingActor: | ||
| """An actor that provides data streams of metrics as time series.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| request_receiver: Receiver[ComponentMetricRequest], | ||
| registry: ChannelRegistry, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
508e778 to
8d2f45c
Compare
6f713b1 to
e0a563f
Compare
leandro-lucarella-frequenz
left a comment
There was a problem hiding this comment.
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 :)
78521e8 to
ee5b6c6
Compare
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
ee5b6c6 to
ebca3fa
Compare
Closes #30