diff --git a/kloudbuster/cfg.scale.yaml b/kloudbuster/cfg.scale.yaml index fc539d7..0c0978b 100644 --- a/kloudbuster/cfg.scale.yaml +++ b/kloudbuster/cfg.scale.yaml @@ -117,11 +117,6 @@ client: # Interval for polling status from all VMs in seconds polling_interval: 5 - # Tooling - http_tool: - name: 'wrk' - dest_path: '/usr/local/bin/wrk2' - # HTTP tool specific configs (per VM) # Every HTTP server VM is paired to 1 HTTP traffic generator VM # KloudBuster will take care of setting up the proper static routes diff --git a/kloudbuster/kb_res_logger.py b/kloudbuster/kb_res_logger.py index 1834b5b..b9877ab 100644 --- a/kloudbuster/kb_res_logger.py +++ b/kloudbuster/kb_res_logger.py @@ -25,8 +25,8 @@ class KBResLogger(object): def __init__(self): self.resource_list = {} - for key in ['tenants', 'users', 'flavors', 'routers', 'networks', - 'sec_groups', 'instances', 'floating_ips']: + for key in ['tenants', 'users', 'flavors', 'keypairs', 'routers', + 'networks', 'sec_groups', 'instances', 'floating_ips']: self.resource_list[key] = [] def log(self, res_type, name, id): diff --git a/kloudbuster/kloudbuster.py b/kloudbuster/kloudbuster.py index f1839c2..84d8cbc 100755 --- a/kloudbuster/kloudbuster.py +++ b/kloudbuster/kloudbuster.py @@ -333,7 +333,8 @@ class KloudBuster(object): ins.user_data['redis_server_port'] = 6379 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['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.boot_info['flavor_type'] = 'kb.client' if \ not self.tenants_list['client'] else self.testing_kloud.flavor_to_use diff --git a/kloudbuster/perf_instance.py b/kloudbuster/perf_instance.py index 3631bdc..c61682a 100644 --- a/kloudbuster/perf_instance.py +++ b/kloudbuster/perf_instance.py @@ -22,11 +22,10 @@ LOG = logging.getLogger(__name__) # An openstack instance (can be a VM or a LXC) 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) self.config = config - self.is_server = is_server self.boot_info = {} self.user_data = {} self.up_flag = False @@ -34,25 +33,10 @@ class PerfInstance(BaseCompute): # SSH Configuration self.ssh_access = None self.ssh = None - self.port = None self.az = None - if 'tp_tool' not in config: - self.tp_tool = None - # 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 + # self.tp_tool = nuttcp_tool.NuttcpTool(self) + self.http_tool = WrkTool(self) def run_tp_client(self, label, dest_ip, target_instance, mss=None, bandwidth=0, bidirectional=False, az_to=None): diff --git a/kloudbuster/perf_tool.py b/kloudbuster/perf_tool.py index 6aba2db..bb674c6 100644 --- a/kloudbuster/perf_tool.py +++ b/kloudbuster/perf_tool.py @@ -24,16 +24,15 @@ LOG = logging.getLogger(__name__) class PerfTool(object): __metaclass__ = abc.ABCMeta - def __init__(self, instance, tool_cfg): - self.name = tool_cfg.name + def __init__(self, instance, tool_name): self.instance = instance - self.dest_path = tool_cfg.dest_path + self.name = tool_name self.pid = None # Terminate pid if started def dispose(self): if self.pid: - # Terminate the iperf server + # Terminate the server LOG.kbdebug("[%s] Terminating %s" % (self.instance.vm_name, self.name)) self.instance.ssh.kill_proc(self.pid) @@ -82,11 +81,6 @@ class PerfTool(object): res['latency_stats'] = latency_stats return res - @abc.abstractmethod - def cmd_run_client(**kwargs): - # must be implemented by sub classes - return None - @abc.abstractmethod def cmd_parser_run_client(self, status, stdout, stderr): # must be implemented by sub classes diff --git a/kloudbuster/wrk_tool.py b/kloudbuster/wrk_tool.py index be8d3b0..206c85f 100644 --- a/kloudbuster/wrk_tool.py +++ b/kloudbuster/wrk_tool.py @@ -25,22 +25,8 @@ LOG = logging.getLogger(__name__) class WrkTool(PerfTool): - def __init__(self, instance, cfg_http_tool): - PerfTool.__init__(self, instance, cfg_http_tool) - - 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 __init__(self, instance): + PerfTool.__init__(self, instance, 'wrk2') def cmd_parser_run_client(self, status, stdout, stderr): if status: