Created
August 28, 2014 18:00
-
-
Save GeorgeJahad/4713a2305e9441e2a436 to your computer and use it in GitHub Desktop.
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
(deftest flap-event-generation | |
(is (= (:flap-event | |
(inject! (map #(merge {:service "a" :host "a"} %) | |
[{:state "ok", :time 1} | |
{:state "ok", :time 10} | |
{:state "critical", :time 20} | |
{:state "ok", :time 30} | |
{:state "ok", :time 40} | |
{:state "critical", :time 140} | |
{:state "ok", :time 240} | |
{:state "critical", :time 340} | |
{:state "ok", :time 342} | |
{:state "critical", :time 350} | |
{:state "ok", :time 440}]))) | |
(map #(merge | |
{:service "a.state changes" | |
:description "flap detection event" | |
:state "ok" | |
:host "a"} %) | |
[{:metric 1, :time 20} | |
{:metric 2, :time 30} | |
{:metric 3, :time 140} | |
{:metric 4, :time 240} | |
{:metric 3, :time 340} | |
{:metric 4, :time 342} | |
{:metric 5, :time 350} | |
{:metric 5, :time 440}])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment