mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
dc28196237
1. split package rule under /app/vmalert, expose needed objects 2. add vmalert-tool with unittest subcmd https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2945
30 lines
881 B
YAML
30 lines
881 B
YAML
# can be executed successfully but will take more than 1 minute
|
|
# not included in unit test now
|
|
evaluation_interval: 100d
|
|
|
|
rule_files:
|
|
- rules.yaml
|
|
|
|
tests:
|
|
- interval: 1d
|
|
input_series:
|
|
- series: test
|
|
# Max time in time.Duration is 106751d from 1970 (2^63/10^9), i.e. 2262.
|
|
# But VictoriaMetrics supports maxTimestamp value +2 days from now. see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/827.
|
|
# We input series to 2024-01-01T00:00:00 here.
|
|
values: "0+1x19723"
|
|
|
|
metricsql_expr_test:
|
|
- expr: timestamp(test)
|
|
eval_time: 0m
|
|
exp_samples:
|
|
- value: 0
|
|
- expr: test
|
|
eval_time: 100d
|
|
exp_samples:
|
|
- labels: test
|
|
value: 100
|
|
- expr: timestamp(test)
|
|
eval_time: 19000d
|
|
exp_samples:
|
|
- value: 1641600000 # 19000d -> seconds.
|