2024-02-15 19:25:12 +00:00
|
|
|
// Code generated by goyacc -l -o promql/parser/generated_parser.y.go promql/parser/generated_parser.y. DO NOT EDIT.
|
2020-02-03 16:23:44 +00:00
|
|
|
package parser
|
2019-12-05 16:16:12 +00:00
|
|
|
|
2021-01-20 10:57:39 +00:00
|
|
|
import __yyfmt__ "fmt"
|
|
|
|
|
2019-12-05 16:16:12 +00:00
|
|
|
import (
|
2019-12-21 08:44:12 +00:00
|
|
|
"math"
|
|
|
|
"strconv"
|
2020-01-08 11:04:47 +00:00
|
|
|
"time"
|
2019-12-16 16:38:18 +00:00
|
|
|
|
2023-08-25 21:35:42 +00:00
|
|
|
"github.com/prometheus/prometheus/model/histogram"
|
2021-11-08 14:23:17 +00:00
|
|
|
"github.com/prometheus/prometheus/model/labels"
|
|
|
|
"github.com/prometheus/prometheus/model/value"
|
2023-09-14 16:57:31 +00:00
|
|
|
"github.com/prometheus/prometheus/promql/parser/posrange"
|
2024-08-01 14:07:08 +00:00
|
|
|
|
|
|
|
"github.com/prometheus/common/model"
|
2021-01-20 10:57:39 +00:00
|
|
|
)
|
2019-12-05 16:16:12 +00:00
|
|
|
|
|
|
|
type yySymType struct {
|
2023-08-25 21:35:42 +00:00
|
|
|
yys int
|
|
|
|
node Node
|
|
|
|
item Item
|
|
|
|
matchers []*labels.Matcher
|
|
|
|
matcher *labels.Matcher
|
|
|
|
label labels.Label
|
|
|
|
labels labels.Labels
|
|
|
|
lblList []labels.Label
|
|
|
|
strings []string
|
|
|
|
series []SequenceValue
|
|
|
|
histogram *histogram.FloatHistogram
|
|
|
|
descriptors map[string]interface{}
|
|
|
|
bucket_set []float64
|
|
|
|
int int64
|
|
|
|
uint uint64
|
|
|
|
float float64
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
2023-08-25 21:35:42 +00:00
|
|
|
const EQL = 57346
|
|
|
|
const BLANK = 57347
|
|
|
|
const COLON = 57348
|
|
|
|
const COMMA = 57349
|
|
|
|
const COMMENT = 57350
|
|
|
|
const DURATION = 57351
|
|
|
|
const EOF = 57352
|
|
|
|
const ERROR = 57353
|
|
|
|
const IDENTIFIER = 57354
|
|
|
|
const LEFT_BRACE = 57355
|
|
|
|
const LEFT_BRACKET = 57356
|
|
|
|
const LEFT_PAREN = 57357
|
|
|
|
const OPEN_HIST = 57358
|
|
|
|
const CLOSE_HIST = 57359
|
|
|
|
const METRIC_IDENTIFIER = 57360
|
|
|
|
const NUMBER = 57361
|
|
|
|
const RIGHT_BRACE = 57362
|
|
|
|
const RIGHT_BRACKET = 57363
|
|
|
|
const RIGHT_PAREN = 57364
|
|
|
|
const SEMICOLON = 57365
|
|
|
|
const SPACE = 57366
|
|
|
|
const STRING = 57367
|
|
|
|
const TIMES = 57368
|
|
|
|
const histogramDescStart = 57369
|
|
|
|
const SUM_DESC = 57370
|
|
|
|
const COUNT_DESC = 57371
|
|
|
|
const SCHEMA_DESC = 57372
|
|
|
|
const OFFSET_DESC = 57373
|
|
|
|
const NEGATIVE_OFFSET_DESC = 57374
|
|
|
|
const BUCKETS_DESC = 57375
|
|
|
|
const NEGATIVE_BUCKETS_DESC = 57376
|
|
|
|
const ZERO_BUCKET_DESC = 57377
|
|
|
|
const ZERO_BUCKET_WIDTH_DESC = 57378
|
2024-05-08 11:58:24 +00:00
|
|
|
const CUSTOM_VALUES_DESC = 57379
|
2024-07-31 07:53:05 +00:00
|
|
|
const COUNTER_RESET_HINT_DESC = 57380
|
|
|
|
const histogramDescEnd = 57381
|
|
|
|
const operatorsStart = 57382
|
|
|
|
const ADD = 57383
|
|
|
|
const DIV = 57384
|
|
|
|
const EQLC = 57385
|
|
|
|
const EQL_REGEX = 57386
|
|
|
|
const GTE = 57387
|
|
|
|
const GTR = 57388
|
|
|
|
const LAND = 57389
|
|
|
|
const LOR = 57390
|
|
|
|
const LSS = 57391
|
|
|
|
const LTE = 57392
|
|
|
|
const LUNLESS = 57393
|
|
|
|
const MOD = 57394
|
|
|
|
const MUL = 57395
|
|
|
|
const NEQ = 57396
|
|
|
|
const NEQ_REGEX = 57397
|
|
|
|
const POW = 57398
|
|
|
|
const SUB = 57399
|
|
|
|
const AT = 57400
|
|
|
|
const ATAN2 = 57401
|
|
|
|
const operatorsEnd = 57402
|
|
|
|
const aggregatorsStart = 57403
|
|
|
|
const AVG = 57404
|
|
|
|
const BOTTOMK = 57405
|
|
|
|
const COUNT = 57406
|
|
|
|
const COUNT_VALUES = 57407
|
|
|
|
const GROUP = 57408
|
|
|
|
const MAX = 57409
|
|
|
|
const MIN = 57410
|
|
|
|
const QUANTILE = 57411
|
|
|
|
const STDDEV = 57412
|
|
|
|
const STDVAR = 57413
|
|
|
|
const SUM = 57414
|
|
|
|
const TOPK = 57415
|
|
|
|
const LIMITK = 57416
|
|
|
|
const LIMIT_RATIO = 57417
|
|
|
|
const aggregatorsEnd = 57418
|
|
|
|
const keywordsStart = 57419
|
|
|
|
const BOOL = 57420
|
|
|
|
const BY = 57421
|
|
|
|
const GROUP_LEFT = 57422
|
|
|
|
const GROUP_RIGHT = 57423
|
|
|
|
const IGNORING = 57424
|
|
|
|
const OFFSET = 57425
|
|
|
|
const ON = 57426
|
|
|
|
const WITHOUT = 57427
|
|
|
|
const keywordsEnd = 57428
|
|
|
|
const preprocessorStart = 57429
|
|
|
|
const START = 57430
|
|
|
|
const END = 57431
|
|
|
|
const preprocessorEnd = 57432
|
|
|
|
const counterResetHintsStart = 57433
|
|
|
|
const UNKNOWN_COUNTER_RESET = 57434
|
|
|
|
const COUNTER_RESET = 57435
|
|
|
|
const NOT_COUNTER_RESET = 57436
|
|
|
|
const GAUGE_TYPE = 57437
|
|
|
|
const counterResetHintsEnd = 57438
|
|
|
|
const startSymbolsStart = 57439
|
|
|
|
const START_METRIC = 57440
|
|
|
|
const START_SERIES_DESCRIPTION = 57441
|
|
|
|
const START_EXPRESSION = 57442
|
|
|
|
const START_METRIC_SELECTOR = 57443
|
|
|
|
const startSymbolsEnd = 57444
|
2019-12-05 16:16:12 +00:00
|
|
|
|
|
|
|
var yyToknames = [...]string{
|
|
|
|
"$end",
|
|
|
|
"error",
|
|
|
|
"$unk",
|
2020-09-09 10:10:02 +00:00
|
|
|
"EQL",
|
2020-01-08 11:04:47 +00:00
|
|
|
"BLANK",
|
|
|
|
"COLON",
|
|
|
|
"COMMA",
|
2019-12-05 16:16:12 +00:00
|
|
|
"COMMENT",
|
2020-01-08 11:04:47 +00:00
|
|
|
"DURATION",
|
|
|
|
"EOF",
|
|
|
|
"ERROR",
|
2019-12-05 16:16:12 +00:00
|
|
|
"IDENTIFIER",
|
|
|
|
"LEFT_BRACE",
|
|
|
|
"LEFT_BRACKET",
|
2020-01-08 11:04:47 +00:00
|
|
|
"LEFT_PAREN",
|
2023-08-25 21:35:42 +00:00
|
|
|
"OPEN_HIST",
|
|
|
|
"CLOSE_HIST",
|
2020-01-08 11:04:47 +00:00
|
|
|
"METRIC_IDENTIFIER",
|
|
|
|
"NUMBER",
|
|
|
|
"RIGHT_BRACE",
|
2019-12-05 16:16:12 +00:00
|
|
|
"RIGHT_BRACKET",
|
2020-01-08 11:04:47 +00:00
|
|
|
"RIGHT_PAREN",
|
2019-12-05 16:16:12 +00:00
|
|
|
"SEMICOLON",
|
2020-01-08 11:04:47 +00:00
|
|
|
"SPACE",
|
2019-12-05 16:16:12 +00:00
|
|
|
"STRING",
|
|
|
|
"TIMES",
|
2023-08-25 21:35:42 +00:00
|
|
|
"histogramDescStart",
|
|
|
|
"SUM_DESC",
|
|
|
|
"COUNT_DESC",
|
|
|
|
"SCHEMA_DESC",
|
|
|
|
"OFFSET_DESC",
|
|
|
|
"NEGATIVE_OFFSET_DESC",
|
|
|
|
"BUCKETS_DESC",
|
|
|
|
"NEGATIVE_BUCKETS_DESC",
|
|
|
|
"ZERO_BUCKET_DESC",
|
|
|
|
"ZERO_BUCKET_WIDTH_DESC",
|
2024-05-08 11:58:24 +00:00
|
|
|
"CUSTOM_VALUES_DESC",
|
2024-07-31 07:53:05 +00:00
|
|
|
"COUNTER_RESET_HINT_DESC",
|
2023-08-25 21:35:42 +00:00
|
|
|
"histogramDescEnd",
|
2019-12-05 16:16:12 +00:00
|
|
|
"operatorsStart",
|
|
|
|
"ADD",
|
|
|
|
"DIV",
|
2020-09-09 10:10:02 +00:00
|
|
|
"EQLC",
|
2020-01-08 11:04:47 +00:00
|
|
|
"EQL_REGEX",
|
|
|
|
"GTE",
|
|
|
|
"GTR",
|
2019-12-05 16:16:12 +00:00
|
|
|
"LAND",
|
|
|
|
"LOR",
|
2020-01-08 11:04:47 +00:00
|
|
|
"LSS",
|
|
|
|
"LTE",
|
2019-12-05 16:16:12 +00:00
|
|
|
"LUNLESS",
|
2020-01-08 11:04:47 +00:00
|
|
|
"MOD",
|
|
|
|
"MUL",
|
2019-12-05 16:16:12 +00:00
|
|
|
"NEQ",
|
|
|
|
"NEQ_REGEX",
|
|
|
|
"POW",
|
2020-01-08 11:04:47 +00:00
|
|
|
"SUB",
|
2021-01-20 10:57:39 +00:00
|
|
|
"AT",
|
2021-08-24 23:22:14 +00:00
|
|
|
"ATAN2",
|
2019-12-05 16:16:12 +00:00
|
|
|
"operatorsEnd",
|
|
|
|
"aggregatorsStart",
|
|
|
|
"AVG",
|
2020-01-08 11:04:47 +00:00
|
|
|
"BOTTOMK",
|
2019-12-05 16:16:12 +00:00
|
|
|
"COUNT",
|
2020-01-08 11:04:47 +00:00
|
|
|
"COUNT_VALUES",
|
2020-06-30 14:51:18 +00:00
|
|
|
"GROUP",
|
2019-12-05 16:16:12 +00:00
|
|
|
"MAX",
|
2020-01-08 11:04:47 +00:00
|
|
|
"MIN",
|
|
|
|
"QUANTILE",
|
2019-12-05 16:16:12 +00:00
|
|
|
"STDDEV",
|
|
|
|
"STDVAR",
|
2020-01-08 11:04:47 +00:00
|
|
|
"SUM",
|
2019-12-05 16:16:12 +00:00
|
|
|
"TOPK",
|
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 <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* 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 <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-03 20:18:57 +00:00
|
|
|
"LIMITK",
|
|
|
|
"LIMIT_RATIO",
|
2019-12-05 16:16:12 +00:00
|
|
|
"aggregatorsEnd",
|
|
|
|
"keywordsStart",
|
2020-01-08 11:04:47 +00:00
|
|
|
"BOOL",
|
2019-12-05 16:16:12 +00:00
|
|
|
"BY",
|
|
|
|
"GROUP_LEFT",
|
|
|
|
"GROUP_RIGHT",
|
2020-01-08 11:04:47 +00:00
|
|
|
"IGNORING",
|
|
|
|
"OFFSET",
|
|
|
|
"ON",
|
|
|
|
"WITHOUT",
|
2019-12-05 16:16:12 +00:00
|
|
|
"keywordsEnd",
|
2021-02-09 16:03:16 +00:00
|
|
|
"preprocessorStart",
|
|
|
|
"START",
|
|
|
|
"END",
|
|
|
|
"preprocessorEnd",
|
2024-07-31 07:53:05 +00:00
|
|
|
"counterResetHintsStart",
|
|
|
|
"UNKNOWN_COUNTER_RESET",
|
|
|
|
"COUNTER_RESET",
|
|
|
|
"NOT_COUNTER_RESET",
|
|
|
|
"GAUGE_TYPE",
|
|
|
|
"counterResetHintsEnd",
|
2019-12-05 16:16:12 +00:00
|
|
|
"startSymbolsStart",
|
2019-12-16 16:38:18 +00:00
|
|
|
"START_METRIC",
|
2019-12-21 08:44:12 +00:00
|
|
|
"START_SERIES_DESCRIPTION",
|
2020-01-08 11:04:47 +00:00
|
|
|
"START_EXPRESSION",
|
|
|
|
"START_METRIC_SELECTOR",
|
2019-12-05 16:16:12 +00:00
|
|
|
"startSymbolsEnd",
|
|
|
|
}
|
2021-02-17 01:49:00 +00:00
|
|
|
|
2019-12-05 16:16:12 +00:00
|
|
|
var yyStatenames = [...]string{}
|
|
|
|
|
2023-08-25 21:35:42 +00:00
|
|
|
const yyEofCode = 1
|
|
|
|
const yyErrCode = 2
|
|
|
|
const yyInitialStackSize = 16
|
2019-12-05 16:16:12 +00:00
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyExca = [...]int16{
|
2019-12-05 16:16:12 +00:00
|
|
|
-1, 1,
|
|
|
|
1, -1,
|
|
|
|
-2, 0,
|
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 <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* 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 <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-03 20:18:57 +00:00
|
|
|
-1, 37,
|
2024-08-01 14:07:08 +00:00
|
|
|
1, 138,
|
|
|
|
10, 138,
|
|
|
|
24, 138,
|
2020-01-08 11:04:47 +00:00
|
|
|
-2, 0,
|
2024-05-08 11:58:24 +00:00
|
|
|
-1, 61,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 181,
|
|
|
|
15, 181,
|
|
|
|
79, 181,
|
|
|
|
85, 181,
|
2024-03-04 13:57:28 +00:00
|
|
|
-2, 102,
|
2024-08-01 14:07:08 +00:00
|
|
|
-1, 62,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 182,
|
|
|
|
15, 182,
|
|
|
|
79, 182,
|
|
|
|
85, 182,
|
2024-08-01 14:07:08 +00:00
|
|
|
-2, 103,
|
|
|
|
-1, 63,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 183,
|
|
|
|
15, 183,
|
|
|
|
79, 183,
|
|
|
|
85, 183,
|
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 <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* 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 <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-03 20:18:57 +00:00
|
|
|
-2, 105,
|
2024-08-01 14:07:08 +00:00
|
|
|
-1, 64,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 184,
|
|
|
|
15, 184,
|
|
|
|
79, 184,
|
|
|
|
85, 184,
|
2024-03-04 13:57:28 +00:00
|
|
|
-2, 106,
|
2024-08-01 14:07:08 +00:00
|
|
|
-1, 65,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 185,
|
|
|
|
15, 185,
|
|
|
|
79, 185,
|
|
|
|
85, 185,
|
2024-08-01 14:07:08 +00:00
|
|
|
-2, 107,
|
|
|
|
-1, 66,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 186,
|
|
|
|
15, 186,
|
|
|
|
79, 186,
|
|
|
|
85, 186,
|
2024-08-01 14:07:08 +00:00
|
|
|
-2, 112,
|
|
|
|
-1, 67,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 187,
|
|
|
|
15, 187,
|
|
|
|
79, 187,
|
|
|
|
85, 187,
|
2024-08-01 14:07:08 +00:00
|
|
|
-2, 114,
|
|
|
|
-1, 68,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 188,
|
|
|
|
15, 188,
|
|
|
|
79, 188,
|
|
|
|
85, 188,
|
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 <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* 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 <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-03 20:18:57 +00:00
|
|
|
-2, 116,
|
2024-08-01 14:07:08 +00:00
|
|
|
-1, 69,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 189,
|
|
|
|
15, 189,
|
|
|
|
79, 189,
|
|
|
|
85, 189,
|
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 <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* 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 <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-03 20:18:57 +00:00
|
|
|
-2, 117,
|
2024-08-01 14:07:08 +00:00
|
|
|
-1, 70,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 190,
|
|
|
|
15, 190,
|
|
|
|
79, 190,
|
|
|
|
85, 190,
|
2024-02-15 19:25:12 +00:00
|
|
|
-2, 118,
|
2024-08-01 14:07:08 +00:00
|
|
|
-1, 71,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 191,
|
|
|
|
15, 191,
|
|
|
|
79, 191,
|
|
|
|
85, 191,
|
2024-03-04 13:57:28 +00:00
|
|
|
-2, 119,
|
2024-08-01 14:07:08 +00:00
|
|
|
-1, 72,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 192,
|
|
|
|
15, 192,
|
|
|
|
79, 192,
|
|
|
|
85, 192,
|
2024-08-01 14:07:08 +00:00
|
|
|
-2, 120,
|
|
|
|
-1, 73,
|
2024-07-31 07:53:05 +00:00
|
|
|
2, 193,
|
|
|
|
15, 193,
|
|
|
|
79, 193,
|
|
|
|
85, 193,
|
2024-03-04 13:57:28 +00:00
|
|
|
-2, 124,
|
2024-08-01 14:07:08 +00:00
|
|
|
-1, 74,
|
|
|
|
2, 194,
|
|
|
|
15, 194,
|
|
|
|
79, 194,
|
|
|
|
85, 194,
|
|
|
|
-2, 125,
|
2024-03-04 13:57:28 +00:00
|
|
|
-1, 200,
|
2024-08-01 14:07:08 +00:00
|
|
|
9, 243,
|
|
|
|
12, 243,
|
|
|
|
13, 243,
|
|
|
|
18, 243,
|
|
|
|
19, 243,
|
|
|
|
25, 243,
|
|
|
|
41, 243,
|
|
|
|
47, 243,
|
|
|
|
48, 243,
|
|
|
|
51, 243,
|
|
|
|
57, 243,
|
|
|
|
62, 243,
|
|
|
|
63, 243,
|
|
|
|
64, 243,
|
|
|
|
65, 243,
|
|
|
|
66, 243,
|
|
|
|
67, 243,
|
|
|
|
68, 243,
|
|
|
|
69, 243,
|
|
|
|
70, 243,
|
|
|
|
71, 243,
|
|
|
|
72, 243,
|
|
|
|
73, 243,
|
|
|
|
74, 243,
|
|
|
|
75, 243,
|
|
|
|
79, 243,
|
|
|
|
83, 243,
|
|
|
|
85, 243,
|
|
|
|
88, 243,
|
|
|
|
89, 243,
|
2024-03-14 18:48:51 +00:00
|
|
|
-2, 0,
|
|
|
|
-1, 201,
|
2024-08-01 14:07:08 +00:00
|
|
|
9, 243,
|
|
|
|
12, 243,
|
|
|
|
13, 243,
|
|
|
|
18, 243,
|
|
|
|
19, 243,
|
|
|
|
25, 243,
|
|
|
|
41, 243,
|
|
|
|
47, 243,
|
|
|
|
48, 243,
|
|
|
|
51, 243,
|
|
|
|
57, 243,
|
|
|
|
62, 243,
|
|
|
|
63, 243,
|
|
|
|
64, 243,
|
|
|
|
65, 243,
|
|
|
|
66, 243,
|
|
|
|
67, 243,
|
|
|
|
68, 243,
|
|
|
|
69, 243,
|
|
|
|
70, 243,
|
|
|
|
71, 243,
|
|
|
|
72, 243,
|
|
|
|
73, 243,
|
|
|
|
74, 243,
|
|
|
|
75, 243,
|
|
|
|
79, 243,
|
|
|
|
83, 243,
|
|
|
|
85, 243,
|
|
|
|
88, 243,
|
|
|
|
89, 243,
|
2024-01-30 07:37:49 +00:00
|
|
|
-2, 0,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const yyPrivate = 57344
|
|
|
|
|
2024-08-01 14:07:08 +00:00
|
|
|
const yyLast = 799
|
2024-02-15 19:25:12 +00:00
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyAct = [...]int16{
|
2024-09-09 04:29:29 +00:00
|
|
|
152, 334, 332, 155, 339, 226, 39, 192, 276, 44,
|
|
|
|
291, 290, 118, 82, 178, 229, 107, 106, 346, 347,
|
|
|
|
348, 349, 109, 108, 198, 239, 199, 156, 110, 105,
|
|
|
|
6, 245, 200, 201, 133, 325, 111, 329, 228, 60,
|
|
|
|
357, 293, 328, 304, 267, 160, 266, 128, 55, 151,
|
|
|
|
302, 311, 302, 196, 340, 159, 55, 89, 54, 356,
|
|
|
|
241, 242, 355, 113, 243, 114, 54, 98, 99, 265,
|
|
|
|
112, 101, 256, 104, 88, 230, 232, 234, 235, 236,
|
|
|
|
244, 246, 249, 250, 251, 252, 253, 257, 258, 105,
|
|
|
|
333, 231, 233, 237, 238, 240, 247, 248, 103, 115,
|
|
|
|
109, 254, 255, 324, 150, 218, 110, 264, 111, 270,
|
|
|
|
77, 35, 7, 149, 188, 163, 322, 321, 173, 320,
|
|
|
|
167, 170, 323, 165, 271, 166, 2, 3, 4, 5,
|
|
|
|
263, 101, 194, 104, 180, 184, 197, 187, 186, 319,
|
|
|
|
272, 202, 203, 204, 205, 206, 207, 208, 209, 210,
|
|
|
|
211, 212, 213, 214, 215, 216, 195, 299, 103, 318,
|
|
|
|
217, 36, 298, 1, 190, 219, 220, 317, 160, 160,
|
|
|
|
316, 193, 160, 154, 182, 196, 229, 297, 159, 159,
|
|
|
|
160, 358, 159, 268, 181, 183, 239, 260, 296, 262,
|
|
|
|
159, 315, 245, 129, 314, 55, 225, 313, 161, 228,
|
|
|
|
161, 161, 259, 312, 161, 54, 86, 295, 310, 288,
|
|
|
|
289, 8, 161, 292, 162, 37, 162, 162, 49, 269,
|
|
|
|
162, 241, 242, 309, 179, 243, 180, 127, 162, 126,
|
|
|
|
308, 223, 294, 256, 48, 222, 230, 232, 234, 235,
|
2024-08-01 14:07:08 +00:00
|
|
|
236, 244, 246, 249, 250, 251, 252, 253, 257, 258,
|
2024-09-09 04:29:29 +00:00
|
|
|
221, 169, 231, 233, 237, 238, 240, 247, 248, 157,
|
|
|
|
158, 164, 254, 255, 168, 10, 182, 300, 55, 301,
|
|
|
|
303, 47, 305, 46, 132, 79, 181, 183, 54, 306,
|
|
|
|
307, 45, 134, 135, 136, 137, 138, 139, 140, 141,
|
|
|
|
142, 143, 144, 145, 146, 147, 148, 43, 59, 50,
|
|
|
|
84, 9, 9, 121, 326, 78, 327, 130, 171, 121,
|
|
|
|
83, 42, 131, 119, 335, 336, 337, 331, 185, 119,
|
|
|
|
338, 261, 342, 341, 344, 343, 122, 117, 41, 177,
|
|
|
|
350, 351, 122, 55, 176, 352, 53, 77, 40, 56,
|
|
|
|
125, 354, 22, 54, 84, 124, 172, 175, 51, 57,
|
|
|
|
191, 353, 273, 85, 83, 189, 359, 224, 123, 80,
|
|
|
|
345, 120, 81, 153, 58, 75, 227, 52, 116, 0,
|
|
|
|
0, 18, 19, 0, 0, 20, 0, 0, 0, 0,
|
2024-08-01 14:07:08 +00:00
|
|
|
0, 76, 0, 0, 0, 0, 61, 62, 63, 64,
|
|
|
|
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
|
|
|
|
0, 0, 0, 13, 0, 0, 0, 24, 0, 30,
|
2024-09-09 04:29:29 +00:00
|
|
|
0, 0, 31, 32, 55, 38, 105, 53, 77, 0,
|
2024-08-01 14:07:08 +00:00
|
|
|
56, 275, 0, 22, 54, 0, 0, 0, 274, 0,
|
|
|
|
57, 0, 278, 279, 277, 284, 286, 283, 285, 280,
|
2024-09-09 04:29:29 +00:00
|
|
|
281, 282, 287, 87, 89, 0, 75, 0, 0, 0,
|
|
|
|
0, 0, 18, 19, 98, 99, 20, 0, 101, 102,
|
|
|
|
104, 88, 76, 0, 0, 0, 0, 61, 62, 63,
|
2024-03-14 18:48:51 +00:00
|
|
|
64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
|
2024-09-09 04:29:29 +00:00
|
|
|
74, 0, 0, 0, 13, 103, 0, 0, 24, 0,
|
2024-08-01 14:07:08 +00:00
|
|
|
30, 0, 55, 31, 32, 53, 77, 0, 56, 330,
|
|
|
|
0, 22, 54, 0, 0, 0, 0, 0, 57, 0,
|
|
|
|
278, 279, 277, 284, 286, 283, 285, 280, 281, 282,
|
|
|
|
287, 0, 0, 0, 75, 0, 0, 0, 0, 0,
|
|
|
|
18, 19, 0, 0, 20, 0, 0, 0, 17, 77,
|
|
|
|
76, 0, 0, 0, 22, 61, 62, 63, 64, 65,
|
|
|
|
66, 67, 68, 69, 70, 71, 72, 73, 74, 0,
|
|
|
|
0, 0, 13, 0, 0, 0, 24, 0, 30, 0,
|
|
|
|
0, 31, 32, 18, 19, 0, 0, 20, 0, 0,
|
|
|
|
0, 17, 35, 0, 0, 0, 0, 22, 11, 12,
|
|
|
|
14, 15, 16, 21, 23, 25, 26, 27, 28, 29,
|
|
|
|
33, 34, 0, 0, 0, 13, 0, 0, 0, 24,
|
|
|
|
0, 30, 0, 0, 31, 32, 18, 19, 0, 0,
|
|
|
|
20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 11, 12, 14, 15, 16, 21, 23, 25, 26,
|
|
|
|
27, 28, 29, 33, 34, 105, 0, 0, 13, 0,
|
|
|
|
0, 0, 24, 174, 30, 0, 0, 31, 32, 0,
|
|
|
|
0, 0, 0, 0, 105, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 87, 89, 90, 0, 91, 92, 93, 94,
|
|
|
|
95, 96, 97, 98, 99, 100, 0, 101, 102, 104,
|
|
|
|
88, 87, 89, 90, 0, 91, 92, 93, 94, 95,
|
2024-07-31 07:53:05 +00:00
|
|
|
96, 97, 98, 99, 100, 0, 101, 102, 104, 88,
|
2024-08-01 14:07:08 +00:00
|
|
|
105, 0, 0, 0, 103, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 105,
|
|
|
|
0, 0, 0, 103, 0, 0, 0, 87, 89, 90,
|
|
|
|
0, 91, 92, 93, 0, 95, 96, 97, 98, 99,
|
|
|
|
100, 0, 101, 102, 104, 88, 87, 89, 90, 0,
|
|
|
|
91, 92, 0, 0, 95, 96, 0, 98, 99, 100,
|
|
|
|
0, 101, 102, 104, 88, 0, 0, 0, 0, 103,
|
2024-07-31 07:53:05 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
2024-08-01 14:07:08 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 103,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyPact = [...]int16{
|
2024-09-09 04:29:29 +00:00
|
|
|
28, 102, 569, 569, 405, 526, -1000, -1000, -1000, 98,
|
2024-07-31 07:53:05 +00:00
|
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
2024-02-15 19:25:12 +00:00
|
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
2024-09-09 04:29:29 +00:00
|
|
|
-1000, -1000, -1000, -1000, -1000, 342, -1000, 204, -1000, 650,
|
2020-06-30 14:51:18 +00:00
|
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
2024-09-09 04:29:29 +00:00
|
|
|
-1000, -1000, 21, 93, -1000, -1000, 483, -1000, 483, 97,
|
2019-12-21 08:44:12 +00:00
|
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
2024-09-09 04:29:29 +00:00
|
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, 307, -1000, -1000,
|
|
|
|
338, -1000, -1000, 225, -1000, 23, -1000, -44, -44, -44,
|
|
|
|
-44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
|
|
|
|
-44, -44, -44, 47, 171, 259, 93, -57, -1000, 249,
|
|
|
|
249, 324, -1000, 631, 75, -1000, 327, -1000, -1000, 222,
|
|
|
|
130, -1000, -1000, -1000, 298, -1000, 112, -1000, 159, 483,
|
|
|
|
-1000, -58, -48, -1000, 483, 483, 483, 483, 483, 483,
|
2024-08-01 14:07:08 +00:00
|
|
|
483, 483, 483, 483, 483, 483, 483, 483, 483, -1000,
|
2024-09-09 04:29:29 +00:00
|
|
|
39, -1000, -1000, 90, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
|
|
-1000, 36, 36, 229, -1000, -1000, -1000, -1000, 174, -1000,
|
|
|
|
-1000, 180, -1000, 650, -1000, -1000, 301, -1000, 105, -1000,
|
|
|
|
-1000, -1000, -1000, -1000, 44, -1000, -1000, -1000, -1000, -1000,
|
|
|
|
18, 157, 83, -1000, -1000, -1000, 404, 15, 249, 249,
|
|
|
|
249, 249, 75, 75, 402, 402, 402, 715, 696, 402,
|
|
|
|
402, 715, 75, 75, 402, 75, 15, -1000, 19, -1000,
|
|
|
|
-1000, -1000, 186, -1000, 155, -1000, -1000, -1000, -1000, -1000,
|
2019-12-18 14:18:52 +00:00
|
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
2021-01-20 10:57:39 +00:00
|
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
2024-09-09 04:29:29 +00:00
|
|
|
483, -1000, -1000, -1000, -1000, -1000, -1000, 31, 31, 17,
|
|
|
|
31, 37, 37, 206, 34, -1000, -1000, 197, 191, 188,
|
|
|
|
185, 164, 161, 153, 133, 113, 111, 110, -1000, -1000,
|
|
|
|
-1000, -1000, -1000, -1000, 101, -1000, -1000, -1000, 13, -1000,
|
|
|
|
650, -1000, -1000, -1000, 31, -1000, 16, 11, 482, -1000,
|
|
|
|
-1000, -1000, 33, 163, 163, 163, 36, 40, 40, 33,
|
|
|
|
40, 33, -74, -1000, -1000, -1000, -1000, -1000, 31, 31,
|
|
|
|
-1000, -1000, -1000, 31, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
|
|
163, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
|
|
-1000, -1000, -1000, 38, -1000, 160, -1000, -1000, -1000, -1000,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyPgo = [...]int16{
|
2024-09-09 04:29:29 +00:00
|
|
|
0, 368, 12, 367, 5, 14, 366, 298, 364, 363,
|
|
|
|
361, 360, 265, 211, 359, 13, 357, 10, 11, 355,
|
|
|
|
353, 7, 352, 8, 4, 351, 2, 1, 3, 350,
|
|
|
|
27, 0, 348, 338, 17, 193, 328, 312, 6, 311,
|
|
|
|
308, 16, 307, 39, 297, 9, 281, 274, 273, 271,
|
|
|
|
234, 218, 299, 163, 161,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyR1 = [...]int8{
|
2024-07-31 07:53:05 +00:00
|
|
|
0, 53, 53, 53, 53, 53, 53, 53, 38, 38,
|
|
|
|
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
|
|
|
|
33, 33, 33, 33, 34, 34, 36, 36, 36, 36,
|
|
|
|
36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
|
|
|
|
36, 36, 35, 37, 37, 47, 47, 42, 42, 42,
|
|
|
|
42, 17, 17, 17, 17, 16, 16, 16, 4, 4,
|
2024-08-01 14:07:08 +00:00
|
|
|
4, 39, 41, 41, 40, 40, 40, 48, 46, 46,
|
|
|
|
46, 32, 32, 32, 9, 9, 44, 50, 50, 50,
|
|
|
|
50, 50, 50, 51, 52, 52, 52, 43, 43, 43,
|
|
|
|
1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
|
|
|
|
13, 13, 7, 7, 7, 7, 7, 7, 7, 7,
|
2024-02-15 19:25:12 +00:00
|
|
|
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
2024-08-01 14:07:08 +00:00
|
|
|
7, 7, 7, 7, 7, 7, 12, 12, 12, 12,
|
|
|
|
14, 14, 14, 15, 15, 15, 15, 54, 20, 20,
|
|
|
|
20, 20, 19, 19, 19, 19, 19, 19, 19, 19,
|
|
|
|
19, 29, 29, 29, 21, 21, 21, 21, 22, 22,
|
|
|
|
22, 23, 23, 23, 23, 23, 23, 23, 23, 23,
|
|
|
|
23, 23, 24, 24, 25, 25, 25, 11, 11, 11,
|
|
|
|
11, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
|
|
3, 3, 3, 3, 3, 6, 6, 6, 6, 6,
|
2021-08-12 16:38:06 +00:00
|
|
|
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
2021-01-20 10:57:39 +00:00
|
|
|
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
2024-08-01 14:07:08 +00:00
|
|
|
6, 6, 6, 6, 8, 8, 5, 5, 5, 5,
|
|
|
|
45, 45, 28, 28, 30, 30, 31, 31, 27, 26,
|
|
|
|
26, 49, 10, 18, 18,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyR2 = [...]int8{
|
2020-01-08 11:04:47 +00:00
|
|
|
0, 2, 2, 2, 2, 2, 2, 1, 1, 1,
|
2021-01-20 10:57:39 +00:00
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
3, 3, 2, 2, 2, 2, 4, 4, 4, 4,
|
2020-01-08 11:04:47 +00:00
|
|
|
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
2021-08-24 23:22:14 +00:00
|
|
|
4, 4, 1, 0, 1, 3, 3, 1, 1, 3,
|
|
|
|
3, 3, 4, 2, 1, 3, 1, 2, 1, 1,
|
2024-08-01 14:07:08 +00:00
|
|
|
1, 2, 3, 2, 3, 1, 2, 3, 3, 4,
|
|
|
|
3, 3, 5, 3, 1, 1, 4, 6, 5, 6,
|
|
|
|
5, 4, 3, 2, 2, 1, 1, 3, 4, 2,
|
|
|
|
3, 1, 2, 3, 3, 1, 3, 3, 2, 1,
|
|
|
|
2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
2020-03-05 13:20:53 +00:00
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
2024-08-01 14:07:08 +00:00
|
|
|
1, 1, 1, 1, 1, 1, 3, 4, 2, 0,
|
|
|
|
3, 1, 2, 3, 3, 2, 1, 2, 0, 3,
|
|
|
|
2, 1, 1, 3, 1, 3, 4, 1, 3, 5,
|
|
|
|
5, 1, 1, 1, 4, 3, 3, 2, 3, 1,
|
|
|
|
2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
|
|
3, 3, 4, 3, 3, 1, 2, 1, 1, 1,
|
2020-03-05 13:20:53 +00:00
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
2024-07-31 07:53:05 +00:00
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
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 <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* 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 <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-03 20:18:57 +00:00
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
2019-12-18 14:18:52 +00:00
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
2020-01-08 11:04:47 +00:00
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
2024-08-01 14:07:08 +00:00
|
|
|
1, 1, 1, 1, 2, 2, 1, 1, 1, 2,
|
|
|
|
1, 1, 1, 0, 1,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyChk = [...]int16{
|
2024-07-31 07:53:05 +00:00
|
|
|
-1000, -53, 98, 99, 100, 101, 2, 10, -13, -7,
|
|
|
|
-12, 62, 63, 79, 64, 65, 66, 12, 47, 48,
|
|
|
|
51, 67, 18, 68, 83, 69, 70, 71, 72, 73,
|
|
|
|
85, 88, 89, 74, 75, 13, -54, -13, 10, -38,
|
|
|
|
-33, -36, -39, -44, -45, -46, -48, -49, -50, -51,
|
|
|
|
-52, -32, -3, 12, 19, 9, 15, 25, -8, -7,
|
|
|
|
-43, 62, 63, 64, 65, 66, 67, 68, 69, 70,
|
|
|
|
71, 72, 73, 74, 75, 41, 57, 13, -52, -12,
|
|
|
|
-14, 20, -15, 12, 2, -20, 2, 41, 59, 42,
|
|
|
|
43, 45, 46, 47, 48, 49, 50, 51, 52, 53,
|
|
|
|
54, 56, 57, 83, 58, 14, -34, -41, 2, 79,
|
|
|
|
85, 15, -41, -38, -38, -43, -1, 20, -2, 12,
|
|
|
|
-10, 2, 25, 20, 7, 2, 4, 2, 24, -35,
|
|
|
|
-42, -37, -47, 78, -35, -35, -35, -35, -35, -35,
|
|
|
|
-35, -35, -35, -35, -35, -35, -35, -35, -35, -45,
|
|
|
|
57, 2, -31, -9, 2, -28, -30, 88, 89, 19,
|
|
|
|
9, 41, 57, -45, 2, -41, -34, -17, 15, 2,
|
|
|
|
-17, -40, 22, -38, 22, 20, 7, 2, -5, 2,
|
|
|
|
4, 54, 44, 55, -5, 20, -15, 25, 2, -19,
|
|
|
|
5, -29, -21, 12, -28, -30, 16, -38, 82, 84,
|
|
|
|
80, 81, -38, -38, -38, -38, -38, -38, -38, -38,
|
|
|
|
-38, -38, -38, -38, -38, -38, -38, -45, 15, -28,
|
2024-08-01 14:07:08 +00:00
|
|
|
-28, 21, 6, 2, -16, 22, -4, -6, 25, 2,
|
|
|
|
62, 78, 63, 79, 64, 65, 66, 80, 81, 12,
|
|
|
|
82, 47, 48, 51, 67, 18, 68, 83, 84, 69,
|
|
|
|
70, 71, 72, 73, 88, 89, 59, 74, 75, 22,
|
|
|
|
7, 20, -2, 25, 2, 25, 2, 26, 26, -30,
|
|
|
|
26, 41, 57, -22, 24, 17, -23, 30, 28, 29,
|
|
|
|
35, 36, 37, 33, 31, 34, 32, 38, -17, -17,
|
|
|
|
-18, -17, -18, 22, -45, 21, 2, 22, 7, 2,
|
|
|
|
-38, -27, 19, -27, 26, -27, -21, -21, 24, 17,
|
|
|
|
2, 17, 6, 6, 6, 6, 6, 6, 6, 6,
|
|
|
|
6, 6, 6, 21, 2, 22, -4, -27, 26, 26,
|
2024-09-09 04:29:29 +00:00
|
|
|
17, -23, -26, 57, -27, -31, -31, -31, -28, -24,
|
2024-08-01 14:07:08 +00:00
|
|
|
14, -24, -26, -24, -26, -11, 92, 93, 94, 95,
|
2024-09-09 04:29:29 +00:00
|
|
|
-27, -27, -27, -25, -31, 24, 21, 2, 21, -31,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyDef = [...]int16{
|
2024-08-01 14:07:08 +00:00
|
|
|
0, -2, 129, 129, 0, 0, 7, 6, 1, 129,
|
|
|
|
101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
|
|
|
|
111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
|
|
|
|
121, 122, 123, 124, 125, 0, 2, -2, 3, 4,
|
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 <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* 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 <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-03 20:18:57 +00:00
|
|
|
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
|
2024-08-01 14:07:08 +00:00
|
|
|
18, 19, 0, 108, 230, 231, 0, 241, 0, 85,
|
|
|
|
86, -2, -2, -2, -2, -2, -2, -2, -2, -2,
|
|
|
|
-2, -2, -2, -2, -2, 224, 225, 0, 5, 100,
|
|
|
|
0, 128, 131, 0, 136, 137, 141, 43, 43, 43,
|
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 <juanjosec@gmail.com>
* gofumpt -d -extra
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* more lint fixes+
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* put limitk() and limit_ratio() behind --enable-feature=promql-experimental-functions
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* EnableExperimentalFunctions for TestConcurrentRangeQueries() also
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* use testutil.RequireEqual to fix tests, WIP equivalent thingie for require.Contains
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* lint fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* moar linting
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-19
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* re-add limit(2, metric) testing for N=2 common series subset
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move `ratio = param` to default switch case, for better readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* gofumpt -d -extra util/testutil/cmp.go
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* early break when reaching k elems in limitk(), should have always been so (!)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small typo fix
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change small break-loop rearrange for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove IsNan(ratio) condition in switch-case, already handled as input validation
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change adding some comments
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* no-change simplify fullMatrix() helper functions used for tests
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add `limitk(-1, metric)` testcase, which is handled as any k < 1 case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* engine_test.go: no-change create `requireCommonSeries() helper func (moving code into it) for readability
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* rebase 2024-06-21
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* 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 <juanjosec@gmail.com>
* move limitk(), limit_ratio() testing to promql/promqltest/testdata/limit.test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove stale leftover after moving tests from engine_test.go to testdata/
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix flaky `limit_ratio(0.5, ...)` test case
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Update promql/engine.go
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix AddRatioSample() implementation to use a single conditional (instead of switch/case + fallback return)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* docs/querying/operators.md: document r < 0
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add negative limit_ratio() example to docs/querying/examples.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* move more extensive docu examples to docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* typo
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* small docu fix for poor-mans-normality-check, add it to limit.test ;)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* limit.test: expand "Poor man's normality check" to whole eval range
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* restore mistakenly removed existing small comment
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand poors-man-normality-check case(s)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* Revert "expand poors-man-normality-check case(s)"
This reverts commit f69e1603b2ebe69c0a100197cfbcf6f81644b564, indeed too
flaky 0:)
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove humor from docs/querying/operators.md
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix signoff
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add web/ui missing changes
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* expand limit_ratio test cases, cross-fingering they'll not be flaky
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* remove flaky test
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing warnings.Merge(ws) in instant-query return shortcut
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* add missing LimitK||LimitRatio case to codemirror-promql/src/parser/parser.ts
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* fix ui-lint
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
* actually fix returned warnings :]
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
---------
Signed-off-by: JuanJo Ciarlante <juanjosec@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
2024-07-03 20:18:57 +00:00
|
|
|
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
|
2024-03-04 13:57:28 +00:00
|
|
|
43, 43, 43, 0, 0, 0, 0, 22, 23, 0,
|
2024-08-01 14:07:08 +00:00
|
|
|
0, 0, 61, 0, 83, 84, 0, 89, 91, 0,
|
|
|
|
95, 99, 242, 126, 0, 132, 0, 135, 140, 0,
|
2024-03-04 13:57:28 +00:00
|
|
|
42, 47, 48, 44, 0, 0, 0, 0, 0, 0,
|
2024-08-01 14:07:08 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 68,
|
|
|
|
0, 70, 71, 0, 73, 236, 237, 74, 75, 232,
|
|
|
|
233, 0, 0, 0, 82, 20, 21, 24, 0, 54,
|
|
|
|
25, 0, 63, 65, 67, 87, 0, 92, 0, 98,
|
|
|
|
226, 227, 228, 229, 0, 127, 130, 133, 134, 139,
|
|
|
|
142, 144, 147, 151, 152, 153, 0, 26, 0, 0,
|
2024-03-14 18:48:51 +00:00
|
|
|
-2, -2, 27, 28, 29, 30, 31, 32, 33, 34,
|
2024-08-01 14:07:08 +00:00
|
|
|
35, 36, 37, 38, 39, 40, 41, 69, 0, 234,
|
|
|
|
235, 76, 0, 81, 0, 53, 56, 58, 59, 60,
|
2024-07-31 07:53:05 +00:00
|
|
|
195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
|
|
|
|
205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
|
2024-08-01 14:07:08 +00:00
|
|
|
215, 216, 217, 218, 219, 220, 221, 222, 223, 62,
|
|
|
|
66, 88, 90, 93, 97, 94, 96, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 157, 159, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 45, 46,
|
|
|
|
49, 244, 50, 72, 0, 78, 80, 51, 0, 57,
|
|
|
|
64, 143, 238, 145, 0, 148, 0, 0, 0, 155,
|
|
|
|
160, 156, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 77, 79, 52, 55, 146, 0, 0,
|
|
|
|
154, 158, 161, 0, 240, 162, 163, 164, 165, 166,
|
|
|
|
0, 167, 168, 169, 170, 171, 177, 178, 179, 180,
|
|
|
|
149, 150, 239, 0, 175, 0, 173, 176, 172, 174,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyTok1 = [...]int8{
|
2019-12-05 16:16:12 +00:00
|
|
|
1,
|
|
|
|
}
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyTok2 = [...]int8{
|
2019-12-05 16:16:12 +00:00
|
|
|
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
|
|
|
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
|
|
|
|
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
|
|
|
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
|
|
|
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
|
|
|
|
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
|
2019-12-16 16:38:18 +00:00
|
|
|
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
|
2023-08-25 21:35:42 +00:00
|
|
|
72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
|
|
|
|
82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
|
2024-07-31 07:53:05 +00:00
|
|
|
92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
|
|
|
|
102,
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-02-17 01:49:00 +00:00
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
var yyTok3 = [...]int8{
|
2019-12-05 16:16:12 +00:00
|
|
|
0,
|
|
|
|
}
|
|
|
|
|
|
|
|
var yyErrorMessages = [...]struct {
|
|
|
|
state int
|
|
|
|
token int
|
|
|
|
msg string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
/* parser for yacc output */
|
|
|
|
|
|
|
|
var (
|
|
|
|
yyDebug = 0
|
|
|
|
yyErrorVerbose = false
|
|
|
|
)
|
|
|
|
|
|
|
|
type yyLexer interface {
|
|
|
|
Lex(lval *yySymType) int
|
|
|
|
Error(s string)
|
|
|
|
}
|
|
|
|
|
|
|
|
type yyParser interface {
|
|
|
|
Parse(yyLexer) int
|
|
|
|
Lookahead() int
|
|
|
|
}
|
|
|
|
|
|
|
|
type yyParserImpl struct {
|
|
|
|
lval yySymType
|
|
|
|
stack [yyInitialStackSize]yySymType
|
|
|
|
char int
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *yyParserImpl) Lookahead() int {
|
|
|
|
return p.char
|
|
|
|
}
|
|
|
|
|
|
|
|
func yyNewParser() yyParser {
|
|
|
|
return &yyParserImpl{}
|
|
|
|
}
|
|
|
|
|
|
|
|
const yyFlag = -1000
|
|
|
|
|
|
|
|
func yyTokname(c int) string {
|
|
|
|
if c >= 1 && c-1 < len(yyToknames) {
|
|
|
|
if yyToknames[c-1] != "" {
|
|
|
|
return yyToknames[c-1]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return __yyfmt__.Sprintf("tok-%v", c)
|
|
|
|
}
|
|
|
|
|
|
|
|
func yyStatname(s int) string {
|
|
|
|
if s >= 0 && s < len(yyStatenames) {
|
|
|
|
if yyStatenames[s] != "" {
|
|
|
|
return yyStatenames[s]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return __yyfmt__.Sprintf("state-%v", s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func yyErrorMessage(state, lookAhead int) string {
|
|
|
|
const TOKSTART = 4
|
|
|
|
|
|
|
|
if !yyErrorVerbose {
|
|
|
|
return "syntax error"
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, e := range yyErrorMessages {
|
|
|
|
if e.state == state && e.token == lookAhead {
|
|
|
|
return "syntax error: " + e.msg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
res := "syntax error: unexpected " + yyTokname(lookAhead)
|
|
|
|
|
|
|
|
// To match Bison, suggest at most four expected tokens.
|
|
|
|
expected := make([]int, 0, 4)
|
|
|
|
|
|
|
|
// Look for shiftable tokens.
|
2024-04-13 10:59:54 +00:00
|
|
|
base := int(yyPact[state])
|
2019-12-05 16:16:12 +00:00
|
|
|
for tok := TOKSTART; tok-1 < len(yyToknames); tok++ {
|
2024-04-13 10:59:54 +00:00
|
|
|
if n := base + tok; n >= 0 && n < yyLast && int(yyChk[int(yyAct[n])]) == tok {
|
2019-12-05 16:16:12 +00:00
|
|
|
if len(expected) == cap(expected) {
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
expected = append(expected, tok)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if yyDef[state] == -2 {
|
|
|
|
i := 0
|
2024-04-13 10:59:54 +00:00
|
|
|
for yyExca[i] != -1 || int(yyExca[i+1]) != state {
|
2019-12-05 16:16:12 +00:00
|
|
|
i += 2
|
|
|
|
}
|
|
|
|
|
|
|
|
// Look for tokens that we accept or reduce.
|
|
|
|
for i += 2; yyExca[i] >= 0; i += 2 {
|
2024-04-13 10:59:54 +00:00
|
|
|
tok := int(yyExca[i])
|
2019-12-05 16:16:12 +00:00
|
|
|
if tok < TOKSTART || yyExca[i+1] == 0 {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if len(expected) == cap(expected) {
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
expected = append(expected, tok)
|
|
|
|
}
|
|
|
|
|
|
|
|
// If the default action is to accept or reduce, give up.
|
|
|
|
if yyExca[i+1] != 0 {
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for i, tok := range expected {
|
|
|
|
if i == 0 {
|
|
|
|
res += ", expecting "
|
|
|
|
} else {
|
|
|
|
res += " or "
|
|
|
|
}
|
|
|
|
res += yyTokname(tok)
|
|
|
|
}
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
|
|
|
|
func yylex1(lex yyLexer, lval *yySymType) (char, token int) {
|
|
|
|
token = 0
|
|
|
|
char = lex.Lex(lval)
|
|
|
|
if char <= 0 {
|
2024-04-13 10:59:54 +00:00
|
|
|
token = int(yyTok1[0])
|
2019-12-05 16:16:12 +00:00
|
|
|
goto out
|
|
|
|
}
|
|
|
|
if char < len(yyTok1) {
|
2024-04-13 10:59:54 +00:00
|
|
|
token = int(yyTok1[char])
|
2019-12-05 16:16:12 +00:00
|
|
|
goto out
|
|
|
|
}
|
|
|
|
if char >= yyPrivate {
|
|
|
|
if char < yyPrivate+len(yyTok2) {
|
2024-04-13 10:59:54 +00:00
|
|
|
token = int(yyTok2[char-yyPrivate])
|
2019-12-05 16:16:12 +00:00
|
|
|
goto out
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for i := 0; i < len(yyTok3); i += 2 {
|
2024-04-13 10:59:54 +00:00
|
|
|
token = int(yyTok3[i+0])
|
2019-12-05 16:16:12 +00:00
|
|
|
if token == char {
|
2024-04-13 10:59:54 +00:00
|
|
|
token = int(yyTok3[i+1])
|
2019-12-05 16:16:12 +00:00
|
|
|
goto out
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
out:
|
|
|
|
if token == 0 {
|
2024-04-13 10:59:54 +00:00
|
|
|
token = int(yyTok2[1]) /* unknown char */
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
if yyDebug >= 3 {
|
|
|
|
__yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char))
|
|
|
|
}
|
|
|
|
return char, token
|
|
|
|
}
|
|
|
|
|
|
|
|
func yyParse(yylex yyLexer) int {
|
|
|
|
return yyNewParser().Parse(yylex)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (yyrcvr *yyParserImpl) Parse(yylex yyLexer) int {
|
|
|
|
var yyn int
|
|
|
|
var yyVAL yySymType
|
|
|
|
var yyDollar []yySymType
|
|
|
|
_ = yyDollar // silence set and not used
|
|
|
|
yyS := yyrcvr.stack[:]
|
|
|
|
|
|
|
|
Nerrs := 0 /* number of errors */
|
|
|
|
Errflag := 0 /* error recovery flag */
|
|
|
|
yystate := 0
|
|
|
|
yyrcvr.char = -1
|
|
|
|
yytoken := -1 // yyrcvr.char translated into internal numbering
|
|
|
|
defer func() {
|
|
|
|
// Make sure we report no lookahead when not parsing.
|
|
|
|
yystate = -1
|
|
|
|
yyrcvr.char = -1
|
|
|
|
yytoken = -1
|
|
|
|
}()
|
|
|
|
yyp := -1
|
|
|
|
goto yystack
|
|
|
|
|
|
|
|
ret0:
|
|
|
|
return 0
|
|
|
|
|
|
|
|
ret1:
|
|
|
|
return 1
|
|
|
|
|
|
|
|
yystack:
|
|
|
|
/* put a state and value onto the stack */
|
|
|
|
if yyDebug >= 4 {
|
|
|
|
__yyfmt__.Printf("char %v in %v\n", yyTokname(yytoken), yyStatname(yystate))
|
|
|
|
}
|
|
|
|
|
|
|
|
yyp++
|
|
|
|
if yyp >= len(yyS) {
|
|
|
|
nyys := make([]yySymType, len(yyS)*2)
|
|
|
|
copy(nyys, yyS)
|
|
|
|
yyS = nyys
|
|
|
|
}
|
|
|
|
yyS[yyp] = yyVAL
|
|
|
|
yyS[yyp].yys = yystate
|
|
|
|
|
|
|
|
yynewstate:
|
2024-04-13 10:59:54 +00:00
|
|
|
yyn = int(yyPact[yystate])
|
2019-12-05 16:16:12 +00:00
|
|
|
if yyn <= yyFlag {
|
|
|
|
goto yydefault /* simple state */
|
|
|
|
}
|
|
|
|
if yyrcvr.char < 0 {
|
|
|
|
yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval)
|
|
|
|
}
|
|
|
|
yyn += yytoken
|
|
|
|
if yyn < 0 || yyn >= yyLast {
|
|
|
|
goto yydefault
|
|
|
|
}
|
2024-04-13 10:59:54 +00:00
|
|
|
yyn = int(yyAct[yyn])
|
|
|
|
if int(yyChk[yyn]) == yytoken { /* valid shift */
|
2019-12-05 16:16:12 +00:00
|
|
|
yyrcvr.char = -1
|
|
|
|
yytoken = -1
|
|
|
|
yyVAL = yyrcvr.lval
|
|
|
|
yystate = yyn
|
|
|
|
if Errflag > 0 {
|
|
|
|
Errflag--
|
|
|
|
}
|
|
|
|
goto yystack
|
|
|
|
}
|
|
|
|
|
|
|
|
yydefault:
|
|
|
|
/* default state action */
|
2024-04-13 10:59:54 +00:00
|
|
|
yyn = int(yyDef[yystate])
|
2019-12-05 16:16:12 +00:00
|
|
|
if yyn == -2 {
|
|
|
|
if yyrcvr.char < 0 {
|
|
|
|
yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval)
|
|
|
|
}
|
|
|
|
|
|
|
|
/* look through exception table */
|
|
|
|
xi := 0
|
|
|
|
for {
|
2024-04-13 10:59:54 +00:00
|
|
|
if yyExca[xi+0] == -1 && int(yyExca[xi+1]) == yystate {
|
2019-12-05 16:16:12 +00:00
|
|
|
break
|
|
|
|
}
|
|
|
|
xi += 2
|
|
|
|
}
|
|
|
|
for xi += 2; ; xi += 2 {
|
2024-04-13 10:59:54 +00:00
|
|
|
yyn = int(yyExca[xi+0])
|
2019-12-05 16:16:12 +00:00
|
|
|
if yyn < 0 || yyn == yytoken {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2024-04-13 10:59:54 +00:00
|
|
|
yyn = int(yyExca[xi+1])
|
2019-12-05 16:16:12 +00:00
|
|
|
if yyn < 0 {
|
|
|
|
goto ret0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if yyn == 0 {
|
|
|
|
/* error ... attempt to resume parsing */
|
|
|
|
switch Errflag {
|
|
|
|
case 0: /* brand new error */
|
|
|
|
yylex.Error(yyErrorMessage(yystate, yytoken))
|
|
|
|
Nerrs++
|
|
|
|
if yyDebug >= 1 {
|
|
|
|
__yyfmt__.Printf("%s", yyStatname(yystate))
|
|
|
|
__yyfmt__.Printf(" saw %s\n", yyTokname(yytoken))
|
|
|
|
}
|
|
|
|
fallthrough
|
|
|
|
|
|
|
|
case 1, 2: /* incompletely recovered error ... try again */
|
|
|
|
Errflag = 3
|
|
|
|
|
|
|
|
/* find a state where "error" is a legal shift action */
|
|
|
|
for yyp >= 0 {
|
2024-04-13 10:59:54 +00:00
|
|
|
yyn = int(yyPact[yyS[yyp].yys]) + yyErrCode
|
2019-12-05 16:16:12 +00:00
|
|
|
if yyn >= 0 && yyn < yyLast {
|
2024-04-13 10:59:54 +00:00
|
|
|
yystate = int(yyAct[yyn]) /* simulate a shift of "error" */
|
|
|
|
if int(yyChk[yystate]) == yyErrCode {
|
2019-12-05 16:16:12 +00:00
|
|
|
goto yystack
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the current p has no shift on "error", pop stack */
|
|
|
|
if yyDebug >= 2 {
|
|
|
|
__yyfmt__.Printf("error recovery pops state %d\n", yyS[yyp].yys)
|
|
|
|
}
|
|
|
|
yyp--
|
|
|
|
}
|
|
|
|
/* there is no state on the stack with an error shift ... abort */
|
|
|
|
goto ret1
|
|
|
|
|
|
|
|
case 3: /* no shift yet; clobber input char */
|
|
|
|
if yyDebug >= 2 {
|
|
|
|
__yyfmt__.Printf("error recovery discards %s\n", yyTokname(yytoken))
|
|
|
|
}
|
|
|
|
if yytoken == yyEofCode {
|
|
|
|
goto ret1
|
|
|
|
}
|
|
|
|
yyrcvr.char = -1
|
|
|
|
yytoken = -1
|
|
|
|
goto yynewstate /* try again in the same state */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* reduction by production yyn */
|
|
|
|
if yyDebug >= 2 {
|
|
|
|
__yyfmt__.Printf("reduce %v in:\n\t%v\n", yyn, yyStatname(yystate))
|
|
|
|
}
|
|
|
|
|
|
|
|
yynt := yyn
|
|
|
|
yypt := yyp
|
|
|
|
_ = yypt // guard against "declared and not used"
|
|
|
|
|
2024-04-13 10:59:54 +00:00
|
|
|
yyp -= int(yyR2[yyn])
|
2019-12-05 16:16:12 +00:00
|
|
|
// yyp is now the index of $0. Perform the default action. Iff the
|
|
|
|
// reduced production is ε, $1 is possibly out of range.
|
|
|
|
if yyp+1 >= len(yyS) {
|
|
|
|
nyys := make([]yySymType, len(yyS)*2)
|
|
|
|
copy(nyys, yyS)
|
|
|
|
yyS = nyys
|
|
|
|
}
|
|
|
|
yyVAL = yyS[yyp+1]
|
|
|
|
|
|
|
|
/* consult goto table to find next state */
|
2024-04-13 10:59:54 +00:00
|
|
|
yyn = int(yyR1[yyn])
|
|
|
|
yyg := int(yyPgo[yyn])
|
2019-12-05 16:16:12 +00:00
|
|
|
yyj := yyg + yyS[yyp].yys + 1
|
|
|
|
|
|
|
|
if yyj >= yyLast {
|
2024-04-13 10:59:54 +00:00
|
|
|
yystate = int(yyAct[yyg])
|
2019-12-05 16:16:12 +00:00
|
|
|
} else {
|
2024-04-13 10:59:54 +00:00
|
|
|
yystate = int(yyAct[yyj])
|
|
|
|
if int(yyChk[yystate]) != -yyn {
|
|
|
|
yystate = int(yyAct[yyg])
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// dummy call; replaced with literal code
|
|
|
|
switch yynt {
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).generatedParserResult = yyDollar[2].labels
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
case 3:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-05 16:16:12 +00:00
|
|
|
{
|
2023-09-14 16:57:31 +00:00
|
|
|
yylex.(*parser).addParseErrf(posrange.PositionRange{}, "no expression found in input")
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
case 4:
|
2019-12-16 16:38:18 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-18 14:18:52 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).generatedParserResult = yyDollar[2].node
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
case 5:
|
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).generatedParserResult = yyDollar[2].node
|
|
|
|
}
|
|
|
|
case 7:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
2019-12-05 16:16:12 +00:00
|
|
|
{
|
2019-12-18 17:36:43 +00:00
|
|
|
yylex.(*parser).unexpected("", "")
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-01-20 10:57:39 +00:00
|
|
|
case 20:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2019-12-05 16:16:12 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = yylex.(*parser).newAggregateExpr(yyDollar[1].item, yyDollar[2].node, yyDollar[3].node)
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-01-20 10:57:39 +00:00
|
|
|
case 21:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2019-12-05 16:16:12 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = yylex.(*parser).newAggregateExpr(yyDollar[1].item, yyDollar[3].node, yyDollar[2].node)
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-01-20 10:57:39 +00:00
|
|
|
case 22:
|
2019-12-05 16:16:12 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = yylex.(*parser).newAggregateExpr(yyDollar[1].item, &AggregateExpr{}, yyDollar[2].node)
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-01-20 10:57:39 +00:00
|
|
|
case 23:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-05 16:16:12 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("aggregation", "")
|
2020-03-05 08:03:38 +00:00
|
|
|
yyVAL.node = yylex.(*parser).newAggregateExpr(yyDollar[1].item, &AggregateExpr{}, Expressions{})
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-01-20 10:57:39 +00:00
|
|
|
case 24:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = &AggregateExpr{
|
|
|
|
Grouping: yyDollar[2].strings,
|
|
|
|
}
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2021-01-20 10:57:39 +00:00
|
|
|
case 25:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = &AggregateExpr{
|
|
|
|
Grouping: yyDollar[2].strings,
|
|
|
|
Without: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 26:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 27:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 28:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 29:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 30:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 31:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 32:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 33:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 34:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 35:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 36:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 37:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 38:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 39:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
2021-01-20 10:57:39 +00:00
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 40:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
2020-01-08 11:04:47 +00:00
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 41:
|
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
|
|
}
|
|
|
|
case 43:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = &BinaryExpr{
|
|
|
|
VectorMatching: &VectorMatching{Card: CardOneToOne},
|
|
|
|
}
|
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 44:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = &BinaryExpr{
|
|
|
|
VectorMatching: &VectorMatching{Card: CardOneToOne},
|
|
|
|
ReturnBool: true,
|
|
|
|
}
|
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 45:
|
2019-12-05 16:16:12 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.MatchingLabels = yyDollar[3].strings
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 46:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2019-12-05 16:16:12 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.MatchingLabels = yyDollar[3].strings
|
|
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.On = true
|
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 49:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.Card = CardManyToOne
|
|
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.Include = yyDollar[3].strings
|
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 50:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.Card = CardOneToMany
|
|
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.Include = yyDollar[3].strings
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 51:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.strings = yyDollar[2].strings
|
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 52:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.strings = yyDollar[2].strings
|
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 53:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.strings = []string{}
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 54:
|
2019-12-05 16:16:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("grouping opts", "\"(\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.strings = nil
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 55:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2019-12-05 16:16:12 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.strings = append(yyDollar[1].strings, yyDollar[3].item.Val)
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 56:
|
2019-12-16 16:38:18 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.strings = []string{yyDollar[1].item.Val}
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 57:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("grouping opts", "\",\" or \")\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.strings = yyDollar[1].strings
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 58:
|
2019-12-18 14:18:52 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2024-08-01 14:07:08 +00:00
|
|
|
if !model.LabelName(yyDollar[1].item.Val).IsValid() {
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("grouping opts", "label")
|
|
|
|
}
|
2019-12-18 14:18:52 +00:00
|
|
|
yyVAL.item = yyDollar[1].item
|
|
|
|
}
|
2021-08-24 23:22:14 +00:00
|
|
|
case 59:
|
2024-08-01 14:07:08 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
if !model.LabelName(yylex.(*parser).unquoteString(yyDollar[1].item.Val)).IsValid() {
|
|
|
|
yylex.(*parser).unexpected("grouping opts", "label")
|
|
|
|
}
|
|
|
|
yyVAL.item = yyDollar[1].item
|
|
|
|
yyVAL.item.Pos++
|
|
|
|
yyVAL.item.Val = yylex.(*parser).unquoteString(yyVAL.item.Val)
|
|
|
|
}
|
|
|
|
case 60:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("grouping opts", "label")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.item = Item{}
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 61:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2023-03-22 09:02:10 +00:00
|
|
|
fn, exist := getFunction(yyDollar[1].item.Val, yylex.(*parser).functions)
|
2020-01-08 11:04:47 +00:00
|
|
|
if !exist {
|
2020-01-17 15:16:58 +00:00
|
|
|
yylex.(*parser).addParseErrf(yyDollar[1].item.PositionRange(), "unknown function with name %q", yyDollar[1].item.Val)
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2023-11-07 22:37:37 +00:00
|
|
|
if fn != nil && fn.Experimental && !EnableExperimentalFunctions {
|
|
|
|
yylex.(*parser).addParseErrf(yyDollar[1].item.PositionRange(), "function %q is not enabled", yyDollar[1].item.Val)
|
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = &Call{
|
|
|
|
Func: fn,
|
|
|
|
Args: yyDollar[2].node.(Expressions),
|
2023-09-14 16:57:31 +00:00
|
|
|
PosRange: posrange.PositionRange{
|
2020-01-14 16:12:15 +00:00
|
|
|
Start: yyDollar[1].item.Pos,
|
|
|
|
End: yylex.(*parser).lastClosing,
|
|
|
|
},
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 62:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = yyDollar[2].node
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 63:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = Expressions{}
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 64:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.node = append(yyDollar[1].node.(Expressions), yyDollar[3].node.(Expr))
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 65:
|
2019-12-16 16:38:18 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = Expressions{yyDollar[1].node.(Expr)}
|
2019-12-16 16:38:18 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 66:
|
2020-01-16 15:20:20 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2020-01-17 15:16:58 +00:00
|
|
|
yylex.(*parser).addParseErrf(yyDollar[2].item.PositionRange(), "trailing commas not allowed in function call args")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 67:
|
2019-12-16 16:38:18 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
yyVAL.node = &ParenExpr{Expr: yyDollar[2].node.(Expr), PosRange: mergeRanges(&yyDollar[1].item, &yyDollar[3].item)}
|
2019-12-16 16:38:18 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 68:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2024-03-04 13:57:28 +00:00
|
|
|
numLit, _ := yyDollar[3].node.(*NumberLiteral)
|
|
|
|
dur := time.Duration(numLit.Val*1000) * time.Millisecond
|
|
|
|
yylex.(*parser).addOffset(yyDollar[1].node, dur)
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 69:
|
2021-02-17 01:49:00 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
2020-01-08 11:04:47 +00:00
|
|
|
{
|
2024-03-04 13:57:28 +00:00
|
|
|
numLit, _ := yyDollar[4].node.(*NumberLiteral)
|
|
|
|
dur := time.Duration(numLit.Val*1000) * time.Millisecond
|
|
|
|
yylex.(*parser).addOffset(yyDollar[1].node, -dur)
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 70:
|
2021-01-20 10:57:39 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2024-03-14 18:48:51 +00:00
|
|
|
yylex.(*parser).unexpected("offset", "number or duration")
|
2021-01-20 10:57:39 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 71:
|
2021-02-17 01:49:00 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2021-02-09 16:03:16 +00:00
|
|
|
{
|
2021-02-17 01:49:00 +00:00
|
|
|
yylex.(*parser).setTimestamp(yyDollar[1].node, yyDollar[3].float)
|
2021-02-09 16:03:16 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 72:
|
2021-02-17 01:49:00 +00:00
|
|
|
yyDollar = yyS[yypt-5 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).setAtModifierPreprocessor(yyDollar[1].node, yyDollar[3].item)
|
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 73:
|
2021-02-17 01:49:00 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2021-01-20 10:57:39 +00:00
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("@", "timestamp")
|
|
|
|
yyVAL.node = yyDollar[1].node
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 76:
|
2019-12-16 16:38:18 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
2020-01-15 20:01:49 +00:00
|
|
|
var errMsg string
|
2020-01-08 11:04:47 +00:00
|
|
|
vs, ok := yyDollar[1].node.(*VectorSelector)
|
|
|
|
if !ok {
|
2020-01-15 20:01:49 +00:00
|
|
|
errMsg = "ranges only allowed for vector selectors"
|
2021-01-20 10:57:39 +00:00
|
|
|
} else if vs.OriginalOffset != 0 {
|
2020-01-15 20:01:49 +00:00
|
|
|
errMsg = "no offset modifiers allowed before range"
|
2021-01-20 10:57:39 +00:00
|
|
|
} else if vs.Timestamp != nil {
|
|
|
|
errMsg = "no @ modifiers allowed before range"
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2020-01-15 20:01:49 +00:00
|
|
|
|
|
|
|
if errMsg != "" {
|
|
|
|
errRange := mergeRanges(&yyDollar[2].item, &yyDollar[4].item)
|
2020-01-17 15:16:58 +00:00
|
|
|
yylex.(*parser).addParseErrf(errRange, errMsg)
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2020-01-15 20:01:49 +00:00
|
|
|
|
2024-03-04 13:57:28 +00:00
|
|
|
numLit, _ := yyDollar[3].node.(*NumberLiteral)
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = &MatrixSelector{
|
2020-01-17 15:16:58 +00:00
|
|
|
VectorSelector: yyDollar[1].node.(Expr),
|
2024-03-04 13:57:28 +00:00
|
|
|
Range: time.Duration(numLit.Val*1000) * time.Millisecond,
|
2020-01-14 16:12:15 +00:00
|
|
|
EndPos: yylex.(*parser).lastClosing,
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2019-12-16 16:38:18 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 77:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-6 : yypt+1]
|
|
|
|
{
|
2024-03-04 13:57:28 +00:00
|
|
|
numLitRange, _ := yyDollar[3].node.(*NumberLiteral)
|
|
|
|
numLitStep, _ := yyDollar[5].node.(*NumberLiteral)
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = &SubqueryExpr{
|
2024-03-04 13:57:28 +00:00
|
|
|
Expr: yyDollar[1].node.(Expr),
|
|
|
|
Range: time.Duration(numLitRange.Val*1000) * time.Millisecond,
|
|
|
|
Step: time.Duration(numLitStep.Val*1000) * time.Millisecond,
|
2020-01-14 16:12:15 +00:00
|
|
|
EndPos: yyDollar[6].item.Pos + 1,
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 78:
|
2024-03-04 13:57:28 +00:00
|
|
|
yyDollar = yyS[yypt-5 : yypt+1]
|
|
|
|
{
|
|
|
|
numLitRange, _ := yyDollar[3].node.(*NumberLiteral)
|
|
|
|
yyVAL.node = &SubqueryExpr{
|
|
|
|
Expr: yyDollar[1].node.(Expr),
|
|
|
|
Range: time.Duration(numLitRange.Val*1000) * time.Millisecond,
|
|
|
|
Step: 0,
|
|
|
|
EndPos: yyDollar[5].item.Pos + 1,
|
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 79:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-6 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("subquery selector", "\"]\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 80:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-5 : yypt+1]
|
|
|
|
{
|
2024-03-14 18:48:51 +00:00
|
|
|
yylex.(*parser).unexpected("subquery selector", "number or duration or \"]\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 81:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("subquery or range", "\":\" or \"]\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 82:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2024-03-14 18:48:51 +00:00
|
|
|
yylex.(*parser).unexpected("subquery selector", "number or duration")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.node = yyDollar[1].node
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 83:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-16 16:38:18 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
if nl, ok := yyDollar[2].node.(*NumberLiteral); ok {
|
|
|
|
if yyDollar[1].item.Typ == SUB {
|
|
|
|
nl.Val *= -1
|
|
|
|
}
|
2020-01-14 16:12:15 +00:00
|
|
|
nl.PosRange.Start = yyDollar[1].item.Pos
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.node = nl
|
|
|
|
} else {
|
2020-01-14 16:12:15 +00:00
|
|
|
yyVAL.node = &UnaryExpr{Op: yyDollar[1].item.Typ, Expr: yyDollar[2].node.(Expr), StartPos: yyDollar[1].item.Pos}
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2019-12-16 16:38:18 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 84:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-16 16:38:18 +00:00
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
vs := yyDollar[2].node.(*VectorSelector)
|
|
|
|
vs.PosRange = mergeRanges(&yyDollar[1].item, vs)
|
|
|
|
vs.Name = yyDollar[1].item.Val
|
|
|
|
yylex.(*parser).assembleVectorSelector(vs)
|
|
|
|
yyVAL.node = vs
|
2019-12-16 16:38:18 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 85:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
vs := &VectorSelector{
|
|
|
|
Name: yyDollar[1].item.Val,
|
|
|
|
LabelMatchers: []*labels.Matcher{},
|
|
|
|
PosRange: yyDollar[1].item.PositionRange(),
|
|
|
|
}
|
|
|
|
yylex.(*parser).assembleVectorSelector(vs)
|
|
|
|
yyVAL.node = vs
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 86:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
vs := yyDollar[1].node.(*VectorSelector)
|
|
|
|
yylex.(*parser).assembleVectorSelector(vs)
|
|
|
|
yyVAL.node = vs
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 87:
|
2019-12-16 16:38:18 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
yyVAL.node = &VectorSelector{
|
|
|
|
LabelMatchers: yyDollar[2].matchers,
|
|
|
|
PosRange: mergeRanges(&yyDollar[1].item, &yyDollar[3].item),
|
|
|
|
}
|
2019-12-16 16:38:18 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 88:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
yyVAL.node = &VectorSelector{
|
|
|
|
LabelMatchers: yyDollar[2].matchers,
|
|
|
|
PosRange: mergeRanges(&yyDollar[1].item, &yyDollar[4].item),
|
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 89:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
yyVAL.node = &VectorSelector{
|
|
|
|
LabelMatchers: []*labels.Matcher{},
|
|
|
|
PosRange: mergeRanges(&yyDollar[1].item, &yyDollar[2].item),
|
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 90:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2020-01-16 15:20:20 +00:00
|
|
|
if yyDollar[1].matchers != nil {
|
|
|
|
yyVAL.matchers = append(yyDollar[1].matchers, yyDollar[3].matcher)
|
|
|
|
} else {
|
|
|
|
yyVAL.matchers = yyDollar[1].matchers
|
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 91:
|
2019-12-16 16:38:18 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.matchers = []*labels.Matcher{yyDollar[1].matcher}
|
2019-12-16 16:38:18 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 92:
|
2019-12-16 16:38:18 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("label matching", "\",\" or \"}\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.matchers = yyDollar[1].matchers
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 93:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.matcher = yylex.(*parser).newLabelMatcher(yyDollar[1].item, yyDollar[2].item, yyDollar[3].item)
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 94:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2024-02-15 19:25:12 +00:00
|
|
|
{
|
|
|
|
yyVAL.matcher = yylex.(*parser).newLabelMatcher(yyDollar[1].item, yyDollar[2].item, yyDollar[3].item)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 95:
|
2024-02-15 19:25:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.matcher = yylex.(*parser).newMetricNameMatcher(yyDollar[1].item)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 96:
|
2024-02-15 19:25:12 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2019-12-16 13:58:47 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("label matching", "string")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.matcher = nil
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 97:
|
2024-02-15 19:25:12 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("label matching", "string")
|
|
|
|
yyVAL.matcher = nil
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 98:
|
2019-12-16 13:58:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("label matching", "label matching operator")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.matcher = nil
|
2019-12-16 13:58:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 99:
|
2019-12-05 16:16:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("label matching", "identifier or \"}\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.matcher = nil
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 100:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2022-03-09 22:14:58 +00:00
|
|
|
b := labels.NewBuilder(yyDollar[2].labels)
|
|
|
|
b.Set(labels.MetricName, yyDollar[1].item.Val)
|
2023-03-22 15:46:02 +00:00
|
|
|
yyVAL.labels = b.Labels()
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 101:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.labels = yyDollar[1].labels
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 126:
|
2019-12-18 14:18:52 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2022-03-09 22:14:58 +00:00
|
|
|
yyVAL.labels = labels.New(yyDollar[2].lblList...)
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 127:
|
2019-12-20 11:28:56 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
2019-12-18 14:18:52 +00:00
|
|
|
{
|
2022-03-09 22:14:58 +00:00
|
|
|
yyVAL.labels = labels.New(yyDollar[2].lblList...)
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 128:
|
2019-12-20 11:28:56 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
2019-12-18 14:18:52 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.labels = labels.New()
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 129:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
2019-12-20 11:28:56 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.labels = labels.New()
|
2019-12-20 11:28:56 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 130:
|
2019-12-18 14:18:52 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2022-03-09 22:14:58 +00:00
|
|
|
yyVAL.lblList = append(yyDollar[1].lblList, yyDollar[3].label)
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 131:
|
2019-12-18 14:18:52 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2022-03-09 22:14:58 +00:00
|
|
|
yyVAL.lblList = []labels.Label{yyDollar[1].label}
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 132:
|
2019-12-18 14:18:52 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("label set", "\",\" or \"}\"")
|
2022-03-09 22:14:58 +00:00
|
|
|
yyVAL.lblList = yyDollar[1].lblList
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 133:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
2019-12-18 14:18:52 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.label = labels.Label{Name: yyDollar[1].item.Val, Value: yylex.(*parser).unquoteString(yyDollar[3].item.Val)}
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 134:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("label set", "string")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.label = labels.Label{}
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 135:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("label set", "\"=\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.label = labels.Label{}
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 136:
|
2019-12-18 14:18:52 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
yylex.(*parser).unexpected("label set", "identifier or \"}\"")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.label = labels.Label{}
|
2019-12-18 14:18:52 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 137:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).generatedParserResult = &seriesDescription{
|
|
|
|
labels: yyDollar[1].labels,
|
|
|
|
values: yyDollar[2].series,
|
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 138:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
|
|
|
{
|
2020-02-03 16:45:41 +00:00
|
|
|
yyVAL.series = []SequenceValue{}
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 139:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.series = append(yyDollar[1].series, yyDollar[3].series...)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 140:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.series = yyDollar[1].series
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 141:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("series values", "")
|
2020-01-16 15:20:20 +00:00
|
|
|
yyVAL.series = nil
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 142:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-02-03 17:48:27 +00:00
|
|
|
yyVAL.series = []SequenceValue{{Omitted: true}}
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 143:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2020-02-03 16:45:41 +00:00
|
|
|
yyVAL.series = []SequenceValue{}
|
2019-12-21 08:44:12 +00:00
|
|
|
for i := uint64(0); i < yyDollar[3].uint; i++ {
|
2020-02-03 17:48:27 +00:00
|
|
|
yyVAL.series = append(yyVAL.series, SequenceValue{Omitted: true})
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 144:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-02-03 17:48:27 +00:00
|
|
|
yyVAL.series = []SequenceValue{{Value: yyDollar[1].float}}
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 145:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
2020-02-03 16:45:41 +00:00
|
|
|
yyVAL.series = []SequenceValue{}
|
2023-08-25 21:35:42 +00:00
|
|
|
// Add an additional value for time 0, which we ignore in tests.
|
2019-12-21 08:44:12 +00:00
|
|
|
for i := uint64(0); i <= yyDollar[3].uint; i++ {
|
2020-02-03 17:48:27 +00:00
|
|
|
yyVAL.series = append(yyVAL.series, SequenceValue{Value: yyDollar[1].float})
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 146:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
2020-02-03 16:45:41 +00:00
|
|
|
yyVAL.series = []SequenceValue{}
|
2023-08-25 21:35:42 +00:00
|
|
|
// Add an additional value for time 0, which we ignore in tests.
|
2019-12-21 08:44:12 +00:00
|
|
|
for i := uint64(0); i <= yyDollar[4].uint; i++ {
|
2020-02-03 17:48:27 +00:00
|
|
|
yyVAL.series = append(yyVAL.series, SequenceValue{Value: yyDollar[1].float})
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar[1].float += yyDollar[2].float
|
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 147:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
2023-08-25 21:35:42 +00:00
|
|
|
{
|
|
|
|
yyVAL.series = []SequenceValue{{Histogram: yyDollar[1].histogram}}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 148:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.series = []SequenceValue{}
|
|
|
|
// Add an additional value for time 0, which we ignore in tests.
|
|
|
|
for i := uint64(0); i <= yyDollar[3].uint; i++ {
|
|
|
|
yyVAL.series = append(yyVAL.series, SequenceValue{Histogram: yyDollar[1].histogram})
|
|
|
|
//$1 += $2
|
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 149:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-5 : yypt+1]
|
|
|
|
{
|
|
|
|
val, err := yylex.(*parser).histogramsIncreaseSeries(yyDollar[1].histogram, yyDollar[3].histogram, yyDollar[5].uint)
|
|
|
|
if err != nil {
|
|
|
|
yylex.(*parser).addSemanticError(err)
|
|
|
|
}
|
|
|
|
yyVAL.series = val
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 150:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-5 : yypt+1]
|
|
|
|
{
|
|
|
|
val, err := yylex.(*parser).histogramsDecreaseSeries(yyDollar[1].histogram, yyDollar[3].histogram, yyDollar[5].uint)
|
|
|
|
if err != nil {
|
|
|
|
yylex.(*parser).addSemanticError(err)
|
|
|
|
}
|
|
|
|
yyVAL.series = val
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 151:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
2019-12-21 08:44:12 +00:00
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
if yyDollar[1].item.Val != "stale" {
|
|
|
|
yylex.(*parser).unexpected("series values", "number or \"stale\"")
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
yyVAL.float = math.Float64frombits(value.StaleNaN)
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 154:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.histogram = yylex.(*parser).buildHistogramFromMap(&yyDollar[2].descriptors)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 155:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.histogram = yylex.(*parser).buildHistogramFromMap(&yyDollar[2].descriptors)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 156:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
m := yylex.(*parser).newMap()
|
|
|
|
yyVAL.histogram = yylex.(*parser).buildHistogramFromMap(&m)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 157:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
m := yylex.(*parser).newMap()
|
|
|
|
yyVAL.histogram = yylex.(*parser).buildHistogramFromMap(&m)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 158:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = *(yylex.(*parser).mergeMaps(&yyDollar[1].descriptors, &yyDollar[3].descriptors))
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 159:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
2023-08-25 21:35:42 +00:00
|
|
|
{
|
|
|
|
yyVAL.descriptors = yyDollar[1].descriptors
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 160:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yylex.(*parser).unexpected("histogram description", "histogram description key, e.g. buckets:[5 10 7]")
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 161:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
|
|
|
yyVAL.descriptors["schema"] = yyDollar[3].int
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 162:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
|
|
|
yyVAL.descriptors["sum"] = yyDollar[3].float
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 163:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
|
|
|
yyVAL.descriptors["count"] = yyDollar[3].float
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 164:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
|
|
|
yyVAL.descriptors["z_bucket"] = yyDollar[3].float
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 165:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
|
|
|
yyVAL.descriptors["z_bucket_w"] = yyDollar[3].float
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 166:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
2024-05-08 11:58:24 +00:00
|
|
|
yyVAL.descriptors["custom_values"] = yyDollar[3].bucket_set
|
2023-08-25 21:35:42 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 167:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
2024-05-08 11:58:24 +00:00
|
|
|
yyVAL.descriptors["buckets"] = yyDollar[3].bucket_set
|
2023-08-25 21:35:42 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 168:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
2024-05-08 11:58:24 +00:00
|
|
|
yyVAL.descriptors["offset"] = yyDollar[3].int
|
2023-08-25 21:35:42 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 169:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
2024-05-08 11:58:24 +00:00
|
|
|
yyVAL.descriptors["n_buckets"] = yyDollar[3].bucket_set
|
2023-08-25 21:35:42 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 170:
|
2024-05-08 11:58:24 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
|
|
|
yyVAL.descriptors["n_offset"] = yyDollar[3].int
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 171:
|
2024-07-31 07:53:05 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.descriptors = yylex.(*parser).newMap()
|
|
|
|
yyVAL.descriptors["counter_reset_hint"] = yyDollar[3].item
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 172:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.bucket_set = yyDollar[2].bucket_set
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 173:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.bucket_set = yyDollar[2].bucket_set
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 174:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.bucket_set = append(yyDollar[1].bucket_set, yyDollar[3].float)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 175:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.bucket_set = []float64{yyDollar[1].float}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 230:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
2020-01-08 11:04:47 +00:00
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
yyVAL.node = &NumberLiteral{
|
|
|
|
Val: yylex.(*parser).number(yyDollar[1].item.Val),
|
|
|
|
PosRange: yyDollar[1].item.PositionRange(),
|
|
|
|
}
|
2020-01-08 11:04:47 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 231:
|
2024-03-04 13:57:28 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
var err error
|
|
|
|
var dur time.Duration
|
|
|
|
dur, err = parseDuration(yyDollar[1].item.Val)
|
|
|
|
if err != nil {
|
|
|
|
yylex.(*parser).addParseErr(yyDollar[1].item.PositionRange(), err)
|
|
|
|
}
|
|
|
|
yyVAL.node = &NumberLiteral{
|
|
|
|
Val: dur.Seconds(),
|
|
|
|
PosRange: yyDollar[1].item.PositionRange(),
|
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 232:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.float = yylex.(*parser).number(yyDollar[1].item.Val)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 233:
|
2024-03-14 18:48:51 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
var err error
|
|
|
|
var dur time.Duration
|
|
|
|
dur, err = parseDuration(yyDollar[1].item.Val)
|
|
|
|
if err != nil {
|
|
|
|
yylex.(*parser).addParseErr(yyDollar[1].item.PositionRange(), err)
|
|
|
|
}
|
|
|
|
yyVAL.float = dur.Seconds()
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 234:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.float = yyDollar[2].float
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 235:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.float = -yyDollar[2].float
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 238:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-08 11:04:47 +00:00
|
|
|
var err error
|
|
|
|
yyVAL.uint, err = strconv.ParseUint(yyDollar[1].item.Val, 10, 64)
|
|
|
|
if err != nil {
|
2020-01-17 15:16:58 +00:00
|
|
|
yylex.(*parser).addParseErrf(yyDollar[1].item.PositionRange(), "invalid repetition in series values: %s", err)
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 239:
|
2023-08-25 21:35:42 +00:00
|
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.int = -int64(yyDollar[2].uint)
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 240:
|
2024-01-30 07:37:49 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2024-03-04 13:57:28 +00:00
|
|
|
yyVAL.int = int64(yyDollar[1].uint)
|
2024-01-30 07:37:49 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 241:
|
2019-12-21 08:44:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
2020-01-14 16:12:15 +00:00
|
|
|
yyVAL.node = &StringLiteral{
|
|
|
|
Val: yylex.(*parser).unquoteString(yyDollar[1].item.Val),
|
|
|
|
PosRange: yyDollar[1].item.PositionRange(),
|
|
|
|
}
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 242:
|
2024-02-15 19:25:12 +00:00
|
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.item = Item{
|
|
|
|
Typ: METRIC_IDENTIFIER,
|
|
|
|
Pos: yyDollar[1].item.PositionRange().Start,
|
|
|
|
Val: yylex.(*parser).unquoteString(yyDollar[1].item.Val),
|
|
|
|
}
|
|
|
|
}
|
2024-08-01 14:07:08 +00:00
|
|
|
case 243:
|
2020-01-08 11:04:47 +00:00
|
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
|
|
|
{
|
|
|
|
yyVAL.strings = nil
|
2019-12-21 08:44:12 +00:00
|
|
|
}
|
2019-12-05 16:16:12 +00:00
|
|
|
}
|
|
|
|
goto yystack /* stack new state and value */
|
|
|
|
}
|