Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

ui add sysbench #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def process_data(self):
os.mkdir(self.workpath)

all_node = []
for node in self.cluster["osds"] + self.cluster["client"]:
all_nodes = set(self.cluster["osds"] + self.cluster["client"])
if case_type == "sysbench":
all_nodes = set(self.cluster["vclient"])
for node in all_nodes:
common.printout("LOG","note "+ node + " start analysis")
common.scp(self.cluster["user"],node,remote_file,self.cluster["tmp_dir"])
common.scp(self.cluster["user"],node,remote_file1,self.cluster["tmp_dir"])
Expand Down Expand Up @@ -341,7 +344,7 @@ def get_execute_time(self):

def summary_result(self, data):
# generate summary
benchmark_tool = ["fio", "cosbench", "vdbench"]
benchmark_tool = ["fio", "cosbench", "vdbench","sysbench"]
data["summary"]["run_id"] = {}
res = re.search('^(\d+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\d+)-(\d+)-(\w+)$',data["session_name"])
if not res:
Expand Down Expand Up @@ -471,6 +474,8 @@ def _process_data(self, node_name):
result.update(res)
if 'cosbench' in dir_name:
workload_result.update(self.process_cosbench_data("%s/%s/%s" %(dest_dir, node_name, dir_name), dir_name))
if 'sysbench' in dir_name:
workload_result.update(self.process_sysbench_data("%s/%s/%s" %(dest_dir, node_name, dir_name), node_name, dir_name))
if '_sar.txt' in dir_name:
result.update(self.process_sar_data("%s/%s/%s" % (dest_dir, node_name, dir_name)))
if 'totals.html' in dir_name:
Expand Down Expand Up @@ -779,6 +784,40 @@ def process_iostat_data(self, node, path):
result[output]["disk_num"] = disk_num
return result

def process_sysbench_data(self, path,node_name, dirname):
result = {}
sysbench_data = {}
runtime_tmp = path.replace(self.all_conf_data.get("dest_dir"),'').split('/')
while '' in runtime_tmp:
runtime_tmp.remove('')
runtime = runtime_tmp[0].split('-')[-2]
with open(path,"r") as fd:
self.data = fd.readlines()
self.sysbench_data = {}
if len(self.data) != 0:
for i in self.data:
self.line = i.strip('\n').split(':')
while '' in self.line:
self.line.remove('')
if len(self.line) == 2:
self.sysbench_data[self.line[0].strip()] = self.line[1].strip()
output_sysbench_data = OrderedDict()
output_sysbench_data['read_lat'] = '%.3f'%float(self.sysbench_data["avg"].strip("ms"))
output_sysbench_data["read_iops"] = '%.3f'%(int(self.sysbench_data["read"])/int(runtime))
output_sysbench_data["read_bw"] = '0.000'
output_sysbench_data['read_runtime'] = '%.3f'%float(runtime)
output_sysbench_data['write_lat'] = '%.3f'%float(self.sysbench_data["avg"].strip("ms"))
output_sysbench_data["write_iops"] = '%.3f'%(int(self.sysbench_data["write"])/int(runtime))
output_sysbench_data["write_bw"] = '0.000'
output_sysbench_data["99.99%_lat"] = '%.3f'%float(self.sysbench_data["approx. 99 percentile"].strip("ms"))
output_sysbench_data['write_runtime'] = '%.3f'%float(runtime)
output_sysbench_data['lat_unit'] = 'msec'
output_sysbench_data['runtime_unit'] = 'sec'
output_sysbench_data['bw_unit'] = 'MB/s'
result[node_name] = {}
result[node_name]["sysbench"] = output_sysbench_data
return result

def process_vdbench_data(self, path, dirname):
result = {}
vdbench_data = {}
Expand Down
37 changes: 37 additions & 0 deletions analyzer/analyzer_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ def _process_data(self):
if 'cosbench' in dir_name:
self.common.printout("LOG","Processing %s_%s" % (self.whoami, dir_name))
workload_result.update(self.process_cosbench_data("%s/%s" %(dest_dir, dir_name), dir_name))
if 'sysbench' in dir_name:
self.common.printout("LOG","Processing %s_%s" % (self.whoami, dir_name))
workload_result.update(self.process_sysbench_data("%s/%s/%s" %(dest_dir, node_name, dir_name), node_name, dir_name))
if '_sar.txt' in dir_name:
self.common.printout("LOG","Processing %s_%s" % (self.whoami, dir_name))
result.update(self.process_sar_data("%s/%s" % (dest_dir, dir_name)))
Expand Down Expand Up @@ -671,6 +674,40 @@ def process_iostat_data(self, node, path):
result[output]["disk_num"] = disk_num
return result

def process_sysbench_data(self, path,node_name, dirname):
result = {}
sysbench_data = {}
runtime_tmp = path.replace(self.all_conf_data.get("dest_dir"),'').split('/')
while '' in runtime_tmp:
runtime_tmp.remove('')
runtime = runtime_tmp[0].split('-')[-2]
with open(path,"r") as fd:
self.data = fd.readlines()
self.sysbench_data = {}
if len(self.data) != 0:
for i in self.data:
self.line = i.strip('\n').split(':')
while '' in self.line:
self.line.remove('')
if len(self.line) == 2:
self.sysbench_data[self.line[0].strip()] = self.line[1].strip()
output_sysbench_data = OrderedDict()
output_sysbench_data['read_lat'] = '%.3f'%float(self.sysbench_data["avg"].strip("ms"))
output_sysbench_data["read_iops"] = '%.3f'%(int(self.sysbench_data["read"])/int(runtime))
output_sysbench_data["read_bw"] = '0.000'
output_sysbench_data['read_runtime'] = '%.3f'%float(runtime)
output_sysbench_data['write_lat'] = '%.3f'%float(self.sysbench_data["avg"].strip("ms"))
output_sysbench_data["write_iops"] = '%.3f'%(int(self.sysbench_data["write"])/int(runtime))
output_sysbench_data["write_bw"] = '0.000'
output_sysbench_data["99.99%_lat"] = '%.3f'%float(self.sysbench_data["approx. 99 percentile"].strip("ms"))
output_sysbench_data['write_runtime'] = '%.3f'%float(runtime)
output_sysbench_data['lat_unit'] = 'msec'
output_sysbench_data['runtime_unit'] = 'sec'
output_sysbench_data['bw_unit'] = 'MB/s'
result[node_name] = {}
result[node_name]["sysbench"] = output_sysbench_data
return result

def process_vdbench_data(self, path, dirname):
result = {}
vdbench_data = {}
Expand Down
2 changes: 1 addition & 1 deletion benchmarking/mod/bblock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__all__ = ['qemurbd', 'fiorbd', 'vdbench']
__all__ = ['qemurbd', 'fiorbd', 'vdbench','sysbench']


Loading