fms

Replay a feeder in Chronix

Query a five-minute reference day, compare congestion windows, and rebuild the chart in a fresh tenant.

A cold-snap reference day with seed 1 has 135 congested minutes in the baseline and zero under control. The simulator exports both trajectories on the same virtual clock. Use Chronix to see when they diverge.

fms sim cold-snap --seed 1 --out run

The bundle includes telemetry.lp, one feeder-level point per five minutes. Timestamps are UTC epoch nanoseconds. The tags identify the reference day, seed and selection policy. Loading is signed transformer power as a percentage of rating. Minimum voltage is the lowest node voltage in per unit. A congestion flag includes both thermal and voltage violations across the feeder. The command count includes retries. All values describe synthetic reference runs. Keep the bundle for rebuilding the telemetry view and the anchored evidence log for verification.

Import a reference day๐Ÿ”—

Use Chronix 0.9 with a provisioned, tenant-scoped credential and namespace. Set CHRONIX_URL to the HTTPS endpoint, CHRONIX_TOKEN to the credential and CHRONIX_NAMESPACE to its namespace. Re-importing the same bundle preserves its point count and values on Chronix 0.9.0. Use a fresh namespace when comparing simulator versions. Backfill admits the reference timestamps outside the live ingestion window.

curl --fail-with-body "$CHRONIX_URL/write?precision=ns&backfill=true" \
  -H "Authorization: Bearer $CHRONIX_TOKEN" -H "X-Namespace: $CHRONIX_NAMESPACE" \
  -H 'Content-Type: text/plain' --data-binary @run/telemetry.lp

Plot the two trajectories๐Ÿ”—

Run this SQL in a session scoped to the same namespace. Use the simulation date shown by fms sim for the chart range. The first sample for this January day is 23:00 UTC on the preceding date.

SELECT _time, baseline_loading_pct, controlled_loading_pct,
       baseline_min_pu, controlled_min_pu, commands
FROM fms_reference
WHERE day = 'cold-snap' AND seed = '1' AND selection = 'netzbereich'
ORDER BY _time

For the overload windows, filter on baseline_congested = 1 or controlled_congested = 1. To check the whole import against report.json, run:

SELECT count(*) AS samples, 5 * sum(baseline_congested) AS baseline_minutes,
       5 * sum(controlled_congested) AS controlled_minutes, sum(commands) AS command_outputs
FROM fms_reference
WHERE day = 'cold-snap' AND seed = '1' AND selection = 'netzbereich'
SamplesBaseline minutesControlled minutesCommand outputs
2881350423

Verify from a checkout๐Ÿ”—

With Python 3.9+ and chronixd on PATH, run python3 scripts/check-chronix.py run. It creates two temporary loopback stores in succession, provisions namespace-bound credentials, replays the bundle and checks every ordered SQL row, retries the import, and verifies tenant isolation. Pass --chronixd /path/to/chronixd to select a particular binary.