PublishedStream

class PublishedStream(val context: String, val aggregate: String)

A published stream through a run (#7109): how fast the commits of its aggregate of context reach the transport sink's topic and how far behind they fall. Every second, for each partition of the context's log, one store session reads the log's head, the transport sink's checkpoint there (wow.transport-sink.<aggregate>, the highest of its groups) and the oldest commit of the aggregate above that checkpoint, its commit time and its aggregate: on PostgreSQL in one statement, so one snapshot (postgresQuery); on MongoDB in one round of reads by position, the log's _id (mongoLoop). summary turns the rounds into the run's figures.

The checkpoint is saved once a second (wow.subscription.checkpoint-interval), after the topic took the records: what it says is published was, and up to that interval more may be. So the lag it gives is an upper bound by up to the interval, and so is the catch-up. Not read each second: the topic's end offsets (kafka-get-offsets is a JVM of its own a read, so Resources reads them before and after the run), and each aggregate's count above the checkpoint (a scan of the whole unpublished tail each second); with --distribution=single the one aggregate's lag is its partition's.

Constructors

Link copied to clipboard
constructor(context: String, aggregate: String)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Sample(val at: Long, val partition: Int, val head: Long, val checkpoint: Long?, val oldestCommit: Long?, val oldestAggregate: String?)

One partition's read at at (epoch milliseconds): the log's head, the sink's checkpoint (null before its first save there), and the commit time (oldestCommit, epoch milliseconds) and aggregate of the oldest commit of the stream above the checkpoint (null when there is none).

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The transport sink's subscription of the stream.

Functions

Link copied to clipboard

The mongosh loop: postgresQuery's rows, a line a partition a second. A partition's head is its highest stream (a placeholder has no version), as the log reads it; positions are _ids, the partition above SEQUENCE_BITS bits of sequence.

Link copied to clipboard

The statement psql repeats: one row a partition, epoch|partition|head|checkpoint|commit time|aggregate, the checkpoint -1 before the sink's first save there and the commit time -1 (its aggregate empty) when nothing of the aggregate lies above it. The partition's counter is its head (it commits with the append); the oldest commit is one read of the log's key, (partition, sequence).

Link copied to clipboard
open override fun toString(): String