Created
January 9, 2014 23:24
-
-
Save chiradeep/8344091 to your computer and use it in GitHub Desktop.
Riemann function for threshold crossing alerts
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
(defn tc [wndtime numwnds threshold & children] | |
(fixed-event-window wndtime | |
(combine folds/mean | |
(moving-event-window numwnds | |
(combine folds/minimum | |
(where (> metric threshold) | |
;;create a threshold crossing event | |
(with {:host nil :state "threshold crossed" :description (str "service crossed the value of " threshold " over " numwnds " windows of " wndtime " seconds")} | |
(apply sdo children))))))) | |
) | |
(streams | |
(tc 3 3 6.0 | |
(email "itguy@othercoolapp.net")) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment