go-graphite / carbonapi

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

Add tests for Graphite web stdev function #738

Closed carrieedwards closed 1 year ago

carrieedwards commented 1 year ago

This PR adds tests for the Graphite web stdev function, matching the tests implemented for stdev in Graphite web. Note that after implementing this test found in Graphite web's code, an issue was found with the stdev function, where a value of 0 was calculated for the standard deviation if the first value in the series was math.NaN(). This PR also includes a fix that should handle this scenario.