Remove the dest_path from the config file
1. Remove the dest_path from the config file; 2. Fix the resource logging bug of keypairs; Change-Id: I00aff0708e4d2ee69dadc65afbfe038422f70350
This commit is contained in:
parent
d7d9575dda
commit
0db7bc9d0e
@ -117,11 +117,6 @@ client:
|
|||||||
# Interval for polling status from all VMs in seconds
|
# Interval for polling status from all VMs in seconds
|
||||||
polling_interval: 5
|
polling_interval: 5
|
||||||
|
|
||||||
# Tooling
|
|
||||||
http_tool:
|
|
||||||
name: 'wrk'
|
|
||||||
dest_path: '/usr/local/bin/wrk2'
|
|
||||||
|
|
||||||
# HTTP tool specific configs (per VM)
|
# HTTP tool specific configs (per VM)
|
||||||
# Every HTTP server VM is paired to 1 HTTP traffic generator VM
|
# Every HTTP server VM is paired to 1 HTTP traffic generator VM
|
||||||
# KloudBuster will take care of setting up the proper static routes
|
# KloudBuster will take care of setting up the proper static routes
|
||||||
|
@ -25,8 +25,8 @@ class KBResLogger(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.resource_list = {}
|
self.resource_list = {}
|
||||||
for key in ['tenants', 'users', 'flavors', 'routers', 'networks',
|
for key in ['tenants', 'users', 'flavors', 'keypairs', 'routers',
|
||||||
'sec_groups', 'instances', 'floating_ips']:
|
'networks', 'sec_groups', 'instances', 'floating_ips']:
|
||||||
self.resource_list[key] = []
|
self.resource_list[key] = []
|
||||||
|
|
||||||
def log(self, res_type, name, id):
|
def log(self, res_type, name, id):
|
||||||
|
@ -333,7 +333,8 @@ class KloudBuster(object):
|
|||||||
ins.user_data['redis_server_port'] = 6379
|
ins.user_data['redis_server_port'] = 6379
|
||||||
ins.user_data['target_subnet_ip'] = svr_list[idx].subnet_ip
|
ins.user_data['target_subnet_ip'] = svr_list[idx].subnet_ip
|
||||||
ins.user_data['target_shared_interface_ip'] = svr_list[idx].shared_interface_ip
|
ins.user_data['target_shared_interface_ip'] = svr_list[idx].shared_interface_ip
|
||||||
ins.user_data['http_tool'] = ins.config['http_tool']
|
# @TODO(Move this hard coded part to kb_vm_agent.py)
|
||||||
|
ins.user_data['http_tool'] = {'dest_path': '/usr/local/bin/wrk2'}
|
||||||
ins.user_data['http_tool_configs'] = ins.config['http_tool_configs']
|
ins.user_data['http_tool_configs'] = ins.config['http_tool_configs']
|
||||||
ins.boot_info['flavor_type'] = 'kb.client' if \
|
ins.boot_info['flavor_type'] = 'kb.client' if \
|
||||||
not self.tenants_list['client'] else self.testing_kloud.flavor_to_use
|
not self.tenants_list['client'] else self.testing_kloud.flavor_to_use
|
||||||
|
@ -22,11 +22,10 @@ LOG = logging.getLogger(__name__)
|
|||||||
# An openstack instance (can be a VM or a LXC)
|
# An openstack instance (can be a VM or a LXC)
|
||||||
class PerfInstance(BaseCompute):
|
class PerfInstance(BaseCompute):
|
||||||
|
|
||||||
def __init__(self, vm_name, network, config, is_server=False):
|
def __init__(self, vm_name, network, config):
|
||||||
BaseCompute.__init__(self, vm_name, network)
|
BaseCompute.__init__(self, vm_name, network)
|
||||||
|
|
||||||
self.config = config
|
self.config = config
|
||||||
self.is_server = is_server
|
|
||||||
self.boot_info = {}
|
self.boot_info = {}
|
||||||
self.user_data = {}
|
self.user_data = {}
|
||||||
self.up_flag = False
|
self.up_flag = False
|
||||||
@ -34,25 +33,10 @@ class PerfInstance(BaseCompute):
|
|||||||
# SSH Configuration
|
# SSH Configuration
|
||||||
self.ssh_access = None
|
self.ssh_access = None
|
||||||
self.ssh = None
|
self.ssh = None
|
||||||
self.port = None
|
|
||||||
self.az = None
|
self.az = None
|
||||||
|
|
||||||
if 'tp_tool' not in config:
|
# self.tp_tool = nuttcp_tool.NuttcpTool(self)
|
||||||
self.tp_tool = None
|
self.http_tool = WrkTool(self)
|
||||||
# elif config.tp_tool.lower() == 'nuttcp':
|
|
||||||
# self.tp_tool = nuttcp_tool.NuttcpTool
|
|
||||||
# elif opts.tp_tool.lower() == 'iperf':
|
|
||||||
# self.tp_tool = iperf_tool.IperfTool
|
|
||||||
# else:
|
|
||||||
# self.tp_tool = None
|
|
||||||
|
|
||||||
if 'http_tool' not in config:
|
|
||||||
self.http_tool = None
|
|
||||||
elif config.http_tool.name.lower() == 'wrk':
|
|
||||||
self.http_tool = WrkTool(self, config.http_tool)
|
|
||||||
self.target_url = None
|
|
||||||
else:
|
|
||||||
self.http_tool = None
|
|
||||||
|
|
||||||
def run_tp_client(self, label, dest_ip, target_instance,
|
def run_tp_client(self, label, dest_ip, target_instance,
|
||||||
mss=None, bandwidth=0, bidirectional=False, az_to=None):
|
mss=None, bandwidth=0, bidirectional=False, az_to=None):
|
||||||
|
@ -24,16 +24,15 @@ LOG = logging.getLogger(__name__)
|
|||||||
class PerfTool(object):
|
class PerfTool(object):
|
||||||
__metaclass__ = abc.ABCMeta
|
__metaclass__ = abc.ABCMeta
|
||||||
|
|
||||||
def __init__(self, instance, tool_cfg):
|
def __init__(self, instance, tool_name):
|
||||||
self.name = tool_cfg.name
|
|
||||||
self.instance = instance
|
self.instance = instance
|
||||||
self.dest_path = tool_cfg.dest_path
|
self.name = tool_name
|
||||||
self.pid = None
|
self.pid = None
|
||||||
|
|
||||||
# Terminate pid if started
|
# Terminate pid if started
|
||||||
def dispose(self):
|
def dispose(self):
|
||||||
if self.pid:
|
if self.pid:
|
||||||
# Terminate the iperf server
|
# Terminate the server
|
||||||
LOG.kbdebug("[%s] Terminating %s" % (self.instance.vm_name,
|
LOG.kbdebug("[%s] Terminating %s" % (self.instance.vm_name,
|
||||||
self.name))
|
self.name))
|
||||||
self.instance.ssh.kill_proc(self.pid)
|
self.instance.ssh.kill_proc(self.pid)
|
||||||
@ -82,11 +81,6 @@ class PerfTool(object):
|
|||||||
res['latency_stats'] = latency_stats
|
res['latency_stats'] = latency_stats
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@abc.abstractmethod
|
|
||||||
def cmd_run_client(**kwargs):
|
|
||||||
# must be implemented by sub classes
|
|
||||||
return None
|
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def cmd_parser_run_client(self, status, stdout, stderr):
|
def cmd_parser_run_client(self, status, stdout, stderr):
|
||||||
# must be implemented by sub classes
|
# must be implemented by sub classes
|
||||||
|
@ -25,22 +25,8 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class WrkTool(PerfTool):
|
class WrkTool(PerfTool):
|
||||||
|
|
||||||
def __init__(self, instance, cfg_http_tool):
|
def __init__(self, instance):
|
||||||
PerfTool.__init__(self, instance, cfg_http_tool)
|
PerfTool.__init__(self, instance, 'wrk2')
|
||||||
|
|
||||||
def cmd_run_client(self, target_url, threads, connections,
|
|
||||||
rate_limit=0, timeout=5, connetion_type='Keep-alive'):
|
|
||||||
'''
|
|
||||||
Return the command for running the benchmarking tool
|
|
||||||
'''
|
|
||||||
duration_sec = self.instance.config.http_tool_configs.duration
|
|
||||||
if not rate_limit:
|
|
||||||
rate_limit = 65535
|
|
||||||
cmd = '%s -t%d -c%d -R%d -d%ds --timeout %ds -D2 -e %s' % \
|
|
||||||
(self.dest_path, threads, connections, rate_limit,
|
|
||||||
duration_sec, timeout, target_url)
|
|
||||||
LOG.kbdebug("[%s] %s" % (self.instance.vm_name, cmd))
|
|
||||||
return cmd
|
|
||||||
|
|
||||||
def cmd_parser_run_client(self, status, stdout, stderr):
|
def cmd_parser_run_client(self, status, stdout, stderr):
|
||||||
if status:
|
if status:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user