package Ġcom . atlassian . performance . tools . jira actions . w 3 c . har vest ers Ċ Ċ import Ġcom . atlassian . performance . tools . jira actions . api . w 3 c . Performance Entry Ċ import Ġcom . atlassian . performance . tools . jira actions . api . w 3 c . Performance Resource Timing Ċ import Ġorg . openqa . selenium . Javascript Executor Ċ Ċ internal Ġfun Ġget Js Resources Performance ( javascript : ĠJavascript Executor ): ĠList < Performance Resource Timing > Ġ{ ĊĠĠĠ Ġval Ġjs Resources Ġ= Ġjavascript . execute Script (" return Ġwindow . performance . get Entries ByType (\" resource \ "); ") ĊĠĠĠ Ġreturn Ġparse Resources ( js Resources ) Ċ } Ċ Ċ private Ġfun Ġparse Resources ( ĊĠĠĠ Ġjs Resources : ĠAny Ċ ): ĠList < Performance Resource Timing > Ġ{ ĊĠĠĠ Ġif Ġ( js Resources Ġ! is ĠList <* >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠException (" Unexpected Ġnon - list ĠJavaScript Ġvalue : Ġ$ js Resources ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġjs Resources . map Ġ{ Ġparse Performance Resource Timing ( it ) Ġ} Ċ } Ċ Ċ internal Ġfun Ġparse Performance Resource Timing ( ĊĠĠĠ Ġmap : ĠAny ? Ċ ): ĠPerformance Resource Timing Ġ{ ĊĠĠĠ Ġif Ġ( map Ġ! is ĠMap < *, Ġ* >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠException (" Unexpected Ġnon - map ĠJavaScript Ġvalue : Ġ$ map ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn ĠPerformance Resource Timing ( ĊĠĠĠĠĠĠĠ Ġentry Ġ= Ġparse Performance Entry ( map ), ĊĠĠĠĠĠĠĠ Ġinit iator Type Ġ= Ġmap [" init iator Type "] Ġas ĠString , ĊĠĠĠĠĠĠĠ Ġnext Hop Protocol Ġ= Ġmap [" next Hop Protocol "] Ġas ĠString , ĊĠĠĠĠĠĠĠ Ġworker Start Ġ= Ġparse Timestamp ( map [" worker Start "]), ĊĠĠĠĠĠĠĠ Ġredirect Start Ġ= Ġparse Timestamp ( map [" redirect Start "]), ĊĠĠĠĠĠĠĠ Ġredirect End Ġ= Ġparse Timestamp ( map [" redirect End "]), ĊĠĠĠĠĠĠĠ Ġfetch Start Ġ= Ġparse Timestamp ( map [" fetch Start "]), ĊĠĠĠĠĠĠĠ Ġdomain Lookup Start Ġ= Ġparse Timestamp ( map [" domain Lookup Start "]), ĊĠĠĠĠĠĠĠ Ġdomain Lookup End Ġ= Ġparse Timestamp ( map [" domain Lookup End "]), ĊĠĠĠĠĠĠĠ Ġconnect Start Ġ= Ġparse Timestamp ( map [" connect Start "]), ĊĠĠĠĠĠĠĠ Ġconnect End Ġ= Ġparse Timestamp ( map [" connect End "]), ĊĠĠĠĠĠĠĠ Ġsecure Connection Start Ġ= Ġparse Timestamp ( map [" secure Connection Start "]), ĊĠĠĠĠĠĠĠ Ġrequest Start Ġ= Ġparse Timestamp ( map [" request Start "]), ĊĠĠĠĠĠĠĠ Ġresponse Start Ġ= Ġparse Timestamp ( map [" response Start "]), ĊĠĠĠĠĠĠĠ Ġresponse End Ġ= Ġparse Timestamp ( map [" response End "]), ĊĠĠĠĠĠĠĠ Ġtransfer Size Ġ= Ġmap [" transfer Size "] Ġas ĠLong , ĊĠĠĠĠĠĠĠ Ġencoded Body Size Ġ= Ġmap [" encoded Body Size "] Ġas ĠLong , ĊĠĠĠĠĠĠĠ Ġdecoded Body Size Ġ= Ġmap [" decoded Body Size "] Ġas ĠLong ĊĠĠĠ Ġ) Ċ } Ċ Ċ private Ġfun Ġparse Performance Entry ( ĊĠĠĠ Ġmap : ĠAny ? Ċ ): ĠPerformance Entry Ġ{ ĊĠĠĠ Ġif Ġ( map Ġ! is ĠMap < *, Ġ* >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠException (" Unexpected Ġnon - map ĠJavaScript Ġvalue : Ġ$ map ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn ĠPerformance Entry ( ĊĠĠĠĠĠĠĠ Ġname Ġ= Ġmap [" name "] Ġas ĠString , ĊĠĠĠĠĠĠĠ Ġentry Type Ġ= Ġmap [" entry Type "] Ġas ĠString , ĊĠĠĠĠĠĠĠ ĠstartTime Ġ= Ġparse Timestamp ( map [" startTime "]), ĊĠĠĠĠĠĠĠ Ġduration Ġ= Ġparse Timestamp ( map [" duration "]) ĊĠĠĠ Ġ) Ċ } Ċ