-
Notifications
You must be signed in to change notification settings - Fork 4
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
Decide on data structure for Reporting client #29
Comments
One unrelated comment is I recommend using the |
For me this is very hard to think about without knowing how do we plan to use this data. As long as we don't have a clear picture, I think the safest bet is to make the client retrieve the data as it comes in the API and then adapt it at another level. Without changing the protocol, we'll still have to do this transformation, and limiting what the user can do with the client artificially doesn't sound like a great idea. |
Agree that there should be a way to retrieve the data as close as possible to the message definition. But I suggest to also keep the current approach as an alternative, since this format is already being used by multiple users and seems to be very useful. @llucax What is your idea of "another level"? A restricted client on top of the slim client? In the same repo? |
What I mean I wouldn't make the adapted retrieval the only way to retrieve the data, maybe it is more clean in pseudo-code form: adapted_data = await client.retrieve() # Not for now, as we don't know if this will fit all use cases
adapted_data = adapt_data(await client.retrieve()) # Yes! So if somebody needs to retrieve the data from the server in a non-adapted way (or adapt it differently) they can still use the client and don't have to get into the mess of using the raw bindings.
|
Sounds good in principle, I'm still not very involved in all the protobuf stuff in common that is shared between microgrid and reporting, so I feel I don't have a full picture to have a strong opinion, so please don't hold me accountable if I change my mind in the future when I get more involved 😆 But again I think we are still at an exploration stage so I guess this is all fine, right? |
Sounds good to me! 👍 Let me keep looking into it and share as I go along for further discussions. |
What's needed?
A data structure that can expose the metrics as well as the states per microgrid and component.
Proposed solution
Option to be discussed:
Use cases
Not only metrics, but also states, warnings and errors should be exposed.
Alternatives and workarounds
Any alternative ideas are welcome.
Additional context
As discussed in API usergroup meeting on 6th May 2024:
Currently, the
ReportingApiClient
only exposesMetricSamples
using a namedtuple structure.To additionally expose
States
:charging
andrelay_open
The example output structure from the protobuf is as follows with the entry point to the GRPC returning those messages.
To retrieve
MetricSample
information, we use the following helper in the ReportingApiClient:The text was updated successfully, but these errors were encountered: