Comment 6 for bug 1810563

Revision history for this message
Doug Wiegley (dougwig) wrote :

There's also a get/index regression, when you limit the fields returned. Remove the security group delete from the script above, run it a few times, then run this script to see it. Patch updated to fix both, since they're related:

#!/bin/bash

OPENSTACK_TOKEN=$(openstack token issue | grep '| id' | awk '{print $4}')
export OPENSTACK_TOKEN

CCN1=10.210.162.2
CCN3=10.210.162.10
export ENDPOINT=localhost

hit_api() {
    json="$1"

    echo "hitting api"

    echo "all"
    start=$(perl -e "print time();")
    time curl -s -H "X-Auth-Token: $OPENSTACK_TOKEN" "http://$ENDPOINT:9696/v2.0/security-groups" #> /dev/null
    end=$(perl -e "print time();")
    echo $((end-start))

    echo "ids"
    start=$(perl -e "print time();")
    time curl -s -H "X-Auth-Token: $OPENSTACK_TOKEN" "http://$ENDPOINT:9696/v2.0/security-groups?fields=id" > /dev/null
    end=$(perl -e "print time();")
    echo $((end-start))

    echo "one"
    start=$(perl -e "print time();")
    time curl -s -H "X-Auth-Token: $OPENSTACK_TOKEN" "http://$ENDPOINT:9696/v2.0/security-groups?limit=1" > /dev/null
    end=$(perl -e "print time();")
    echo $((end-start))

    echo "one id"
    start=$(perl -e "print time();")
    time curl -s -H "X-Auth-Token: $OPENSTACK_TOKEN" "http://$ENDPOINT:9696/v2.0/security-groups?fields=id&limit=1" #> /dev/null
    end=$(perl -e "print time();")
    echo $((end-start))
}

tmp=/tmp/sg-test.$$.tmp
hit_api $tmp