Created
March 28, 2014 04:47
-
-
Save ProTip/9825589 to your computer and use it in GitHub Desktop.
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
(streams | |
; Index all events immediately. | |
; index | |
(where (service "http") | |
(where (not (expired? event)) | |
(where (state "200") | |
(by :host | |
(runs 3 :state | |
index | |
prn)) | |
(else | |
(with :state "critical" | |
(by :host | |
(runs 3 :state | |
index | |
prn))))))) | |
; Calculate an overall rate of events. | |
(with {:metric 1 :host nil :state "ok" :service "events/sec"} | |
(rate 5 index)) | |
; Log expired events. | |
(expired | |
(fn [event] (info "expired" event)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment