lamina.query documentation
parse-descriptor
fn
Parses the query descriptor down to the canonical representation.
query-seq
fn
Takes a sequence s
and a descriptor
, which may either be a function that takes a channel, or a query descriptor.
Required parameters:
:timestamp
- a function that takes an element of the sequence and returns the associated time.
Optional parameters:
:payload
- a function that takes an element of the sequence and returns the assocated value (defaults to identity)
:period
- the default period for periodic operators
:seq-generator
- a function that takes a pattern (i.e. in "abc.rate()" the pattern is "abc") and returns the base
sequence. This is useful for merging together multiple streams in your query.
query-seqs
fn
A variant of query-seq
which allows for multiple seqs to be simultaneously processed. Instead of taking a single
seq, it takes a map of descriptors onto sequences. If the sequence is nil, the descriptor is presumed to describe both
the origin and transform (i.e. {"abc.rate()" nil}
is valid, `{".rate()" nil} is not).
Returns a map of descriptors onto the result sequences.
query-stream
fn
A function which applies a transform to a stream, with some convenience methods for dealing with non-wall clock analysis.
query-streams
fn
A variant of query-stream, wihch takes a map of multiple descriptors onto the source channels, and returns a map of those same descriptors onto the results.