Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time between events #1856

Closed
Sineos opened this issue Mar 5, 2015 · 3 comments
Closed

Time between events #1856

Sineos opened this issue Mar 5, 2015 · 3 comments

Comments

@Sineos
Copy link

Sineos commented Mar 5, 2015

Especially with counter or boolean values it would be a benefit to be able to query the time between events.
Normally one would do something like:

SELECT sum(value) GROUP BY time(1h)

for example to see how dynamic certain events are. This will work well if a certain amount of events are recorded in the chosen time interval and if the events are relatively equally distributed over time.

In case only a small amount of events is given per time interval and even have nil in the chosen interval a calculation of the passed time between the intervals would be a lot more precise.

This would be especially useful in combination with the derivative function as it would allow to calculate the volatility of events like cache hits, attacks etc. In event everything that can be counted.

I would think about a query e.g.

SELECT time_between_events(ms) WHERE value > 1

to return a table of time in milliseconds that passed between each event that matches the WHERE clause.

@beckettsean beckettsean added this to the Next Point Release milestone Apr 20, 2015
@beckettsean beckettsean modified the milestones: Next Point Release, Longer term Aug 6, 2015
@rgarver
Copy link

rgarver commented Sep 16, 2015

👍, I can see two scenarios where this is valuable:

  1. Engagement measures that evaluate changes in frequency of events. This could be done with a bucketing approach (eg: number of events in fixed window) so probably not as strong of a reason to build it.
  2. Time to first event (or 2nd, or b/t events of particular lables, or something). An example would be something like Zendesk where you have the initial message and then a series of messages later. Getting an average time to first reply or max/min time to resolution would need something like this.

@beckettsean
Copy link
Contributor

As mentioned in my post to the mailing list we are experimenting with simplifying our open GitHub Issues. This feature request has been rolled into an aggregate issue for all function requests, so that we can close this issue until we are ready to work on it.

You may continue to make comments here. Closing the issue does not mean we are rejecting this idea.

@nathanielc
Copy link
Contributor

I am starting work on this issue as it has some more immediate value for Kapacitor.

I like the name elapsed it will work much like derivative but take the difference of times and not values.

SELECT elapsed('value', 1ms) WHERE value > 1

Return elapsed time between points with the value field, returned in units of 1 millisecond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants