snowplow-incubator / common-streams

Other
1 stars 0 forks source link

SourceAndAck should report the processing latency #8

Closed istreeter closed 1 year ago

istreeter commented 1 year ago

This extends the SourceAndAck trait to have an extra method def processingLatency: F[FiniteDuration].

A SourceAndAck handles providing the source of events, and acking the events once processed. So it is the perfect place to implement a measurement of the processing latency of events currently being processed.

This is an instantaneous snapshot measurement. It is designed to be used as part of a Kubernetes health probe, so a pod can get killed if an event gets "stuck" and during processing.