Andrew Hall 1193e63896
PromQL: Modify RatioSampler to expose more methods for the benefit of downstream projects (#17516)
Methods added:
- `SampleOffset(metric *labels.Labels) float64` to calculate the sample offset for a given label set.
- `AddRatioSampleWithOffset(ratioLimit, sampleOffset float64) bool` to find out whether a given sample offset falls within a given ratio limit.

The already existing method `AddRatioSample(ratioLimit float64, sample *Sample) bool` is now implemented as a simple combination of the two other methods. Exposing these methods helps downstream projects to re-use the implementations including easier testing.

Signed-off-by: Andrew Hall <andrew.hall@grafana.com>
2025-11-18 15:44:40 +01:00
..
2025-11-05 13:47:34 +01:00
2025-11-04 05:13:49 +00:00
2025-11-04 05:13:49 +00:00