In Graphite, how can count the number of data points above a value?

3.7k views Asked by At

I was wondering if there was a Graphite function or a way of getting the number of points above a certain value. Let's say I have 2,44,24,522,52,534 for the same time and I want to get the number of points over 40, in this case it would be 3. Any tips?

Thanks

1

There are 1 answers

1
kamaradclimber On

You can use removeBelowValue(your.metric, 40) to only display points above 40.

Then use something to make non zero value equal to 1 (I am thinking of pow(_, 0) but I am not sure of how it behaves with None values given by removeBelowValue). If you use recent (>0.9.x) version of graphite, you can use isNonNull instead of pow

In the end you can use any function to summarize your the 1s you have, summarize you should be good. You only have to select your range.

Suggestion : summarize(pow(removeBelowValue(your.metric,40),0), '1hour', 'sumSeries')