package Ġpl . wend igo . chrome . api . performance Ċ Ċ import Ġkotlinx . serialization . json . Json Ċ Ċ /** Ċ Ġ* ĠPerformance Domain Ġrepresents ĠPerformance Ġprotocol Ġdomain Ġrequest / response Ġoperations Ġand Ġevents Ġthat Ġcan Ġbe Ġcaptured . Ċ Ġ* Ċ Ġ* Ġ@ link ĠProtocol Ġ[ Performance ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance ) Ġdomain Ġdocumentation . Ċ Ġ*/ Ċ Ċ class ĠPerformance Domain Ġinternal Ġconstructor ( connection : Ġpl . wend igo . chrome . protocol . Protocol Connection ) Ġ: ĊĠĠĠ Ġpl . wend igo . chrome . protocol . Domain (" Performance ", Ġ""" """, Ġconnection ) Ġ{ ĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠDisable Ġcollecting Ġand Ġreporting Ġmetrics . ĊĠĠĠĠ Ġ* ĊĠĠĠĠ Ġ* Ġ@ link ĠProtocol Ġ[ Performance # disable ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - disable ) Ġmethod Ġdocumentation . ĊĠĠĠĠ Ġ*/ ĊĠĠĠĠĊĠĠĠ Ġfun Ġdisable (): Ġio . reactivex . rx java 3 . core . Single < pl . wend igo . chrome . protocol . websocket . Request Response Frame > Ġ= Ġconnection . request (" Performance . disable ", Ġnull , Ġpl . wend igo . chrome . protocol . websocket . Request Response Frame . serializer ()) ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠEnable Ġcollecting Ġand Ġreporting Ġmetrics . ĊĠĠĠĠ Ġ* ĊĠĠĠĠ Ġ* Ġ@ link ĠProtocol Ġ[ Performance # enable ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - enable ) Ġmethod Ġdocumentation . ĊĠĠĠĠ Ġ*/ ĊĠĠĠĠĊĠĠĠ Ġfun Ġenable ( input : ĠEnable Request ): Ġio . reactivex . rx java 3 . core . Single < pl . wend igo . chrome . protocol . websocket . Request Response Frame > Ġ= Ġconnection . request (" Performance . enable ", ĠJson . encode ToJson Element ( Enable Request . serializer (), Ġinput ), Ġpl . wend igo . chrome . protocol . websocket . Request Response Frame . serializer ()) ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠSets Ġtime Ġdomain Ġto Ġuse Ġfor Ġcollecting Ġand Ġreporting Ġduration Ġmetrics . Ċ Note Ġthat Ġthis Ġmust Ġbe Ġcalled Ġbefore Ġenabling Ġmetrics Ġcollection . ĠCalling Ċ this Ġmethod Ġwhile Ġmetrics Ġcollection Ġis Ġenabled Ġreturns Ġan Ġerror . ĊĠĠĠĠ Ġ* ĊĠĠĠĠ Ġ* Ġ@ link ĠProtocol Ġ[ Performance # setTime Domain ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - setTime Domain ) Ġmethod Ġdocumentation . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Deprecated ( level Ġ= ĠDeprec ation Level . WARNING , Ġmessage Ġ= Ġ" setTime Domain Ġis Ġdeprecated .") ĊĠĠĠ Ġ@ pl . wend igo . chrome . protocol . Experimental ĊĠĠĠ Ġfun Ġset Time Domain ( input : ĠSet Time Domain Request ): Ġio . reactivex . rx java 3 . core . Single < pl . wend igo . chrome . protocol . websocket . Request Response Frame > Ġ= Ġconnection . request (" Performance . setTime Domain ", ĠJson . encode ToJson Element ( Set Time Domain Request . serializer (), Ġinput ), Ġpl . wend igo . chrome . protocol . websocket . Request Response Frame . serializer ()) ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠRetrieve Ġcurrent Ġvalues Ġof Ġrun - time Ġmetrics . ĊĠĠĠĠ Ġ* ĊĠĠĠĠ Ġ* Ġ@ link ĠProtocol Ġ[ Performance # get Metrics ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - get Metrics ) Ġmethod Ġdocumentation . ĊĠĠĠĠ Ġ*/ ĊĠĠĠĠĊĠĠĠ Ġfun Ġget Metrics (): Ġio . reactivex . rx java 3 . core . Single < Get Metrics Response > Ġ= Ġconnection . request (" Performance . get Metrics ", Ġnull , ĠGet Metrics Response . serializer ()) ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* Ġ ĠCurrent Ġvalues Ġof Ġthe Ġmetrics . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġfun Ġmetrics (): Ġio . reactivex . rx java 3 . core . Flow able < Metrics Event > Ġ= Ġconnection . events (" Performance . metrics ", ĠMetrics Event . serializer ()) Ċ } Ċ Ċ /** Ċ Ġ* ĠRepresents Ġrequest Ġframe Ġthat Ġcan Ġbe Ġused Ġwith Ġ[ Performance # enable ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - enable ) Ġoperation Ġcall . Ċ Ġ* Ċ Ġ* ĠEnable Ġcollecting Ġand Ġreporting Ġmetrics . Ċ Ġ* Ġ@ link Ġ[ Performance # enable ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - enable ) Ġmethod Ġdocumentation . Ċ Ġ* Ġ@ see Ġ[ Performance Domain . enable ] Ċ Ġ*/ Ċ @ kotlin x . serialization . Serializable Ċ data Ġclass ĠEnable Request ( ĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTime Ġdomain Ġto Ġuse Ġfor Ġcollecting Ġand Ġreporting Ġduration Ġmetrics . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġval Ġtime Domain : ĠString ? Ġ= Ġnull Ċ Ċ ) Ċ Ċ /** Ċ Ġ* ĠRepresents Ġrequest Ġframe Ġthat Ġcan Ġbe Ġused Ġwith Ġ[ Performance # setTime Domain ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - setTime Domain ) Ġoperation Ġcall . Ċ Ġ* Ċ Ġ* ĠSets Ġtime Ġdomain Ġto Ġuse Ġfor Ġcollecting Ġand Ġreporting Ġduration Ġmetrics . Ċ Note Ġthat Ġthis Ġmust Ġbe Ġcalled Ġbefore Ġenabling Ġmetrics Ġcollection . ĠCalling Ċ this Ġmethod Ġwhile Ġmetrics Ġcollection Ġis Ġenabled Ġreturns Ġan Ġerror . Ċ Ġ* Ġ@ link Ġ[ Performance # setTime Domain ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - setTime Domain ) Ġmethod Ġdocumentation . Ċ Ġ* Ġ@ see Ġ[ Performance Domain . setTime Domain ] Ċ Ġ*/ Ċ @ kotlin x . serialization . Serializable Ċ data Ġclass ĠSet Time Domain Request ( ĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTime Ġdomain ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġval Ġtime Domain : ĠString Ċ Ċ ) Ċ Ċ /** Ċ Ġ* ĠRepresents Ġresponse Ġframe Ġthat Ġis Ġreturned Ġfrom Ġ[ Performance # get Metrics ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - get Metrics ) Ġoperation Ġcall . Ċ Ġ* ĠRetrieve Ġcurrent Ġvalues Ġof Ġrun - time Ġmetrics . Ċ Ġ* ĊĠĠĊ Ġ* Ġ@ link Ġ[ Performance # get Metrics ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # method - get Metrics ) Ġmethod Ġdocumentation . Ċ Ġ* Ġ@ see Ġ[ Performance Domain . get Metrics ] Ċ Ġ*/ Ċ @ kotlin x . serialization . Serializable Ċ data Ġclass ĠGet Metrics Response ( ĊĠĠĠ Ġ/** ĠĠĊĠĠĠĠ Ġ* ĠCurrent Ġvalues Ġfor Ġrun - time Ġmetrics . ĠĠĊĠĠĠĠ Ġ*/ ĠĠĊĠĠĠ Ġval Ġmetrics : ĠList < Metric > Ċ Ċ ) Ċ Ċ /** Ċ Ġ* ĠCurrent Ġvalues Ġof Ġthe Ġmetrics . Ċ Ġ* Ċ Ġ* Ġ@ link Ġ[ Performance # metrics ]( https :// chrome devtools . github . io / devtools - protocol / tot / Performance # event - metrics ) Ġevent Ġdocumentation . Ċ Ġ*/ Ċ @ kotlin x . serialization . Serializable Ċ data Ġclass ĠMetrics Event ( ĊĠĠĠ Ġ/** ĠĠĊĠĠĠĠ Ġ* ĠCurrent Ġvalues Ġof Ġthe Ġmetrics . ĠĠĊĠĠĠĠ Ġ*/ ĠĠĊĠĠĠ Ġval Ġmetrics : ĠList < Metric >, ĊĊĠĠĠ Ġ/** ĠĠĊĠĠĠĠ Ġ* ĠTimestamp Ġtitle . ĠĠĊĠĠĠĠ Ġ*/ ĠĠĊĠĠĠ Ġval Ġtitle : ĠString Ċ Ċ ) Ġ: Ġpl . wend igo . chrome . protocol . Event Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġdomain () Ġ= Ġ" Performance " ĠĊĠĠĠ Ġoverride Ġfun ĠeventName () Ġ= Ġ" metrics " Ċ } ĠĊ