diff options
author | Chris Dent <cdent@anticdent.org> | 2018-08-13 13:11:14 +0100 |
---|---|---|
committer | Chris Dent <cdent@anticdent.org> | 2018-08-14 15:42:08 +0100 |
commit | 8b4fcdfdc6c59e024e7639e0d2da6ccbea5c73d3 (patch) | |
tree | ec29f6980dc4fdddafa49a5339108243773f0beb /gate | |
parent | afe4512bf66c89a061b1a7ccd3e7ac8e3b1b284d (diff) | |
download | nova-8b4fcdfdc6c59e024e7639e0d2da6ccbea5c73d3.tar.gz |
Add placement perf info gathering hook to end of nova-next
This change adds a post test hook to the nova-next job to report
timing of a query to GET /allocation_candidates when there are 1000
resource providers with the same inventory.
A summary of the work ends up in logs/placement-perf.txt
Change-Id: Idc446347cd8773f579b23c96235348d8e10ea3f6
Diffstat (limited to 'gate')
-rwxr-xr-x | gate/post_test_perf_check.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/gate/post_test_perf_check.sh b/gate/post_test_perf_check.sh new file mode 100755 index 0000000000..0b6a34c291 --- /dev/null +++ b/gate/post_test_perf_check.sh @@ -0,0 +1,57 @@ +#!/bin/bash -x + +# Do some performance related information gathering for placement. + +# This aggregate uuid is a static value in placeload. +AGGREGATE="14a5c8a3-5a99-4e8f-88be-00d85fcb1c17" +PLACEMENT_QUERY="resources=VCPU:1,DISK_GB:10,MEMORY_MB:256&member_of=${AGGREGATE}" + +BASE=${BASE:-/opt/stack} +source ${BASE}/new/devstack/functions +source ${BASE}/new/devstack/lib/nova +source ${BASE}/new/devstack/lib/placement +# Putting the log here ought to mean it is automatically gathered by zuul +LOG=${BASE}/logs/placement-perf.txt +COUNT=1000 + +function check_placement { + local placement_url + local rp_count + + python -m virtualenv -p python3 .placeload + . .placeload/bin/activate + + # install placeload + pip install placeload + + # Turn off keystone auth + iniset -sudo $NOVA_CONF DEFAULT auth_strategy noauth2 + restart_service devstack@placement-api + + # get placement endpoint + placement_url=$(get_endpoint_url placement public) + + # load with placeload + placeload $placement_url $COUNT | tee -a $LOG + rp_count=$(curl -H 'x-auth-token: admin' $placement_url/resource_providers |json_pp|grep -c '"name"') + # Skip curl and note if we failed to create the required number of rps + if [[ $rp_count -ge $COUNT ]]; then + ( + echo '##### TIMING GET /allocation_candidates' + time curl -s -H 'x-auth-token: admin' -H 'openstack-api-version: placement 1.21' "$placement_url/allocation_candidates?${PLACEMENT_QUERY}" > /dev/null + time curl -s -H 'x-auth-token: admin' -H 'openstack-api-version: placement 1.21' "$placement_url/allocation_candidates?${PLACEMENT_QUERY}" > /dev/null + ) 2>&1 | tee -a $LOG + else + ( + echo "Unable to create expected number of resource providers. Expected: ${COUNT}, Got: $rp_count" + echo "See job-output.txt.gz and logs/screen-placement-api.txt.gz for additional detail." + ) | tee -a $LOG + fi + deactivate +} + +# Be admin +set +x +source $BASE/new/devstack/openrc admin +set -x +check_placement |