-
Notifications
You must be signed in to change notification settings - Fork 4
Telemetry
-
topic.after(1h, action='login'). Accepts a window as its first argument, followed by any number ofwhereclauses. Once it sees a message that satisfies all of the clauses,afterstarts saving up all messages untilwindowtime has expired, after which it emits a single message that is a list of all actions (including the first "trigger" action) since the window started.afteris most useful when paired withgroup-by. For exampleuser:action:*.group-by(id).after(1h, topic='user:action:login')will produce a map from user-id to lists meaning "all actions this user performed within an hour of logging in". -
topic.where(actions contains 'login'). Looks inside each incoming map, and assumes that the:actionskey is a collection. Emits only those messages where "login" is an element of the:actionscollection. -
topic.min(period: 1m),topic.max(period: 1m),topic.mean(period: 1m). Everyperiodtime, emits the min, max, or mean of all messages received in that period. If no messages were received, does not emit anything. -
topic.scale(0.5),topic.add(-20). Multiplies or adds each message by a constant. -
topic.format('%08.2f'). Applies a C-style printf to each message. Beware that attempting to print a float with%d, or an integer with%f, or really any other sort of type mismatch, will cause rendering to fail. -
topic.top(10),topic.top(10 performance),topic.top(10 by: performance). Assumes that each received message is a map, and keeps only the top N (as specified) entries, with the N largest values. If the second argument (optionally preceded byby:) is specified, then the values are assumed to be maps, in which the value will be looked up. -
topic.map(x.y). Assumes that each received message is a sequence, and uses the nested query on each element of the sequence. -
topic.meta(). Looks up the metadata on each message. Is unlikely to be useful unless we find a reason to put metadata on messages. -
topic.nonempty-vals(). Assumes that each message is a map, and removes entries whose values are empty. -
topic.dissoc(x.y.z). Removes a nested field from each message. -
topic.group-counts(facet, value). Receives a sequence as input, and produces a map from key to number, wherefacetis a query to group by, andvalueis a way to obtain a number from an item in the sequence. Thevaluequery will be summed across each facet. For example,topic.group-counts(user.type, friends)would convert[{user {type a}, friends 3}, {user {type b} friends 10}, {user {type a} friends 2}]into{a 5, b 10}. -
topic.nil?(). Returnstrueif a message is the special valuenull, andfalseotherwise. -
topic.exists?(). The opposite ofnil?(): returnstrueunless the message isnull. -
topic.boolean(). Returnsfalseif a message is eitherfalseornull, true otherwise. -
topic.not(). The opposite ofboolean().