From fe88fd16f9623249e590c1dd5a797606d2a33282 Mon Sep 17 00:00:00 2001 From: Tiyash Basu Date: Wed, 21 May 2025 12:57:25 +0200 Subject: [PATCH 1/4] Renamed `sampled_at` timestamps for states to `origin_time` Signed-off-by: Tiyash Basu --- RELEASE_NOTES.md | 1 + .../microgrid/electrical_components/electrical_components.proto | 2 +- proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9f5bba00..fe7e0008 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -33,6 +33,7 @@ - Renamed field `ElectricalComponent.category_type` to `ElectricalComponent.category_specific_info` to better reflect its purpose. - Renamed `ElectricalComponentState` to `ElectricalComponentStateSnapshot` to better reflect its purpose. - Renamed `SensorState` to `SensorStateSnapshot` to better reflect its purpose. +- Renamed `sampled_at` timestamps for state snapshots to `origin_time`. ## Bug Fixes diff --git a/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto b/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto index a3086799..0612e875 100644 --- a/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto +++ b/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto @@ -476,7 +476,7 @@ message ElectricalComponentDiagnostic { // Representation of a component state, warnings, and errors. message ElectricalComponentStateSnapshot { // The time at which the state was sampled. - google.protobuf.Timestamp sampled_at = 1; + google.protobuf.Timestamp origin_time = 1; // List of operational states currently active for the component. diff --git a/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto b/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto index a18f4180..814976ff 100644 --- a/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto +++ b/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto @@ -170,7 +170,7 @@ message SensorDiagnostic { // Representation of a sensor state and errors. message SensorStateSnapshot { // The time at which the state was sampled. - google.protobuf.Timestamp sampled_at = 1; + google.protobuf.Timestamp origin_time = 1; // List of states of the microgrid sensor. // From badade0a716941ca7a6c0fd2c42c4fd14021ddb5 Mon Sep 17 00:00:00 2001 From: Tiyash Basu Date: Thu, 22 May 2025 11:52:45 +0200 Subject: [PATCH 2/4] Rename `sampled_at` to `sample_time` in metrics and sensor metrics Signed-off-by: Tiyash Basu --- RELEASE_NOTES.md | 1 + proto/frequenz/api/common/v1/metrics/metrics.proto | 2 +- .../electrical_components/electrical_components.proto | 8 ++++---- .../api/common/v1/microgrid/sensors/sensors.proto | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index fe7e0008..6521e7f7 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -34,6 +34,7 @@ - Renamed `ElectricalComponentState` to `ElectricalComponentStateSnapshot` to better reflect its purpose. - Renamed `SensorState` to `SensorStateSnapshot` to better reflect its purpose. - Renamed `sampled_at` timestamps for state snapshots to `origin_time`. +- Renamed `sampled_at` timestamps for metric samples to `sample_time`. ## Bug Fixes diff --git a/proto/frequenz/api/common/v1/metrics/metrics.proto b/proto/frequenz/api/common/v1/metrics/metrics.proto index 1f57c63e..cea6e14d 100644 --- a/proto/frequenz/api/common/v1/metrics/metrics.proto +++ b/proto/frequenz/api/common/v1/metrics/metrics.proto @@ -186,7 +186,7 @@ enum Metric { // command, clients need to request current values within the bounds. message MetricSample { // The UTC timestamp of when the metric was sampled. - google.protobuf.Timestamp sampled_at = 1; + google.protobuf.Timestamp sample_time = 1; // The metric that was sampled. Metric metric = 2; diff --git a/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto b/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto index 0612e875..63c8c938 100644 --- a/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto +++ b/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto @@ -524,13 +524,13 @@ message ElectricalComponentStateSnapshot { // metric_samples: [ // /* list of metrics for multiple timestamps */ // { -// sampled_at: "2023-10-01T00:00:00Z", +// sample_time: "2023-10-01T00:00:00Z", // metric: "DC_VOLTAGE_V", // value: {}, // bounds: {}, // }, // { -// sampled_at: "2023-10-01T00:00:00Z", +// sample_time: "2023-10-01T00:00:00Z", // metric: "DC_VOLTAGE_V", // value: {}, // bounds: {}, @@ -539,13 +539,13 @@ message ElectricalComponentStateSnapshot { // states: [ // /* list of states for multiple timestamps */ // { -// sampled_at: "2023-10-01T00:00:00Z", +// sample_time: "2023-10-01T00:00:00Z", // states: [], // warnings: [], // errors: [], // }, // { -// sampled_at: "2023-10-01T00:00:00Z", +// sample_time: "2023-10-01T00:00:00Z", // states: [], // warnings: [], // errors: [], diff --git a/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto b/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto index 814976ff..c0f46615 100644 --- a/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto +++ b/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto @@ -210,7 +210,7 @@ message SensorStateSnapshot { // Representation of a sampled sensor metric along with its value. message SensorMetricSample { // The UTC timestamp of when the metric was sampled. - google.protobuf.Timestamp sampled_at = 1; + google.protobuf.Timestamp sample_time = 1; // The metric that was sampled. frequenz.api.common.v1.metrics.Metric metric = 2; @@ -230,19 +230,19 @@ message SensorMetricSample { // metric_samples: [ // /* list of metrics for multiple timestamps */ // { -// sampled_at: "2023-10-01T00:00:00Z", +// sample_time: "2023-10-01T00:00:00Z", // metric: "METRIC_SENSOR_TEMPERATURE", // value: metric_value_variant: {simple_metric: {value: 23.5}, // }, // { -// sampled_at: "2023-10-01T00:00:00Z", +// sample_time: "2023-10-01T00:00:00Z", // metric: "METRIC_SENSOR_RELATIVE_HUMIDITY", // value: metric_value_variant: {simple_metric: {value: 23.5}, // } // ], // states: [ // { -// sampled_at: "2023-10-01T00:00:00Z", +// sample_time: "2023-10-01T00:00:00Z", // states: [], // errors: [], // }, From 89de32dc2ad50630824c803e67fcbd83db857b7b Mon Sep 17 00:00:00 2001 From: Tiyash Basu Date: Thu, 22 May 2025 12:01:54 +0200 Subject: [PATCH 3/4] Update documentation for `origin_time` field in proto files Signed-off-by: Tiyash Basu # Conflicts: # proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto --- .../communication_components/communication_components.proto | 2 +- .../microgrid/electrical_components/electrical_components.proto | 2 +- proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto b/proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto index 5046c595..66cd5140 100644 --- a/proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto +++ b/proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto @@ -173,7 +173,7 @@ message CommunicationComponentDiagnostic { // in time, so there is only a single `snapshot_time`. any parallel reads // happening to produce this data are collapsed under that timestamp. message CommunicationComponentStateSnapshot { - // the UTC time when this snapshot was taken. + // The UTC time when the state was originally captured. google.protobuf.Timestamp snapshot_time = 1; // one or more high-level state codes active at snapshot_time. diff --git a/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto b/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto index 63c8c938..64bb5287 100644 --- a/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto +++ b/proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto @@ -475,7 +475,7 @@ message ElectricalComponentDiagnostic { // Representation of a component state, warnings, and errors. message ElectricalComponentStateSnapshot { - // The time at which the state was sampled. + // The UTC time when the state was originally captured. google.protobuf.Timestamp origin_time = 1; diff --git a/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto b/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto index c0f46615..dac49cdd 100644 --- a/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto +++ b/proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto @@ -169,7 +169,7 @@ message SensorDiagnostic { // Representation of a sensor state and errors. message SensorStateSnapshot { - // The time at which the state was sampled. + // The UTC time when the state was originally captured. google.protobuf.Timestamp origin_time = 1; // List of states of the microgrid sensor. From de13b82b01f5c6b9e57481eb32f35e0a3b27f823 Mon Sep 17 00:00:00 2001 From: Tiyash Basu Date: Thu, 22 May 2025 11:56:05 +0200 Subject: [PATCH 4/4] Rename snapshot_time to origin_time in communication component state This commit renames the field `snapshot_time` to `origin_time` in the `CommunicationComponentStateSnapshot` message. This makes the field name consistent across `ElectricalComponentStateSnapshot` and `SensorStateSnapshot` messages. Signed-off-by: Tiyash Basu --- .../communication_components/communication_components.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto b/proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto index 66cd5140..04e961e6 100644 --- a/proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto +++ b/proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto @@ -174,7 +174,7 @@ message CommunicationComponentDiagnostic { // happening to produce this data are collapsed under that timestamp. message CommunicationComponentStateSnapshot { // The UTC time when the state was originally captured. - google.protobuf.Timestamp snapshot_time = 1; + google.protobuf.Timestamp origin_time = 1; // one or more high-level state codes active at snapshot_time. //