[influxdb] Re: time difference between first and last entry in windowed stream

2016-09-10 Thread e . poeze
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.


[influxdb] time difference between first and last entry in windowed stream

2016-09-09 Thread e . poeze
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/6ac8e824-11f6-43d5-bea6-3db8045a672b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] Re: kapacitor not working after upgrade and downgrade

2016-09-06 Thread e . poeze
Yes, you are right. Kapacitor did not receive any data from influxdb. We 
tcpdumped the udp ports influx assigned to kapacitor and they were silent.
I 'solved' the problem by restarting influx with an empty database. The old 
data is 'gone', but that is not a big issue. It would be nice to know what 
caused
this problem, but i don't know were to look for in influxdb.

-- 
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/7290dd07-de07-42ea-ac3a-0a32352c010b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] Re: kapacitor not working after upgrade and downgrade

2016-09-06 Thread e . poeze
To add on this, I have tried the same on a working version of kapacitor of 
a colleague . What seems to be missing is the aborting and closing commands 
that are show in the log file of the working kapacitor:

[edge:46e84948-2fe0-4ce9-86a7-b3f2e2b43045|stream->stream0] 2016/09/06 13:31
:20 I! aborting c: 19 e: 19
[edge:46e84948-2fe0-4ce9-86a7-b3f2e2b43045|stream->stream0] 2016/09/06 13:31
:20 D! closing c: 19 e: 19
[httpd] 2016/09/06 13:31:20 I! ::1 - - [06/Sep/2016:13:31:20 +] GET /
kapacitor/v1/recordings/46e84948-2fe0-4ce9-86a7-b3f2e2b43045 HTTP/1.1 200 
213 - KapacitorClient 3278ad6a-7436-11e6-8093- 3.213886ms

-- 
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/538f0f6d-b2e7-4330-8a1e-e5805a7e8193%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] kapacitor not working after upgrade and downgrade

2016-09-06 Thread e . poeze
I investigated a 'bug' in kapacitor and upgraded to 1.0.0-rc2. Kapacitor 
doesn't work anymore. I know this is a vague and useless remark, but I 
don't know how
to describe it otherwise. The steps I took are:

- made a reinstall of kapacitor 0.13.1 (a docker container with the content 
of /var/lib/kapacitor as an external volume)
- ran: 
curl -G 'http://localhost:8086/query?db=telegraf' --data-urlencode 'q=SELECT 
count(usage_idle) FROM cpu
and that responded correctly
- created a tick script by copying the example in the Getting started 
manual (usage_idle)
- recorded the stream using command:

kapacitor record stream -task cpu_test -duration 20s


However this record command never returns.

The /var/log/kapacitor/kapacitor.log file contains the following lines:
...
[httpd] 2016/09/06 10:24:42 I! ::1 - - [06/Sep/2016:10:24:42 +] GET /
kapacitor/v1/recordings/3848ad70-dc7e-4b24-afca-d0a0dfe374a0 HTTP/1.1 202 
209 - KapacitorClient 200e0ce5-741c-11e6-8ab0- 7.848494ms

[httpd] 2016/09/06 10:24:43 I! ::1 - - [06/Sep/2016:10:24:43 +] GET /
kapacitor/v1/recordings/3848ad70-dc7e-4b24-afca-d0a0dfe374a0 HTTP/1.1 202 
209 - KapacitorClient 205c8036-741c-11e6-8ab1- 545.448µs

...


And it never stops

The result of the show command is:
ID: cpu_test
Error: 
Type: stream
Status: enabled
Executing: true
Created: 06 Sep 16 09:18 UTC
Modified: 06 Sep 16 09:51 UTC
LastEnabled: 06 Sep 16 09:51 UTC
Databases Retention Policies: ["telegraf"."default"]
TICKscript:
stream
// Select just the cpu measurement from our example database.
|from()
.measurement('cpu')
|alert()
.crit(lambda: "usage_idle" < 70)
// Whenever we get an alert write it to a file.
.log('/tmp/alerts.log')




DOT:
digraph cpu_test {
graph [throughput="0.00 points/s"];


stream0 [avg_exec_time_ns="0" ];
stream0 -> from1 [processed="0"];


from1 [avg_exec_time_ns="0" ];
from1 -> alert2 [processed="0"];


alert2 [alerts_triggered="0" avg_exec_time_ns="0" crits_triggered="0" 
infos_triggered="0" oks_triggered="0" warns_triggered="0" ];
}




The tickscript doesn't generate alerts too.

I hope someone as an creative idea where to look for a possible solution 
for this problem.

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/13fa89dd-5d5d-48b6-924b-5b38fca01a59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.