perf(historian): group-commit batch append on the historization outbox

This commit is contained in:
Joseph Doherty
2026-08-15 21:40:04 -04:00
parent debd44c213
commit 6ff64ca067
5 changed files with 138 additions and 8 deletions
@@ -19,6 +19,17 @@ public interface IHistorizationOutbox : IDisposable
/// <returns>A task that represents the asynchronous operation.</returns>
ValueTask AppendAsync(HistorizationOutboxEntry entry, CancellationToken ct);
/// <summary>
/// Appends a burst of entries with ONE durability commit for the whole batch (group
/// commit). Under PerEntry commit mode this is the per-batch fsync that replaces N
/// per-entry fsyncs; under Periodic it is indistinguishable from N AppendAsync calls.
/// An empty list is a no-op.
/// </summary>
/// <param name="entries">The value records to buffer, in append (FIFO) order.</param>
/// <param name="ct">Cancellation token.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
ValueTask AppendBatchAsync(IReadOnlyList<HistorizationOutboxEntry> entries, CancellationToken ct);
/// <summary>
/// Returns up to <paramref name="max"/> oldest un-acked entries in FIFO order without removing
/// them. Removal happens via <see cref="RemoveAsync"/> once each entry is durably written.