Created
September 24, 2015 15:41
-
-
Save mitallast/a888e4cdbc3f67e9db47 to your computer and use it in GitHub Desktop.
sum by person example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; -*- mode: clojure; -*- | |
; vim: filetype=clojure | |
(logging/init {:file "/var/log/riemann/riemann.log"}) | |
; Listen on the local interface over TCP (5555), UDP (5555), and websockets | |
; (5556) | |
(let [host "127.0.0.1"] | |
(tcp-server {:host host}) | |
(udp-server {:host host}) | |
(ws-server {:host host})) | |
; Expire old events from the index every 5 seconds. | |
(periodically-expire 1) | |
(let [index (index)] | |
; Inbound events will be passed to these streams: | |
(streams | |
(where (service "dialog.client_question") | |
(by #(:person %) | |
(fixed-time-window 5 | |
(smap folds/sum | |
#(info (str "sum " (:metric %) " person " (:person %))) | |
) | |
) | |
)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment