columns now adjusting according to order called in var_time, removed indices

This commit is contained in:
Dipti
2021-01-26 12:53:58 -08:00
parent eaff7dda60
commit cbb06a7922
2 changed files with 5 additions and 3 deletions

View File

@@ -1222,11 +1222,13 @@ class L3CXProfile(BaseProfile):
print(endpoint_data)
endpoint_data["Timestamp"] = test_timestamp
full_test_data_list.append(endpoint_data)
if self.debug:
print("Printing full data list...")
print(full_test_data_list)
header_row.append('Timestamp')
df = pd.DataFrame(full_test_data_list)
df.columns=header_row
df=df[["Timestamp",*header_row[:-1]]]
try:
systeminfo = ast.literal_eval(requests.get('http://'+str(self.lfclient_host)+':'+str(self.lfclient_port)).text)
@@ -1253,7 +1255,7 @@ class L3CXProfile(BaseProfile):
supported_formats = ['csv', 'json', 'stata', 'pickle','html']
for x in supported_formats:
if output_format.lower() == x or report_file.split('.')[-1] == x:
exec('df.to_' + x + '("' + report_file + '")')
exec('df.to_' + x + '("' + report_file + '",index=False' + ')')
def refresh_cx(self):

View File

@@ -192,7 +192,7 @@ python3 ./test_ipv4_variable_time.py
optional_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
optional_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000)
optional_args.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m")
optional_args.add_argument('--col_names', help='Which columns you want to monitor', default=['Tx Bytes','Name','Dropped', 'Rx Bytes'])
optional_args.add_argument('--col_names', help='Which columns you want to monitor', default=['name','tx bytes','dropped', 'rx bytes'])
args = parser.parse_args()
num_sta = 2