in report/script/gen_jtl_data.py [0:0]
def gen_select(input_file_name,res_json):
#if not os.path.exists(select_file_name):
# os.system(r"touch {}".format(select_file_name))
mysql_file_name = '{}/{}'.format(input_file_name, "mysql_select.jtl")
sharding_proxy_file_name = '{}/{}'.format(input_file_name, "sharding-proxy_select.jtl")
sharding_jdbc_file_name = '{}/{}'.format(input_file_name, "sharding-jdbc_select.jtl")
with open(sharding_proxy_file_name) as f:
for line in f:
line = line.strip("\n")
if line != "":
res_json['SELECT'][0]['data'].append(json.loads(line))
with open(sharding_jdbc_file_name) as f:
for line in f:
line = line.strip("\n")
if line != "":
res_json['SELECT'][1]['data'].append(json.loads(line))
with open(mysql_file_name) as f:
for line in f:
line = line.strip("\n")
if line != "":
res_json['SELECT'][2]['data'].append(json.loads(line))