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))))))) | |
) |
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 | |
(where (not (expired? event)) | |
;; over time windows of 3 seconds... | |
(fixed-time-window 3 | |
;; calculate the average value of the metric and emit an average (summary) event | |
(combine folds/mean | |
;; if there are no events in the window, we can get nil events | |
(where (not (nil? event)) | |
#(info "average event" %) |
NewerOlder