mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-18 17:25:54 -08:00
2 commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
JuanJo Ciarlante |
c94c5b64c3
|
feat: add limitk() and limit_ratio() operators (#12503)
* rebase 2024-07-01, picks previous renaming to `limitk()` and `limit_ratio()` Signed-off-by: JuanJo Ciarlante <[email protected]> * gofumpt -d -extra Signed-off-by: JuanJo Ciarlante <[email protected]> * more lint fixes Signed-off-by: JuanJo Ciarlante <[email protected]> * more lint fixes+ Signed-off-by: JuanJo Ciarlante <[email protected]> * put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions Signed-off-by: JuanJo Ciarlante <[email protected]> * EnableExperimentalFunctions for TestConcurrentRangeQueries() also Signed-off-by: JuanJo Ciarlante <[email protected]> * use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains Signed-off-by: JuanJo Ciarlante <[email protected]> * lint fix Signed-off-by: JuanJo Ciarlante <[email protected]> * moar linting Signed-off-by: JuanJo Ciarlante <[email protected]> * rebase 2024-06-19 Signed-off-by: JuanJo Ciarlante <[email protected]> * re-add limit(2, metric) testing for N=2 common series subset Signed-off-by: JuanJo Ciarlante <[email protected]> * move `ratio = param` to default switch case, for better readability Signed-off-by: JuanJo Ciarlante <[email protected]> * gofumpt -d -extra util/testutil/cmp.go Signed-off-by: JuanJo Ciarlante <[email protected]> * early break when reaching k elems in limitk(), should have always been so (!) Signed-off-by: JuanJo Ciarlante <[email protected]> * small typo fix Signed-off-by: JuanJo Ciarlante <[email protected]> * no-change small break-loop rearrange for readability Signed-off-by: JuanJo Ciarlante <[email protected]> * remove IsNan(ratio) condition in switch-case, already handled as input validation Signed-off-by: JuanJo Ciarlante <[email protected]> * no-change adding some comments Signed-off-by: JuanJo Ciarlante <[email protected]> * no-change simplify fullMatrix() helper functions used for tests Signed-off-by: JuanJo Ciarlante <[email protected]> * add `limitk(-1, metric)` testcase, which is handled as any k < 1 case Signed-off-by: JuanJo Ciarlante <[email protected]> * engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability Signed-off-by: JuanJo Ciarlante <[email protected]> * rebase 2024-06-21 Signed-off-by: JuanJo Ciarlante <[email protected]> * engine_test.go: HAPPY NOW about its code -> reorg, create and use simpleRangeQuery() function, less lines and more readable ftW \o/ Signed-off-by: JuanJo Ciarlante <[email protected]> * move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test Signed-off-by: JuanJo Ciarlante <[email protected]> * remove stale leftover after moving tests from engine_test.go to testdata/ Signed-off-by: JuanJo Ciarlante <[email protected]> * fix flaky `limit_ratio(0.5, ...)` test case Signed-off-by: JuanJo Ciarlante <[email protected]> * Update promql/engine.go Co-authored-by: Julius Volz <[email protected]> Signed-off-by: JuanJo Ciarlante <[email protected]> * Update promql/engine.go Co-authored-by: Julius Volz <[email protected]> Signed-off-by: JuanJo Ciarlante <[email protected]> * Update promql/engine.go Co-authored-by: Julius Volz <[email protected]> Signed-off-by: JuanJo Ciarlante <[email protected]> * fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return) Signed-off-by: JuanJo Ciarlante <[email protected]> * docs/querying/operators.md: document r < 0 Signed-off-by: JuanJo Ciarlante <[email protected]> * add negative limit_ratio() example to docs/querying/examples.md Signed-off-by: JuanJo Ciarlante <[email protected]> * move more extensive docu examples to docs/querying/operators.md Signed-off-by: JuanJo Ciarlante <[email protected]> * typo Signed-off-by: JuanJo Ciarlante <[email protected]> * small docu fix for poor-mans-normality-check, add it to limit.test ;) Signed-off-by: JuanJo Ciarlante <[email protected]> * limit.test: expand "Poor man's normality check" to whole eval range Signed-off-by: JuanJo Ciarlante <[email protected]> * restore mistakenly removed existing small comment Signed-off-by: JuanJo Ciarlante <[email protected]> * expand poors-man-normality-check case(s) Signed-off-by: JuanJo Ciarlante <[email protected]> * Revert "expand poors-man-normality-check case(s)" This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too flaky 0:) Signed-off-by: JuanJo Ciarlante <[email protected]> * remove humor from docs/querying/operators.md Signed-off-by: JuanJo Ciarlante <[email protected]> * fix signoff Signed-off-by: JuanJo Ciarlante <[email protected]> * add web/ui missing changes Signed-off-by: JuanJo Ciarlante <[email protected]> * expand limit_ratio test cases, cross-fingering they'll not be flaky Signed-off-by: JuanJo Ciarlante <[email protected]> * remove flaky test Signed-off-by: JuanJo Ciarlante <[email protected]> * add missing warnings.Merge(ws) in instant-query return shortcut Signed-off-by: JuanJo Ciarlante <[email protected]> * add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts Signed-off-by: JuanJo Ciarlante <[email protected]> * fix ui-lint Signed-off-by: JuanJo Ciarlante <[email protected]> * actually fix returned warnings :] Signed-off-by: JuanJo Ciarlante <[email protected]> --------- Signed-off-by: JuanJo Ciarlante <[email protected]> Co-authored-by: Julius Volz <[email protected]> |
||
Augustin Husson |
043a2954f8
|
UI: stabilize dependencies and environment (#10517)
* create lezer-promql module + move codemirror to a pure esm module + unified dependencies Signed-off-by: Augustin Husson <[email protected]> * ignore test utils file and remove the type "module" in package.json Signed-off-by: Augustin Husson <[email protected]> * use jest to run the lezer-promql test Signed-off-by: Augustin Husson <[email protected]> * give an automatic way to update the ui dependencies Signed-off-by: Augustin Husson <[email protected]> * update all dependencies using make update-npm-deps Signed-off-by: Augustin Husson <[email protected]> * fix react-app test Signed-off-by: Augustin Husson <[email protected]> * remove generated file Signed-off-by: Augustin Husson <[email protected]> * remove unnecessary backslash in script Signed-off-by: Augustin Husson <[email protected]> * fix reviews Signed-off-by: Augustin Husson <[email protected]> * rewording Signed-off-by: Augustin Husson <[email protected]> * use npx to run lezer-generator Signed-off-by: Augustin Husson <[email protected]> |