On Thursday, September 22, 2016 at 11:46:52 PM UTC+5:30, [email protected] 
wrote:
> Three consecutive times means for 6 minutes total so:
> 
> 
> stream
>    |from()
>      .measurement('m')
>    |window()
>        .period(2m)
>        .every(2m)
>    |max('value')
>    |window()
>        .period(6m)
>        .every(6m)
>    |alert()
>       .crit(lambda: "max" >= threshold)
>       // mark that all points need to match the criteria 
>       // in order to trigger the alert.
>       .all()
> 
> 
> 
> On Thursday, September 22, 2016 at 2:54:22 AM UTC-6, guotao Yao wrote:
> 
> 
> 
> I have a scenario like the next:
> Evaluate the max value every 2 minutes,  if the max value greater than a 
> threshold three consecutive times, alert will be triggered.
> 
> 
> How can I write the tick script?
> 
> 
> Thanks!
> 
> 在 2016年9月21日星期三 UTC+8下午10:49:09,[email protected]写道:
> All data that is within the time now - period will be emitted into the 
> pipeline. This means data can be emitted more than once if the period is 
> longer than every.
> 
> On Wednesday, September 21, 2016 at 12:08:02 AM UTC-6, guotao Yao wrote:
> Hi all,
> 
> 
> I have some confusions when I use kapacitor window node,
> 
> 
> 1.  the every property define how ofen the data is emitted into the pipeline. 
>      But, I want to know whether all data during the time will be emitted 
> into the pipeline, or is it just a data will be emitted into the pipeline.
> 
> 
> 
> 
> Thanks!

Hello, 

Is there any way we can do the above this in batch? 
My use case is sort of similar, and your above script helped. 
I want to find the sum of a field for a given window (lets say window of 1 
hour), and then take the mean of last n windows. 

I am using this :

var frequency = 15m 
var window_size = 2h

var baseline = stream
   |from()
     .measurement('mm')
     .groupBy('t1', 't2')
   |window()
       .period(frequency)
       .every(frequency)
   |sum('count')
   |window()
       .period(window_size)
       .every(frequency)

var baseMean = baseline 
                                        |mean('sum')
                                                .as('mean')

var baseStddev = baseline 
                                        |stddev('sum')
                                                .as('stddev')

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/e92288fd-efd3-4550-94f4-0f77a2bf62a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to