Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixes
StreamingHistogram.itemCount
. Has the effect of changing the behavior ofStreamingHistogram.binCount
so that bin counts are not always zero.Checklist
docs/CHANGELOG.rst
updated, if necessarydocs
guides update, if necessaryDemo
Previously,
binCount
on a streaming histogram would return answers with counts of zero.This was due to the fact that the values of the bins were being generated by the functionThis was due tovalues
which produced numbers that did not match the internals bins of the streaming histogram.itemCount
being incorrect.New behavior:
Notes
As stated above, the previous behavior was to use bin labels generated byvalues
which did not (do not) line up with the internal bins used by the streaming histogram. When a count for a non-bucket-label value is requested, zero is returned (because [by construction and intent] the streaming histogram does not have access to that information).The new behavior is to simply return the internal buckets used by the streaming histogram. Note that the interpretations of these bin counts is therefore somewhat different than for other histogram types.Note that the median value of 34.18 above is "correct" (expected) for an approximation using three buckets. Because all of the input data are not available, the median has to be approximated. If the approximate histogram is viewed as a curve, the median is approximated by returning the value at which half of the the area under the curve is to the left and half to the right.
Closes #2274