Support more StandardAggregationFunctions

Description

Right now, newts only supports AVERAGE, MIN, and MAX. Aggregates like P95, P99, and maybe STDDEV could also be really useful to get better insights into your metrics.

I can submit a patch if this sounds reasonable.

Lucidchart Diagrams

Activity

Show:

Maciek Sakrejda March 14, 2016 at 10:21 PM

Ok, I've submitted https://github.com/OpenNMS/newts/pull/35 to implement this.

Maciek Sakrejda March 14, 2016 at 9:55 PM

The lists are already sorted by value? I'm currently calculating P95/P99 by discarding NaNs, sorting the lists by value, and picking the element at the 95th or 99th percentile in the list. This seemed like a reasonable approach. But maybe I'll just submit code; that will make it easier to work out details.

Jesse White March 11, 2016 at 6:51 PM

The collection of samples passed to the aggregation function should already be sorted, in most cases it shouldn't matter though.

Why would the samples need to be sorted for the P95 and P99 though? Shouldn't the percentiles of two lists with the same values be identical?

Maciek Sakrejda March 7, 2016 at 2:10 PM

Great, thanks. I've coded up a P95 and P99 and those seem to be working well in my own fork. Should I keep discussion regarding implementation details on the pull request, or here?

For example, calculating both p95 and p99 requires the incoming sample collection to be sorted. Right now I'm just copying it and sorting it separately in each aggregate. It'd be more effective to sort it outside and offer a guarantee to the aggregate functions that the incoming collection is already sorted, but that means a useless sort if the only aggregates you're using are MIN, MAX, and AVERAGE. I suspect that in most situations that won't matter, but if you have a lot of samples to roll up over, it could get expensive. I guess the simplest approach is to re-sort in each aggregate and not worry about it unless people report issues.

Jesse White March 7, 2016 at 1:21 PM

Sounds reasonable. You're welcome to submit a patch slightly smiling face

Project is Closed

Details

Assignee

Reporter

Components

Priority

PagerDuty

Created March 3, 2016 at 2:19 PM
Updated May 8, 2020 at 8:41 PM
Resolved May 8, 2020 at 8:41 PM

Flag notifications