From c85dd35c4ebf48f1a5289c738d2f2f044eb2df27 Mon Sep 17 00:00:00 2001 From: Dipti Date: Tue, 26 Jan 2021 13:48:15 -0800 Subject: [PATCH] milliseconds from datetime object now in own column from datetime object --- py-json/realm.py | 8 +++++--- py-scripts/test_ipv4_variable_time.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/py-json/realm.py b/py-json/realm.py index c3a2e1ba..99eca37b 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -1220,15 +1220,17 @@ class L3CXProfile(BaseProfile): for endpoint_data in datum.values(): if self.debug: print(endpoint_data) - endpoint_data["Timestamp"] = test_timestamp + endpoint_data["Timestamp"] = test_timestamp.strftime("%m/%d/%Y %I:%M:%S") + endpoint_data["Timestamp milliseconds"] = test_timestamp.strftime("%f") full_test_data_list.append(endpoint_data) if self.debug: print("Printing full data list...") print(full_test_data_list) header_row.append('Timestamp') + header_row.append('Timestamp milliseconds') df = pd.DataFrame(full_test_data_list) - df=df[["Timestamp",*header_row[:-1]]] + df=df[["Timestamp","Timestamp milliseconds", *header_row[:-2]]] try: systeminfo = ast.literal_eval(requests.get('http://'+str(self.lfclient_host)+':'+str(self.lfclient_port)).text) @@ -1249,7 +1251,7 @@ class L3CXProfile(BaseProfile): fig = df.plot().get_figure() fig.savefig(report_file) if output_format.lower() in ['excel', 'xlsx'] or report_file.split('.')[-1] == 'xlsx': - df.to_excel(report_file) + df.to_excel(report_file, index=False) if output_format == 'df': return df supported_formats = ['csv', 'json', 'stata', 'pickle','html'] diff --git a/py-scripts/test_ipv4_variable_time.py b/py-scripts/test_ipv4_variable_time.py index c61cb05d..b8a9ed02 100755 --- a/py-scripts/test_ipv4_variable_time.py +++ b/py-scripts/test_ipv4_variable_time.py @@ -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=['name','tx bytes','dropped', 'rx bytes']) + optional_args.add_argument('--col_names', help='Which columns you want to monitor', default=['name','tx bytes', 'rx bytes','dropped']) args = parser.parse_args() num_sta = 2