Skip to content

Commit 04799bc

Browse files
vyzigoldjlarriba
authored andcommitted
Add tasks to show queried metrics
1 parent 309850f commit 04799bc

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

roles/telemetry_autoscaling/tasks/test_autoscaling.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,30 @@
5959
register: busy_process
6060
with_items: "{{ vnf_instance_ip.stdout_lines }}"
6161

62+
- name: Show ceilometer_cpu metrics from Prometheus
63+
when: metrics_backend == "prometheus"
64+
block:
65+
- name: Register autoscaling query results
66+
shell: |
67+
export STACK_ID=$({{ openstack_cmd }} stack show {{ stack_name }} -c id -f value)
68+
{{ openstack_cmd }} metric query '(rate(ceilometer_cpu{server_group=~"$STACK_ID"}[150s]))/10000000'
69+
ignore_errors: true
70+
register: result
71+
72+
- name: Show the query result
73+
ansible.builtin.debug:
74+
var: result
75+
76+
- name: Register ceilometer_cpu metrics
77+
shell: |
78+
{{ openstack_cmd }} metric show ceilometer_cpu --disable-rbac
79+
ignore_errors: true
80+
register: result
81+
82+
- name: Show the ceilometer_cpu metrics
83+
ansible.builtin.debug:
84+
var: result
85+
6286
- name: |
6387
TEST Verify cpu high alarm has been triggered
6488
RHOSO-12660

0 commit comments

Comments
 (0)