diff options
author | Yulia Portnova <yportnova@mirantis.com> | 2016-02-09 13:27:45 +0200 |
---|---|---|
committer | Yulia Portnova <yportnova@mirantis.com> | 2016-02-15 10:38:47 +0200 |
commit | 3c0a48aacea94e78a977a3edea919b741df19995 (patch) | |
tree | 72b1dd145e517367e7fd54b578a4123bad15ef34 /tools/simulator.py | |
parent | ea204a0f6db64f8a9f9cd2b03fbddeac92d5ffbd (diff) | |
download | oslo-messaging-3c0a48aacea94e78a977a3edea919b741df19995.tar.gz |
simulator.py improvements
Added fanout option to target
Fixed timeout option
Removed setting config values as they are
reverted to defaults on driver load
Change-Id: Ia2d8a7bbcb04706deb3d701c1a0f93a0dd835a19
Diffstat (limited to 'tools/simulator.py')
-rwxr-xr-x | tools/simulator.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/simulator.py b/tools/simulator.py index 872ac0e..df6ef81 100755 --- a/tools/simulator.py +++ b/tools/simulator.py @@ -363,7 +363,7 @@ def main(): help='number of call per threads') client.add_argument('-w', dest='wait_after_msg', type=int, default=-1, help='sleep time between two messages') - client.add_argument('-t', dest='timeout', type=int, default=3, + client.add_argument('--timeout', dest='timeout', type=int, default=3, help='client timeout') server = subparsers.add_parser('rpc-server') @@ -381,13 +381,15 @@ def main(): help='number of call per threads') client.add_argument('-w', dest='wait_after_msg', type=int, default=-1, help='sleep time between two messages') - client.add_argument('-t', dest='timeout', type=int, default=3, + client.add_argument('--timeout', dest='timeout', type=int, default=3, help='client timeout') client.add_argument('--exit-wait', dest='exit_wait', type=int, default=0, help='Keep connections open N seconds after calls ' 'have been done') client.add_argument('--is-cast', dest='is_cast', type=bool, default=False, help='Use `call` or `cast` RPC methods') + client.add_argument('--is-fanout', dest='is_fanout', type=bool, + default=False, help='fanout=True for CAST messages') args = parser.parse_args() @@ -401,8 +403,6 @@ def main(): else: transport = messaging.get_notification_transport(cfg.CONF, url=args.url) - cfg.CONF.oslo_messaging_notifications.topics = "notif" - cfg.CONF.oslo_messaging_notifications.driver = "messaging" # oslo.config defaults cfg.CONF.heartbeat_interval = 5 @@ -426,8 +426,9 @@ def main(): init_msg(args.messages) targets = [target.partition('.')[::2] for target in args.targets] start = datetime.datetime.now() - targets = [messaging.Target(topic=topic, server=server_name) for topic, - server_name in targets] + targets = [messaging.Target( + topic=topic, server=server_name, fanout=args.is_fanout) for + topic, server_name in targets] spawn_rpc_clients(args.threads, transport, targets, args.wait_after_msg, args.timeout, args.is_cast, args.messages, args.duration) |