Skip to main content

StreamStats

@rotorsoft/act-root


@rotorsoft/act-root / act/src / StreamStats

Type Alias: StreamStats<E>

StreamStats<E> = object

Defined in: libs/act/src/types/ports.ts:280

Per-stream aggregated stats returned by Store.query_stats.

head and tail follow the git-log convention, not the Unix head/tail convention:

  • head โ€” the latest event (highest id), always present.
  • tail โ€” the earliest event (lowest id), opt-in via QueryStatsOptions.tail.

Type Parametersโ€‹

Eโ€‹

E extends Schemas = Schemas

Event schemas; defaults to Schemas when the caller does not narrow.

Propertiesโ€‹

count?โ€‹

readonly optional count?: number

Defined in: libs/act/src/types/ports.ts:283

Total non-excluded event count for the stream, when options.count is true.


readonly head: Committed<E, keyof E>

Defined in: libs/act/src/types/ports.ts:281

Latest non-excluded event for the stream.


names?โ€‹

readonly optional names?: Readonly<Partial<Record<EventName<E>, number>>>

Defined in: libs/act/src/types/ports.ts:284

Sparse map of event name โ†’ count of events with that name, when options.names is true. Keys are typed as EventName<E> so typos on lookup (e.g. stats.names?.["TicktOpened"]) fail at compile time when the caller narrows E. Empty object never returned โ€” a stream with no matching events is absent from the result map entirely.


tail?โ€‹

readonly optional tail?: Committed<E, keyof E>

Defined in: libs/act/src/types/ports.ts:282

Earliest non-excluded event for the stream, when options.tail is true.