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

try to avoid passing around infinite values #14

Merged
merged 1 commit into from
Oct 16, 2019
Merged

Conversation

speezepearson
Copy link
Contributor

@speezepearson speezepearson commented Oct 12, 2019

  • reject data points that contain NaN/infinite values
  • if empty histograms are somehow encountered in the MeanAggregator, skip that data point entirely instead of creating a NaN value that will blow up down the road

Before:

$ curl http://localhost:8082/api/v1/datapoints -XPOST --data-binary '[{"name":"foo", "type":"histogram", "tags":{"a":"a"}, "datapoints":[[1500000000000, {"min":0, "max":1, "sum": 1, "mean": "Infinity", "bins":{"0":"1","1":"1"}}]]}]'; echo

$ curl http://localhost:8082/api/v1/datapoints/query -XPOST --data-binary '{"start_absolute":1500000000000, "end_absolute":1500000000000, "metrics":[{"name":"foo", "aggregators":[]}]}'; echo
{"errors":["org.json.JSONException: JSON does not allow non-finite numbers."]}

After:

$ curl http://localhost:8082/api/v1/datapoints -XPOST --data-binary '[{"name":"foo", "type":"histogram", "tags":{"a":"a"}, "datapoints":[[1500000000000, {"min":0, "max":1, "sum": 1, "mean": "Infinity", "bins":{"0":"1","1":"1"}}]]}]'; echo
{"errors":["mean has non-finite value Infinity"]}

@speezepearson speezepearson merged commit 8d0c4bd into master Oct 16, 2019
@speezepearson speezepearson deleted the finitude branch October 16, 2019 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants