Many places in Riemann need to understand whether the events they’re working with are currently valid, and whether a given host/service combo has expired. The expiration tracker provides a stateful data structure for tracking new events, figuring out when expirations should be emitted, and calling back when they need to occur.
When will an event expire?
Is this event expired? Events are expired if their state is “expired” and time is past, if their time + ttl is less than the current time.
Returns a seq of expired events, which are deleted from the tracker as they’re yielded.
Release resources associated with the tracker.
(update! t event)
Update a tracker with a new event.
(tracker! expired-sink expiration-interval)
Constructs a new expiration tracker which expires events every expiration-interval seconds, calling (expired-sink event) with each.