Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smartSummarize() produces incorrect results when the interval parameter is smaller than the fetched data's step #138

Closed
carrieedwards opened this issue Apr 24, 2023 · 0 comments · Fixed by #137
Labels
bug Something isn't working

Comments

@carrieedwards
Copy link
Collaborator

Describe the bug
If the interval parameter passed into the smartSummarize() function is smaller than the step of the data, the results are incorrect.

For example:

smartSummarize(metric1,'6m','sum', 'minutes')
[]*types.MetricData{{"metric1", 0, 1}: {types.MakeMetricData("metric1", []float64{2, 4, 6}, 600, 100)},} // 10m step

The result will be []float64{2, 4, 6}.

When the same test is run in Graphite web, the results are [2, 4, None, 6, None]. This is due to the interval being smaller than the step, and therefore some resulting values will be NaN.

Additionally, smartSummarize does not support all of the possible alignTo values. Currently, only minutes, hours and days are supported, while Graphite web supports seconds, minutes, hours, days, weeks, months and years.

See the Graphite web docs for more information on the expectation of this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant