You are right that elapsed can't do what you want directly. In the meantime 
the simplest solution would be to use  a UDF, a simple python script could 
easily do what you want. You have me thinking though so if I can think of a 
non UDF solution I'll let you know.

On Saturday, June 11, 2016 at 11:42:31 AM UTC-6, howie wrote:
>
> Hello all-
>
> I am trying to see if it is possible to use kapacitor to track the 
> duration of incidents for uptime monitoring data. I believe this is a 
> common use case so I am hoping someone has some thoughts on how to solve 
> this.
>
> I am feeding results of tests that run every 2 minutes into influx:
>
> simplifed example:
>
> timestamp        resource        status
> 1465577250        id9999        up
> 1465577370        id9999        down
> 1465577490        id9999        down
> 1465577610        id9999        down
> 1465577730        id9999        down
> 1465577850        id9999        up
> 1465577970        id9999        up
> 1465578090        id9999        down
> 1465578210        id9999        down
>
>
> I am able to use grafana to display the current counts of "down" resources 
> over the last 2 minutes. This is working great for a realtime dashboard.
>
> The issue I am running into is that we need to be able to display how long 
> a resource has been down as well as report on the duration of these "down 
> incidents" daily/weekly/monthly.
>
> The source of the data does not track the start/stop of an issue, it 
> simply reports the state of the resources every 2 minutes. My challenge is 
> how to mine this data in influx to create incidents that will contain the 
> duration of an event.
>
> I thought that the elapsed() function would help me out here but since my 
> data does not just contain start and stop times it does not appear to be 
> the solution (directly, anyway).
>
> My thinking is to use kapacitor to create a new down_incidents measure 
> that I could report on...an open incident would contain the elapsed time so 
> far (minutes) and closed one would contain the entire duration. Using above 
> data:
>
> timestamp        resource        incident_status        duration
> 1465577370        id9999        closed        6
> 1465578090        id9999        open        2
>
>
> I am trying to get up to speed on kapacitor but am having a hard time 
> figuring out the best way to approach this. Has anyone done anything 
> similar that would be willing to point me in the right direction?
>
> thanks,
> Howie
>
>

-- 
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 [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/7d764acc-239d-43ca-9330-508077af88ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to