@@ -74,6 +74,10 @@ def get_html_report(client_results, clients, results_paths, test_cases, methods,
7474 '<th>N</th>\n '
7575 '<th class=\" title\" >Description</th>\n '
7676 '<th>Start Time</th>\n '
77+ '<th>End Time</th>\n '
78+ f'<th onclick="sortTable(10, \' table_{ client } \' , true)" style="cursor: pointer;">Duration (ms) ↑ ↓</th>\n '
79+ f'<th onclick="sortTable(11, \' table_{ client } \' , true)" style="cursor: pointer;">FCU time (ms) ↑ ↓</th>\n '
80+ f'<th onclick="sortTable(12, \' table_{ client } \' , true)" style="cursor: pointer;">NP time (ms) ↑ ↓</th>\n '
7781 '</tr>\n '
7882 '</thread>\n '
7983 '<tbody>\n ' )
@@ -88,7 +92,11 @@ def get_html_report(client_results, clients, results_paths, test_cases, methods,
8892 f'<td>{ data [1 ]} </td>\n '
8993 f'<td>{ data [6 ]} </td>\n '
9094 f'<td style="text-align:left;" >{ data [7 ]} </td>\n '
91- f'<td>{ data [8 ]} </td>\n </tr>\n ' )
95+ f'<td>{ data [8 ]} </td>\n '
96+ f'<td>{ data [9 ]} </td>\n '
97+ f'<td>{ data [10 ]} </td>\n '
98+ f'<td>{ data [11 ]} </td>\n '
99+ f'<td>{ data [12 ]} </td>\n </tr>\n ' )
92100 results_to_print += '\n '
93101 results_to_print += ('</table>\n '
94102 '</tbody>\n ' )
@@ -153,7 +161,7 @@ def get_html_report(client_results, clients, results_paths, test_cases, methods,
153161 print (formatted_html )
154162 if not os .path .exists ('reports' ):
155163 os .mkdir ('reports' )
156- with open (f 'reports/index.html' , 'w' ) as file :
164+ with open ('reports/index.html' , 'w' ) as file :
157165 file .write (formatted_html )
158166
159167 for client , gas_table in csv_table .items ():
@@ -162,9 +170,9 @@ def get_html_report(client_results, clients, results_paths, test_cases, methods,
162170 csvwriter = csv .writer (csvfile )
163171 csvwriter .writerow (
164172 ['Title' , 'Max (MGas/s)' , 'p50 (MGas/s)' , 'p95 (MGas/s)' , 'p99 (MGas/s)' , 'Min (MGas/s)' , 'N' ,
165- 'Description' , "Start Time" ])
173+ 'Description' , "Start Time" , "End Time" , "Duration (ms)" , "FCU time (ms)" , "NP time (ms)" ])
166174 for test_case , data in gas_table .items ():
167- csvwriter .writerow ([data [0 ], data [2 ], data [3 ], data [4 ], data [5 ], data [1 ], data [6 ], data [7 ], data [8 ]])
175+ csvwriter .writerow ([data [0 ], data [2 ], data [3 ], data [4 ], data [5 ], data [1 ], data [6 ], data [7 ], data [8 ], data [ 9 ], data [ 10 ], data [ 11 ], data [ 12 ] ])
168176
169177
170178def main ():
@@ -213,16 +221,31 @@ def main():
213221 client_results [client ][test_case_name ][gas ][method ] = []
214222 failed_tests [client ][test_case_name ][gas ][method ] = []
215223 for run in range (1 , runs + 1 ):
216- responses , results , timestamp = utils .extract_response_and_result (results_paths , client , test_case_name ,
224+ responses , results , timestamp , duration , fcu_duration , np_duration = utils .extract_response_and_result (results_paths , client , test_case_name ,
217225 gas , run , method , fields )
218226 client_results [client ][test_case_name ][gas ][method ].append (results )
219227 failed_tests [client ][test_case_name ][gas ][method ].append (not responses )
220228 # print(test_case_name + " : " + str(timestamp))
221229 if str (timestamp ) != "0" :
222- client_results [client ][test_case_name ]["timestamp" ] = utils .convert_dotnet_ticks_to_utc (timestamp )
230+ # Store raw timestamp in ticks for calculation, not converted string
231+ client_results [client ][test_case_name ]["timestamp_ticks" ] = timestamp
232+ # Only store duration if non-zero to avoid overwriting valid values
233+ if duration != 0 :
234+ client_results [client ][test_case_name ]["duration" ] = duration
235+ if fcu_duration != 0 :
236+ client_results [client ][test_case_name ]["fcu_duration" ] = fcu_duration
237+ if np_duration != 0 :
238+ client_results [client ][test_case_name ]["np_duration" ] = np_duration
223239 else :
224- if "timestamp" not in str (client_results [client ][test_case_name ]):
225- client_results [client ][test_case_name ]["timestamp" ] = 0
240+ if "timestamp_ticks" not in client_results [client ][test_case_name ]:
241+ client_results [client ][test_case_name ]["timestamp_ticks" ] = 0
242+ # Initialize duration to 0 only if not set yet
243+ if "duration" not in client_results [client ][test_case_name ]:
244+ client_results [client ][test_case_name ]["duration" ] = 0
245+ if "fcu_duration" not in client_results [client ][test_case_name ]:
246+ client_results [client ][test_case_name ]["fcu_duration" ] = 0
247+ if "np_duration" not in client_results [client ][test_case_name ]:
248+ client_results [client ][test_case_name ]["np_duration" ] = 0
226249
227250 gas_set = set ()
228251 for test_case_name , test_case_gas in test_cases .items ():
0 commit comments