Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Created September 8, 2015 14:48
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 MichaelDrogalis/4d4c81f7ef81e2069e8d to your computer and use it in GitHub Desktop.
Save MichaelDrogalis/4d4c81f7ef81e2069e8d to your computer and use it in GitHub Desktop.
(logging/init {:file "riemann.log"})
(def influx (influxdb {:host "localhost"
:port 8086
:series #(str (:host %) "." (:service %))
:version :0.9
:db "grafana"}))
(def influx-peer-prepare-join (rollup 0 3 #(influx (folds/count %))))
(def influx-peer-accept-join (rollup 0 3 #(influx (folds/count %))))
(def influx-peer-notify-join (rollup 0 3 #(influx (folds/count %))))
(let [host "0.0.0.0"
index (index)]
(tcp-server {:host host})
(udp-server {:host host})
(ws-server {:host host})
(streams
index
#(info "Received event: " %)
(where (service #".*\.event$")
(where (service "peer.prepare-join.event") influx-peer-prepare-join)
(where (service "peer.accept-join.event") influx-peer-accept-join)
(where (service "peer.notify-join.event") influx-peer-notify-join)
(else influx))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment