recordStats

suspend fun WarpMetricExporter.recordStats(stats: WarpStats, sourceAttr: String = "source")

Records per-source cardinality sketches from stats into this WarpMetricExporter.

For each source us.tractat.kuilt.warp.OpId in stats, its us.tractat.kuilt.crdt.HyperLogLog sketch is merged into the warp.task.cardinality CARDINALITY series. The attribute key that identifies the source is sourceAttr (default "source"); its value is the us.tractat.kuilt.warp.OpId.value string.

Idempotent and commutative. Recording statsA then statsB produces the same result as recording statsA.piece(statsB) once — both exploit HyperLogLog's element-wise-max join under mergeCardinality.

Parameters

stats

The WarpStats snapshot carrying per-source HyperLogLog sketches.

sourceAttr

Attribute key used to label each per-source series.