File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,9 @@ async fn http_response(
267267 } ) ?
268268 } ;
269269
270+ // Start timer for measuring resolution time
271+ let start_ts = std:: time:: SystemTime :: now ( ) ;
272+
270273 // Use the provided HTTP client, or instantiate a new one if none
271274 let client = match client {
272275 Some ( client) => client,
@@ -373,7 +376,20 @@ async fn http_response(
373376 message : x. to_string ( ) ,
374377 } ) ?;
375378
376- let result = run_retrieval_with_data_report ( retrieve, & response_string, context, settings) ;
379+ let result = run_retrieval_with_data_report ( retrieve, & response_string, context, settings)
380+ // override running_time within the final report including
381+ . map ( |report| {
382+ let completion_ts = std:: time:: SystemTime :: now ( ) ;
383+ RadonReport {
384+ context : ReportContext {
385+ start_time : Some ( start_ts) ,
386+ completion_time : Some ( completion_ts) ,
387+ ..report. context
388+ } ,
389+ running_time : completion_ts. duration_since ( start_ts) . unwrap_or_default ( ) ,
390+ ..report
391+ }
392+ } ) ;
377393
378394 match & result {
379395 Ok ( report) => {
You can’t perform that action at this time.
0 commit comments