zaqar/zaqar/bench/config.py
Nataliia Uvarova 3eef684d05 Improve benchmarking tool
This commit adds several enhancements to benchmarking tool: server_url
and path to messages now can be configured in config file.  Default
output of program has been changed: now it prints values in json so they
can be parsed more easily. Previous human readable representation is
accessible via --verbose flag.

The `total_requests` metric now shows all performed requests (either
failed or successful) and new metric - `successful_requests` - was
introduced to store count of successful requests.

Change-Id: Id6fe4b2046394a348ba07eb5b2b003c6024b78b0
Partially-implements: blueprint gen-bench-reports
2014-08-19 10:57:13 +03:00

37 lines
1.2 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
import psutil
conf = cfg.CONF
_CLI_OPTIONS = (
cfg.IntOpt(
'processes',
short='p',
default=psutil.NUM_CPUS,
help='Number of Processes'),
cfg.IntOpt(
'workers',
short='w',
default=psutil.NUM_CPUS * 2,
help='Number of Workers'),
cfg.IntOpt('time', short='t', default=3, help="time in seconds"),
cfg.StrOpt('server_url', short='s', default='http://localhost:8888'),
cfg.StrOpt('queue_prefix', short='q', default='ogre-test-queue-'),
cfg.StrOpt('messages_path', short='m')
)
conf.register_cli_opts(_CLI_OPTIONS)
conf(project='zaqar', prog='zaqar-benchmark')