Skip to content

Add AlarmMeasurement.ShardID for day-sharded event details#62

Open
ritchiecarroll wants to merge 2 commits into
developmentfrom
updated-event-details-ops
Open

Add AlarmMeasurement.ShardID for day-sharded event details#62
ritchiecarroll wants to merge 2 commits into
developmentfrom
updated-event-details-ops

Conversation

@ritchiecarroll

@ritchiecarroll ritchiecarroll commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an AlarmMeasurement.ShardID property used by openHistorian's new day-sharded event-details storage. This is a small, additive, foundational change; the rest of the feature lives in the SnapDB and openHistorian repositories (see Related PRs).

What changed

  • AlarmMeasurement.ShardID (ushort) — identifies the day-based shard that holds the alarm's event details.
    • Derived from the day the alarm was raised.
    • Carried on both the raise and the clear measurements, so a cleared alarm (which may be archived on a later day) still resolves its details to the shard for the raise day.
    • A value of 0 indicates no associated event details.
  • Minor removal of unused using directives in adapter/model files (no behavior change).

Why

openHistorian encodes this shard identifier into the archived HistorianValue and uses it to locate the correct per-day SQLite database that stores the alarm's event details. Without a carrier on the measurement, the cleared record (archived under the clear-day timestamp) could not point back to the raise-day shard.

Reviewer / tester considerations

  • Backward compatible / additive: default value is 0; existing alarm flows are unaffected unless ShardID is explicitly set (which only openHistorian's AlarmEngine does).
  • Publish ordering: openHistorian's non-Development builds consume this via the Gemstone.Timeseries NuGet package, so this must be published before those builds can pick up the feature. Development-configuration builds reference the project directly.
  • No configuration or migration steps required in this repo.

Testing

Exercised indirectly by openHistorian's event-details unit tests (the alarm write path sets and round-trips ShardID). No new tests in this repo given the change is a single additive property.

Related PRs

This change is part of an event-details feature spanning three repositories:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant