VictoriaMetrics/app/vmselect/promql
Roman Khavronenko 526dd93b32
app/vmselect: quantile func compatiblity with Prometheus (#1646)
* app/vmselect: `quantile` func compatiblity with Prometheus

The `quantile` func was previously calculated by https://github.com/valyala/histogram
package. The result of such calculation was always the closest real value to
requested quantile. While in Prometheus implementation interpolation is used.
Such difference may result into discrepancy in output between Prometheus and
VictoriaMetrics.

This commit adds a Prometheus-like `quantile` function. It also used by other
functions which depend on it, such as `quantiles`, `quantile_over_time`, `median` etc.

https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1625

Signed-off-by: hagen1778 <roman@victoriametrics.com>

* app/vmselect: `quantile` review fixes

* quantile functions were split into multiple to provide
different API for already sorted data;
* float64sPool is used for reducing allocations. Items in pool may have
different sizes, but defining a new pool was complicates due to name collisions;

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2021-09-27 18:02:41 +03:00
..
active_queries.go app/vmselect: show X-Forwarded-For contents on /api/v1/status/active_queries page 2020-07-31 20:05:18 +03:00
aggr_incremental_test.go all: use %w instead of %s for wrapping errors in fmt.Errorf 2020-06-30 23:05:11 +03:00
aggr_incremental.go app/vmselect/promql: return empty values from group() if all the time series have no values at the given timestamp 2020-07-28 13:40:11 +03:00
aggr_test.go app/vmselect/promql: add mode() aggregate function 2020-07-20 15:31:20 +03:00
aggr.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:02:41 +03:00
binary_op.go app/vmselect/promql: align the behavior of or, and and unless operators with on (labels) modifier to Prometheus 2021-09-24 00:46:25 +03:00
eval.go app/vmselect/promql: add quantiles_over_time("phiLabel", phi1, ..., phiN, m[d]) function for calculating multiple quantiles at once 2021-09-17 23:35:10 +03:00
exec_test.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:02:41 +03:00
exec.go app/vmselect/promql: follow-up after 57b3320478 2021-09-24 01:24:18 +03:00
memory_limiter_test.go
memory_limiter.go
parser_test.go app/vmselect/promql: properly parse escaped multibyte utf8 code sequences in metric names and labels names 2021-01-13 10:59:42 +02:00
parser.go app/vmselect/promql: duration handling improvements in MetricsQL queries 2021-07-12 17:16:41 +03:00
rollup_result_cache_test.go lib/metricsql: move it to a separate repository - github.com/VictoriaMetrics/metrics 2020-04-28 15:28:22 +03:00
rollup_result_cache.go app/vmselect: add -search.disableAutoCacheReset command-line option for disabling automatic cache reset when a sample with old timestamp outside -search.cacheTimestampOffset is inserted 2021-08-27 17:15:31 +03:00
rollup_test.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:02:41 +03:00
rollup_timing_test.go
rollup.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:02:41 +03:00
timeseries_test.go
timeseries.go app/vmselect/promql: follow-up after 57b3320478 2021-09-24 01:24:18 +03:00
transform.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:02:41 +03:00
tzdata.go all: add go:build lines for Go1.17 2021-07-26 15:48:21 +03:00