support pandora gun types

This commit is contained in:
Alexey Lavrenuke 2015-10-30 19:50:05 +03:00
parent 62bcdac31e
commit 0d84d9839a
2 changed files with 8 additions and 1 deletions

View File

@ -73,6 +73,9 @@ class PoolConfig(object):
def set_target(self, target):
self.config["Gun"]["Parameters"]["Target"] = target
def set_gun_type(self, gun_type):
self.config["Gun"]["Type"] = gun_type
def data(self):
return self.config

View File

@ -36,7 +36,7 @@ class PandoraPlugin(AbstractPlugin, AggregateResultListener):
def get_available_options(self):
opts = ["pandora_cmd", "buffered_seconds",
"ammo", "loop", "sample_log", "config_file",
"startup_schedule", "user_schedule",]
"startup_schedule", "user_schedule", "gun_type"]
return opts
def configure(self):
@ -76,6 +76,10 @@ class PandoraPlugin(AbstractPlugin, AggregateResultListener):
target = self.get_option("target", "localhost:3000")
pool_config.set_target(target)
gun_type = self.get_option("gun_type", "spdy")
self.log.info("Pandora gun type is: %s", gun_type)
pool_config.set_gun_type(gun_type)
self.pandora_config = PandoraConfig()
self.pandora_config.add_pool(pool_config)