How to filter series when there are not enough data points?

I have the following metric averageSeries(gauges.someName.*.milliseconds). The averageSeries function is applied over many series that have very few data points. I would like to filter series that has less than X data points. Something like the following will be perfect averageSeries(removeBelowDataPointsCount(gauges.someName.*.milliseconds, 10), but the problem is that removeBelowDataPointsCount isn’t a real function :grinning:
How can I get to the same result?


That’s an interesting question, and one that isn’t easy to solve right now. I recently added support for an xFilesFactor to the various functions that aggregate across series and across time, but haven’t thought about using it to filter out series from a list based on their number of null values. The closest function that exists today would be removeEmptySeries, which will filter out series whose values are all null, maybe it could be extended to support a threshold parameter that specified the proportion of non-null values required to exclude the series.

This will be in the next graphite-web release:

1 Like

Cool thanks!! This was the best answer I could hope for :smiley: