Skip to content

Conversation

@tiyash-basu-frequenz
Copy link
Contributor

@tiyash-basu-frequenz tiyash-basu-frequenz commented May 21, 2025

closes #326

Copilot AI review requested due to automatic review settings May 21, 2025 10:58
@tiyash-basu-frequenz tiyash-basu-frequenz requested a review from a team as a code owner May 21, 2025 10:58
@github-actions github-actions bot added part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files labels May 21, 2025
@tiyash-basu-frequenz tiyash-basu-frequenz self-assigned this May 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR renames the sampled_at timestamp fields to origin_time for consistency across sensor, component, and metric protos.

  • Renamed sampled_at fields to origin_time in sensor, component, and metric messages
  • Updated example comments to use origin_time
  • Added release note entry for the rename

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto Renamed sampled_at to origin_time and updated examples
proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto Renamed sampled_at to origin_time and updated examples
proto/frequenz/api/common/v1/metrics/metrics.proto Renamed sampled_at to origin_time
RELEASE_NOTES.md Added entry for the rename (with a typo)
Comments suppressed due to low confidence (4)

proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto:172

  • [nitpick] Update this comment to reflect the new origin_time field name, e.g., "The origin time of this state snapshot."
// The time at which the state was sampled.

proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto:212

  • [nitpick] Modify this comment to mention origin_time instead of sampling, e.g., "The UTC origin time of this metric sample."
// The UTC timestamp of when the metric was sampled.

proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto:478

  • [nitpick] Align this comment with origin_time, for example: "The origin time of the component state snapshot."
// The time at which the state was sampled.

proto/frequenz/api/common/v1/metrics/metrics.proto:188

  • [nitpick] Update this comment to reference origin_time, e.g., "The UTC origin time of when the metric was recorded."
// The UTC timestamp of when the metric was sampled.

llucax
llucax previously approved these changes May 22, 2025
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

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

I'm surprised about origin_time, I thought and feel for a sample, sample_time feels more natural and obvious, but I guess this was already discussed and decided on, so I will approve.

Nevertheless, I will disable auto-merge just in case to be extra careful.

@tiyash-basu-frequenz
Copy link
Contributor Author

I'm surprised about origin_time, I thought and feel for a sample, sample_time feels more natural and obvious, but I guess this was already discussed and decided on

That was my understanding as well. But it looks like the decision has been changed now.

@tiyash-basu-frequenz
Copy link
Contributor Author

I also noticed that the timestamp field for communication component states was snapshot_time I have updated it to origin_time.

Signed-off-by: Tiyash Basu <[email protected]>

# Conflicts:
#	proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto
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 <[email protected]>
Copy link
Contributor

@thomas-nicolai-frequenz thomas-nicolai-frequenz left a comment

Choose a reason for hiding this comment

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

LGTM

@tiyash-basu-frequenz tiyash-basu-frequenz added this pull request to the merge queue May 22, 2025
Merged via the queue into frequenz-floss:v0.x.x with commit d863621 May 22, 2025
6 checks passed
@tiyash-basu-frequenz tiyash-basu-frequenz deleted the 326_origin_time branch May 22, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Snapshot suffix to SensorState and ElectricalComponentState

3 participants