# Make io_depth int an int params[6] = int(params[6][9:]) params_hash = mkhash(params) params = [params_hash] + params params.extend([0, 0]) database.insert(params) for line in open(inputname): if "aggrb" in line: bw = getbw(splits(line, 'aggrb=', ',')) if "READ" in line: database.update_readbw(params_hash, bw) elif "WRITE" in line: database.update_writebw(params_hash, bw) html = HTMLGenerator() html.add_html( html.read_file('/home/nhm/src/ceph-tools/cbt/include/html/table.html')) html.add_style( html.read_file('/home/nhm/src/ceph-tools/cbt/include/css/table.css')) html.add_script( html.read_file( '/home/nhm/src/ceph-tools/cbt/include/js/jsxcompressor.min.js')) html.add_script( html.read_file('/home/nhm/src/ceph-tools/cbt/include/js/d3.js')) html.add_script( html.read_file('/home/nhm/src/ceph-tools/cbt/include/js/d3var.js')) html.add_script( html.format_data(database.fetch_table(['opsize', 'testtype']))) html.add_script(
# Make io_depth int an int params[6] = int(params[6][9:]) params_hash = mkhash(params) params = [params_hash] + params params.extend([0,0]) database.insert(params) for line in open(inputname): if "aggrb" in line: bw = getbw(splits(line, 'aggrb=', ',')) if "READ" in line: database.update_readbw(params_hash, bw) elif "WRITE" in line: database.update_writebw(params_hash, bw) html = HTMLGenerator() html.add_html(html.read_file('/home/nhm/src/cbt/include/html/table.html')) html.add_style(html.read_file('/home/nhm/src/cbt/include/css/table.css')) html.add_script(html.read_file('/home/nhm/src/cbt/include/js/jsxcompressor.min.js')) html.add_script(html.read_file('/home/nhm/src/cbt/include/js/d3.js')) html.add_script(html.read_file('/home/nhm/src/cbt/include/js/d3var.js')) html.add_script(html.format_data(database.fetch_table(['opsize', 'testtype']))) html.add_script(html.read_file('/home/nhm/src/cbt/include/js/table.js')) print '<meta charset="utf-8">' print '<title>D3 Table Test </title>' print '<html>' print html.to_string() print '</html>' # print database.fetch_table(['opsize', 'testtype'])
def parse_output(archives=[], path='.'): database.create_db() #FIXME the database structure should be updated to include all the # fields currently produced by CBT. The code below ignores client readahead. # The Rbdfio/rbdfio structure produced by CBT seems redundant. # #start by parsing the Radosbench output files = [] for archive in archives: directory = path + '/' + archive + '/00000000/Radosbench' files.extend(find('output.*.*', directory)) for inputname in files: filepattern = re.compile(path + '/' + '(.+)') m = filepattern.match(inputname) mydirectory = m.group(1) params = mydirectory.split("/") baselist = params[:] baselist.pop() basedir = '/'.join(baselist) settings = [] settings.extend(find('ceph_settings.out.*', basedir)) # make readahead into an int params[3] = int(params[3][7:]) # Make op_size into an int params[4] = int(params[4][8:]) # Make cprocs into an int params[5] = int(params[5][17:]) outputname = params[7] params[7] = params[6] # I'm not sure what iodepth should be for radosbench. Setting to 1 params[6] = 1 params = [outputname] + params params_hash = mkhash(params) params = [params_hash] + params params.extend([0, 0]) database.partial_insert(params) if len(settings) > 0: with open(settings[0]) as ceph_cluster_settings: cluster_settings = json.load(ceph_cluster_settings) database.update_columns(params[0], cluster_settings) pattern = re.compile('Bandwidth \(MB/sec\):\s+(\d+\.\d+)') for line in open(inputname): m = pattern.match(line) if m: bw = float(m.group(1)) if params[9] == 'write': database.update_writebw(params_hash, bw) else: database.update_readbw(params_hash, bw) #repeat with fio output files = [] for archive in archives: directory = path + '/' + archive + '/00000000/RbdFio' files.extend(find('output.*', directory)) for inputname in files: filepattern = re.compile(path + '/' + '(.+)') m = filepattern.match(inputname) mydirectory = m.group(1) params = mydirectory.split("/") # print(params) # make readahead into an int params[3] = int(params[4][7:]) # Make op_size into an int params[4] = int(params[6][8:]) # Make cprocs into an int params[5] = int(params[7][17:]) # Make iodepth into an int params[6] = int(params[8][8:]) params[7] = params[9] params[8] = 0.0 params[9] = 0.0 outputname = params.pop() params = [outputname] + params params_hash = mkhash(params) params = [params_hash] + params # print(params) database.insert(params) for line in open(inputname): if "aggrb" in line: bw = getbw(splits(line, 'aggrb=', ',')) if "READ" in line: database.update_readbw(params_hash, bw) elif "WRITE" in line: database.update_writebw(params_hash, bw)