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

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

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

Comments

@carrieedwards
Copy link
Collaborator

Describe the bug
If the interval parameter passed into the hitcount() function is smaller than the step of the data, the results are incorrect. The results will be shifted left, and buckets to the right will be empty.

For example:

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

The result will be []float64{1200, 2400, 3600, 0, 0, 0}. The hit values are all concentrated on the left half of the buckets.

When the same test is run in Graphite web, the results are [720, 960, 1440, 1920, 2160], with the hit values spread throughout all of the buckets.

@carrieedwards carrieedwards added the bug Something isn't working label Apr 12, 2023
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
Development

Successfully merging a pull request may close this issue.

1 participant