go-graphite / carbonapi

Implementation of graphite API (graphite-web) in golang
Other
308 stars 140 forks source link

sortBy: substitute NaN values for negative infinity #832

Closed mchrome closed 2 months ago

mchrome commented 2 months ago

Using sortByMaxima with a series that only has NaN values causes it to end up at the top of the series list which is different from graphite-web. In graphite-web when you use a sortBy function all aggregated values that are equal to NaN are set to -Inf. Link to code. This PR adds the same behavior.