observe

fun observe(replica: ReplicaId, timestamp: Long, value: Double): Gauge

Record that replica observed value at timestamp. Returns a new state carrying just this tagged observation; absorb it with piece (gauge = gauge.piece(gauge.observe(replica, ts, v))) so an older-timestamp observation never overwrites a newer one.

The (replica, timestamp) pair must uniquely identify this observation — see LWWRegister.set for the tag-uniqueness contract.

Not the same shape as LWWRegister.set, deliberately. #2087 made that one go through the join, so a losing write can no longer move the writer down the lattice. This one keeps the delta contract stated above — it hands back the bare observation, whatever the gauge already holds — so an observe at a losing timestamp still reads below the state it came from until the prescribed piece absorbs it. Whether a gauge should adopt set's shape instead is #2712, filed rather than folded in here.

Throws

if value is NaN or infinite.