Take the sum of every event over interval seconds and divide by the interval size.
(let [email (mailer {:from "rie...@localhost.com"})] (streams (where (and (service #"global_inventory_availability$") (not (expired? event))) #(info "[Inside sliding 1 rule]" %) (fixed-time-window 3 (where (not (nil? event)) #(info "event" %) (moving-event-window 3 (where (> metric 100.0) #(info "[TC]" %) (email "a...@localhost.com"))))))))My second info is not getting printed. Can you please help me on this?
--
You received this message because you are subscribed to the Google Groups "Riemann Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to riemann-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
interval size. Emits one event every interval seconds. Starts as soon as an event is received, stops when the most recent event expires. Uses the most recently received event with a metric as a template. Event ttls decrease constantly if no new events arrive.
So for example my metric limit is 100 and if we get three events within 3 sec interval of metrics 101,101,101 so this code should fire and would return sum of metric/interval as (101+101+101)/3, So it would emit a final event with metric of 101 and nothing in that event. So in your code when you write
Hi Haim,You are really a great help here. Yes we are going to have lots of events. I went through rate documentation but i am not well versed with clounjor. So please help me understanding with your pervious suggestion...(where (> metric SOMELIMIT)(with :metric 1(rate 3(where (> metric 1)prn))))Rate Documentation: Take the sum of every event's metric over interval seconds and divide by theinterval size. Emits one event every interval seconds. Starts as soon as an event is received, stops when the most recent event expires. Uses the most recently received event with a metric as a template. Event ttls decrease constantly if no new events arrive.So for example my metric limit is 100 and if we get three events within 3 sec interval of metrics 101,101,101 so this code should fire and would return sum of metric/interval as (101+101+101)/3, So it would emit a final event with metric of 101 and nothing in that event. So in your code when you write(with :metric 1(rate 3(where (> metric 1)What does it mean :metric 1 and > metric 1? Also is there any way i can get data of those three (or no of event) events that caused this? I am storing some attributes there.
Yeah, I don't think either rate nor moving-time-window is gonna solve your problem here. We probably need a new realtime windowing stream. You can back off to defining one using part-time-simple I think.