-
Notifications
You must be signed in to change notification settings - Fork 7
Description
What's needed?
The live data streaming RPCs are using the frequenz.api.common.v1.microgrid.components.ComponentData message as the response, but this message is very flexible to allow streaming data efficiently in many different use cases (like streaming historical data).
Supporting all the provided flexibility is difficult for clients, so if there are some data restriction guarantees, these should be properly documented in the RPC response documentation so clients don't need to include unnecessary extra complexity.
Proposed solution
Document the ReceiveComponentDataStreamResponse.data field to mention that for a single response for a live data message:
- All the present
data.metric_samplesanddata.stateswill have the samesampled_attimestamp. - Duplicate
metrics can only appear in thedata.metric_samplesif every metric have a differentconnection.name(so,connectionshould be present, and the name of the connection should not appear duplicated for a particularMetric). - When a
metricappears only once, theconnectioninformation MAY be present. When ametricappears multiple times, all instances MUST have theconnectioninformation filled in. - There will be at most one
data.states.1
The same restriction should documented for ReceiveSensorDataStreamResponse.data, adapting to the particular fields of that response.
Use cases
Live data streaming client implementation.
Footnotes
-
@tiyash-basu-frequenz could there be none? Or is it guaranteed to have at least one? In any case I don't think it makes a huge difference for the client implementation if it can be 0 or 1 or if is guaranteed to have 1, so we can leave it open. ↩