Open robinp opened 1 year ago
For reference, https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/req/ReqSketchSortedView.java seems to be the Java counterpart. Nothing very odd sticks out directly.
Very likely first step needs to be adding a property-based test exercising the insert + getQuantile functionality.
Hello - I use
prometheus-client
, which usesdata-sketches
for its Summary metric.I periodically run into
invariant violated: lastWeight does not equal raSize
. Actually running a patcheddata-sketches
to get more details, and the output samples are:invariant violated: lastWeight does not equal raSize: 3068, 3088 (size: 269)
invariant violated: lastWeight does not equal raSize: 3706, 3705 (size: 301)
invariant violated: lastWeight does not equal raSize: 2390, 2418 (size: 268)
Original code: https://github.com/iand675/datasketches-haskell/blob/f327321a33f6084e61dc2e4a1dec3211683bc747/data-sketches-core/src/DataSketches/Quantiles/RelativeErrorQuantile/Internal/Auxiliary.hs#L106
Modified:
This is how
prometheus-client
uses the sketch: https://github.com/fimad/prometheus-haskell/blob/631f8f44ee710673f7ba88d2cda346f3592b0f7b/prometheus-client/src/Prometheus/Metric/Summary.hs#L71 (and seeobserve
on update,collectSummary
on getting the quantiles). Though I have a slightly patched prom as well, I don't think I modified this logic.The quantiles used are typically the defaultQuantiles at https://github.com/fimad/prometheus-haskell/blob/631f8f44ee710673f7ba88d2cda346f3592b0f7b/prometheus-client/src/Prometheus/Metric/Summary.hs#L112 (though I added
(1.0, 0)
to the mix, I think I remember this occuring even before).Do you have any insight on how to based on this? Happens relatively rarely, ~1x per day. How to best test this I wonder, or what state could I dump if it helped? Thank you.