record

fun record(replica: ReplicaId, value: Double): Patch<Histogram>

Record value as observed by replica. Returns a Patch carrying the minimal delta — one bucket cell plus a sum cell. The receiver is unchanged; apply with piece: histogram = histogram.piece(histogram.record(replica, v)).

Because each cell is a GCounter slot owned by replica, a re-delivered patch is absorbed idempotently — counts never inflate under duplication. As with GCounter, two peers must never share a ReplicaId.

Throws

if value is NaN or infinite.