riemann.index
Maintains a stateful index of events by host, service key. Can be queried to return the most recent indexed events matching some expression. Can expire events which have exceeded their TTL. Presently the only implementation of the index protocol is backed by a nonblockinghashmap, but I plan to add an HSQLDB backend as well.
Indexes must extend three protocols:
- Index: indexing and querying events
- Seqable: returning a list of events
- Service: lifecycle management
Index
protocol
members
clear
(clear this)
Resets the index
delete
(delete this event)
Deletes any event with this host & service from index. Returns the deleted event, or nil.
delete-exactly
(delete-exactly this event)
Deletes event from index. Returns the deleted event, or nil.
expire
(expire this)
Return a seq of expired states from this index, removing each.
insert
(insert this event)
Updates index with event
lookup
(lookup this host service)
Lookup an indexed event from the index
search
(search this query-ast)
Returns a seq of events from the index matching this query AST
query-for-host-and-service
(query-for-host-and-service query-ast)
Check if the AST is only searching for the host and service