Thanks!

This is exactly what I was looking for.

We monitor mobile devices and they are switching between online and 
offline, so the 'window' fills when they are switched on and empties when 
they go offline.
Using first/last and usePointTimes() should do the job exactly.

I love this stack, really!


On Friday, 9 September 2016 15:24:55 UTC+2, e.p...@viriciti.com wrote:
>
> I'm trying to get the time difference between the first and the last item 
> within a window of 10 minutes using kapacitor. E.g.
>
> var vids = stream
>         |from()
>                 .measurement('control')
>                 .groupBy('vid')
>
>
>         |window()
>                 .period(10m)
>                 .every(1m)
>
>
> var mins = vids
>         |min('ping')
>                 .as('minping')
>
>
> var first = vids
>         |first('ping')
>
>
> var last = vids
>         |last('ping')
>
>
> It seems that first and last indeed contain the value of 'ping' of the 
> first resp. last time point in the window. 
>
> My question is: is it possible to get the time difference between these 
> two points. 
>
> (too) simply said:  last.time - first.time
>
> thanks
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
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/152d99c0-3732-4ddc-9ede-c87e704b2d12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to