1b8334b35a
Currently zaqar-bench can't benchmark Zaqar while Zaqar is using keystone authentication backend. This patch makes it possible by using os_client_config library. The library gets authentication parameters from "clouds.yaml". If keystone authentication environment variables present, they override values from "clouds.yaml". The aquired parameters then passed to constructors of each python-zaqarclient's Client object used in zaqar-bench. The patch also makes benchmark queue names reusable across all zaqar-bench parts and by this fixes the old DRY princible bug. To use zaqar-bench with keystone authentication the user must explicitly set OS_AUTH_STRATEGY=keystone as environment variable before running the tool. Otherwise the default 'noauth' auth strategy will be used. This allows the user to run zaqar-bench as usual. This patch also adds option "--api-version" with it's short version "api" to zaqar-bench which defaults to Zaqar API v2. Change-Id: I0a7aaeaeac6da1b2c9f08fbfdddd467de5747a28 Closes-Bug: 1523752
77 lines
2.4 KiB
Python
77 lines
2.4 KiB
Python
# Copyright (c) 2014 Rackspace, Inc.
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
from oslo_config import cfg
|
|
|
|
conf = cfg.CONF
|
|
_CLI_OPTIONS = (
|
|
cfg.IntOpt(
|
|
'producer_processes',
|
|
short='pp',
|
|
default=1,
|
|
help='Number of Producer Processes'),
|
|
cfg.IntOpt(
|
|
'producer_workers',
|
|
short='pw',
|
|
default=10,
|
|
help='Number of Producer Workers'),
|
|
|
|
cfg.IntOpt(
|
|
'consumer_processes',
|
|
short='cp',
|
|
default=1,
|
|
help='Number of Consumer Processes'),
|
|
cfg.IntOpt(
|
|
'consumer_workers',
|
|
short='cw',
|
|
default=0,
|
|
help='Number of Consumer Workers'),
|
|
|
|
cfg.IntOpt(
|
|
'observer_processes',
|
|
short='op',
|
|
default=1,
|
|
help='Number of Observer Processes'),
|
|
cfg.IntOpt(
|
|
'observer_workers',
|
|
short='ow',
|
|
default=5,
|
|
help='Number of Observer Workers'),
|
|
|
|
cfg.FloatOpt('api_version', short='api', default='2',
|
|
help='Zaqar API version to use'),
|
|
|
|
cfg.IntOpt('messages_per_claim', short='cno', default=5,
|
|
help=('Number of messages the consumer will attempt to '
|
|
'claim at a time')),
|
|
cfg.IntOpt('messages_per_list', short='lno', default=5,
|
|
help=('Number of messages the observer will attempt to '
|
|
'list at a time')),
|
|
|
|
cfg.IntOpt('time', short='t', default=5,
|
|
help="Duration of the performance test, in seconds"),
|
|
|
|
cfg.StrOpt('server_url', short='s', default='http://localhost:8888'),
|
|
|
|
cfg.StrOpt('queue_prefix', short='q', default='ogre-test-queue'),
|
|
cfg.IntOpt('num_queues', short='qno', default=4),
|
|
|
|
cfg.StrOpt('messages_path', short='m'),
|
|
|
|
cfg.BoolOpt('skip_queue_reset', default=False,
|
|
help=('Do not reset queues before running'
|
|
'the performance test')),
|
|
)
|
|
conf.register_cli_opts(_CLI_OPTIONS)
|