Skip to content

Instantly share code, notes, and snippets.

@tamsky
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamsky/d6dfa961d4b577ba7a8f to your computer and use it in GitHub Desktop.
Save tamsky/d6dfa961d4b577ba7a8f to your computer and use it in GitHub Desktop.
riemann.streams=> (def s (by [:tt :host] (ddt-events (partial prn :ddt))))
#'riemann.streams/s
riemann.streams=> (s {:tt 0 :host "foo" :metric 1})
true
riemann.streams=> (s {:tt 0 :host "foo" :metric 2})
true
riemann.streams=> (s {:tt 0 :host "foo" :metric 3})
true
riemann.streams=> (def s (by [:tt :host] (moving-event-window 2 (partial prn :got) (ddt-events (partial prn :ddt)))))
#'riemann.streams/s
riemann.streams=> (s {:tt 0 :host "foo" :metric 1})
:got [{:tt 0, :host "foo", :metric 1}]
true
riemann.streams=> (s {:tt 0 :host "foo" :metric 2})
:got [{:tt 0, :host "foo", :metric 1} {:tt 0, :host "foo", :metric 2}]
true
riemann.streams=> (s {:tt 0 :host "foo" :metric 3})
:got [{:tt 0, :host "foo", :metric 2} {:tt 0, :host "foo", :metric 3}]
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment