VictoriaMetrics/app/vmselect/promql
Roman Khavronenko 6061464d80
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:57:02 +03:00
..
active_queries.go app/vmselect: show X-Forwarded-For contents on /api/v1/status/active_queries page 2020-07-31 20:01:09 +03:00
aggr.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:57:02 +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:41:04 +03:00
aggr_incremental_test.go all: use %w instead of %s for wrapping errors in fmt.Errorf 2020-06-30 23:33:46 +03:00
aggr_test.go app/vmselect/promql: add mode() aggregate function 2020-07-20 15:30:11 +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:56:35 +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:04 +03:00
exec.go app/vmselect/promql: follow-up after 57b3320478 2021-09-24 01:25:04 +03:00
exec_test.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:57:02 +03:00
memory_limiter.go app/vmselect/promql: use dynamic limit on memory for concurrent queries 2019-06-12 23:18:23 +03:00
memory_limiter_test.go app/vmselect/promql: use dynamic limit on memory for concurrent queries 2019-06-12 23:18:23 +03:00
parser.go app/vmselect/promql: duration handling improvements in MetricsQL queries 2021-07-12 17:19:32 +03:00
parser_test.go app/vmselect/promql: properly parse escaped multibyte utf8 code sequences in metric names and labels names 2021-01-13 10:59:32 +02:00
rollup.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:57:02 +03:00
rollup_result_cache.go app/vmselect/promql: allow to use 2x more memory for query processing in cluster mode compared to single-node mode 2021-05-12 14:43:49 +03:00
rollup_result_cache_test.go lib/metricsql: move it to a separate repository - github.com/VictoriaMetrics/metrics 2020-04-28 15:30:06 +03:00
rollup_test.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:57:02 +03:00
rollup_timing_test.go all: open-sourcing single-node version 2019-05-23 00:18:06 +03:00
timeseries.go app/vmselect/promql: follow-up after 57b3320478 2021-09-24 01:25:04 +03:00
timeseries_test.go app/vmselect/promql: store compressed results in the cache 2019-08-14 02:32:16 +03:00
transform.go app/vmselect: quantile func compatiblity with Prometheus (#1646) 2021-09-27 18:57:02 +03:00
tzdata.go all: add go:build lines for Go1.17 2021-07-26 15:50:46 +03:00