Bump default pagesize

Bumping default pagesize to 200. With the previous
default value of 20 glanceclient was doing lots of
extra requests and schema validations.

Based on my tests no performance improvement was
seen over the pagesize of 200.

Change-Id: I6d740ca3a9b32bf5d064d3ea74273bb619b32ad4
Closes-Bug: #1987834
This commit is contained in:
Erno Kuvaja 2022-08-26 12:46:20 +01:00
parent 75218d289e
commit 219568c2a4
3 changed files with 3 additions and 3 deletions

View File

@ -711,7 +711,7 @@ class ShellTestWithNoOSImageURLPublic(ShellTestWithKeystoneV3Auth):
glance_shell = openstack_shell.OpenStackImagesShell() glance_shell = openstack_shell.OpenStackImagesShell()
glance_shell.main(args.split()) glance_shell.main(args.split())
self.assertEqual(self.requests.request_history[2].url, self.assertEqual(self.requests.request_history[2].url,
self.image_url + "v2/images?limit=20&" self.image_url + "v2/images?limit=200&"
"sort_key=name&sort_dir=asc") "sort_key=name&sort_dir=asc")

View File

@ -35,7 +35,7 @@ class ClientTestRequests(testutils.TestCase):
self.requests = self.useFixture(rm_fixture.Fixture()) self.requests = self.useFixture(rm_fixture.Fixture())
self.requests.get('http://example.com/v2/schemas/image', self.requests.get('http://example.com/v2/schemas/image',
json=schema_fixture) json=schema_fixture)
self.requests.get('http://example.com/v2/images?limit=20', self.requests.get('http://example.com/v2/images?limit=200',
json=image_list_fixture) json=image_list_fixture)
gc = client.Client(2.2, "http://example.com/v2.1") gc = client.Client(2.2, "http://example.com/v2.1")
images = gc.images.list() images = gc.images.list()

View File

@ -24,7 +24,7 @@ from glanceclient.common import utils
from glanceclient import exc from glanceclient import exc
from glanceclient.v2 import schemas from glanceclient.v2 import schemas
DEFAULT_PAGE_SIZE = 20 DEFAULT_PAGE_SIZE = 200
SORT_DIR_VALUES = ('asc', 'desc') SORT_DIR_VALUES = ('asc', 'desc')
SORT_KEY_VALUES = ('name', 'status', 'container_format', 'disk_format', SORT_KEY_VALUES = ('name', 'status', 'container_format', 'disk_format',