Repository navigation
JasperFx 2.102.0
JasperFx 2.102.0 is a minor release with one new IEventDatabase capability. It lets monitoring report projection lag as time rather than as a count of events.
IEventDatabase.FetchFirstEventTimestampsAfterAsync, the age of the oldest unprocessed event (#1150 / #1151).- Why: a backlog counted in events says little on a multi-tenant fleet. 40,000 events spread over 130 tenants is fine; 40,000 on one tenant for an hour is not. The age of the oldest event a shard hasn't processed tells those two apart, and it's the number an SLO is written against. CritterWatch reaches event stores only through the JasperFx.Events abstractions, so the question has to be answerable here.
- What it answers: for each
(TenantId, Sequence)position, it returns the store's timestamp of the first event with a higher sequence, ornullwhen there is none (the shard is caught up). You get onePendingEventAge(TenantId, Sequence, Timestamp)per position, in the order asked.PendingEventAgealso hasIsCaughtUpandAgeAt(now), which never returns a negative age when clocks are skewed. - Tenants: a null tenant considers every event in the database. A non-null tenant considers only that tenant's events under conjoined tenancy or per-tenant partitioning.
- Archived events don't count. The async daemon skips them, so a shard is never waiting on one.
- Cost: stores answer the whole list in one round trip per database, with one sequence seek per position, never a scan or a count. Ask only about shards that are behind.
- Default implementations: the batched member throws
NotSupportedExceptionon a store that hasn't implemented it. Anulltimestamp means "caught up", so that default can't answer without reporting a lagging shard as current. The single-position convenienceFetchFirstEventTimestampAfterAsync(sequence, tenantId)calls the batched member by default. The in-memory prototyping store implements both.
- Compliance: a new
PendingEventAgeCompliancesuite, gated bySupportsPendingEventAges(default false), with 12 facts. They cover the "strictly after" rule, ordering and duplicates, archived events and conjoined tenant scoping. A newSupportsStreamArchivingfixture flag (default true) gates the archived facts. Stores must enroll the new suite (or excuse it) orComplianceSuiteInventory.AssertEnrolledfails.
Marten, Polecat and Fisher implement the method in their JasperFx 2.102.0 upgrades.
What's Changed
- IEventDatabase: timestamp of the first event after a sequence, batched (#1150) by @jeremydmiller in #1151
Full Changelog: v2.101.1...v2.102.0