Skip to content

Commit

Permalink
Use integer values for CPU requests in prom-rules-tests (#2308)
Browse files Browse the repository at this point in the history
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Co-authored-by: João Vilaça <jvilaca@redhat.com>
  • Loading branch information
kubevirt-bot and machadovilaca authored Apr 6, 2023
1 parent 8201dbb commit 0be94a1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions hack/prom-rule-ci/prom-rules-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,12 @@ tests:
input_series:
# take all containers of running virt-launcher pods
- series: 'kube_pod_container_resource_requests{pod="virt-launcher-x-y", resource="cpu", container="compute"}'
# time: 0 1 2 3 4 5
values: "0.1 0.1 0.1 0.1 0.1 0.1"
# time: 0 1 2 3 4 5
values: "1 1 1 1 1 1"
# take all containers of running virt-launcher pods
- series: 'kube_pod_container_resource_requests{pod="virt-launcher-x-y", resource="cpu", container="volumecontainerdisk"}'
# time: 0 1 2 3 4 5
values: "0.01 0.01 0.01 0.01 0.01 0.01"
# time: 0 1 2 3 4 5
values: "1 1 1 1 1 1"
- series: 'kube_pod_labels{label_kubevirt_io="virt-launcher",pod="virt-launcher-x-y"}'
# time: 0 1 2 3 4 5
values: "1 1 1 1 1 1"
Expand All @@ -549,8 +549,8 @@ tests:
values: "1 1 1 1 1 1"
# new VMIs can be created in time
- series: 'kube_pod_container_resource_requests{pod="virt-launcher-new", resource="cpu", container="volumecontainerdisk"}'
# time: 0 1 2 3 4 5
values: "stale stale stale 0.01 0.01 0.01"
# time: 0 1 2 3 4 5
values: "stale stale stale 1 1 1"
- series: 'kube_pod_labels{label_kubevirt_io="virt-launcher",pod="virt-launcher-new"}'
# time: 0 1 2 3 4 5
values: "stale stale stale 1 1 1"
Expand All @@ -562,25 +562,25 @@ tests:
eval_time: 1m
exp_samples:
- labels: 'cluster:vmi_request_cpu_cores:sum{}'
value: 0.11
value: 2
# update for new pods
- expr: 'cluster:vmi_request_cpu_cores:sum'
eval_time: 3m
exp_samples:
- labels: 'cluster:vmi_request_cpu_cores:sum{}'
value: 0.12
value: 3
# virt-launcher-new is not running at 4m. must exclude it
- expr: 'cluster:vmi_request_cpu_cores:sum'
eval_time: 4m
exp_samples:
- labels: 'cluster:vmi_request_cpu_cores:sum{}'
value: 0.11
value: 2
# virt-launcher-new is back at 5m. must include it
- expr: 'cluster:vmi_request_cpu_cores:sum'
eval_time: 5m
exp_samples:
- labels: 'cluster:vmi_request_cpu_cores:sum{}'
value: 0.12
value: 3

# Test kubevirt_hyperconverged_operator_health_status recording rule
- interval: 1m
Expand Down

0 comments on commit 0be94a1

Please sign in to comment.