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.
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.
(expiration-time event)
When will an event expire?
When will an event expire?
(expired? event)
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.
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.
(expired-events! t)
Returns a seq of expired events, which are deleted from the tracker as they're yielded.
Returns a seq of expired events, which are deleted from the tracker as they're yielded.
(shutdown! t)
Release resources associated with the tracker.
Release resources associated with the tracker.
(update! t event)
Update a tracker with a new event.
Update a tracker with a new event.
(tracker! expired-sink)
(tracker! expired-sink expiration-interval)
Constructs a new expiration tracker which expires events every expiration-interval seconds, calling (expired-sink event) with each.
Constructs a new expiration tracker which expires events every expiration-interval seconds, calling (expired-sink event) with each.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close