Skip to content

Instantly share code, notes, and snippets.

@yujinqiu
Forked from chiradeep/cloudwatch_riemann_2.clj
Last active August 29, 2015 14:13
Show Gist options
  • Save yujinqiu/55c8f62cfdd23e4c44e2 to your computer and use it in GitHub Desktop.
Save yujinqiu/55c8f62cfdd23e4c44e2 to your computer and use it in GitHub Desktop.
(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 "[email protected]"))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment