Last active
August 29, 2015 13:58
-
-
Save mfournier/9973032 to your computer and use it in GitHub Desktop.
simplifed version of http://riemann.io/howto.html#alerting-when-a-certain-percentage-of-events-happe
This file contains hidden or 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
| (streams | |
| (where (service "riemann streams rate") | |
| (fixed-time-window 10 | |
| (smap (fn [events] | |
| (let [event_count (count events) now (quot (System/currentTimeMillis) 1000)] | |
| (prn {:host "foo" :service "bar" :metric event_count :time now}) | |
| (index {:host "foo" :service "bar" :metric event_count :time now}) | |
| ) | |
| )) | |
| ) | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment