1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
U
[±dCã@s2ddlmZddlmZmZddlmZddlZddlZddl    m
Z
ddl    m Z eGdd    „d    ƒƒZ eGd
d „d ƒƒZ eGd d „d ƒƒZeGdd„dƒƒZeGdd„dƒƒZeGdd„dƒƒZeGdd„dƒƒZeGdd„dƒƒZeGdd„dƒƒZeGdd„dƒƒZddœdd„Zddœd d!„Zd"dœd#d$„Zd%dd&œd'd(„Zddœd)d*„ZdOd+d+d+d,d-œd.d/„Zddœd0d1„Zd2dœd3d4„Zddœd5d6„Zddœd7d8„Zd9dœd:d;„Z d<dœd=d>„Z!ddœd?d@„Z"ddœdAdB„Z#dCdœdDdE„Z$edFƒeGdGdH„dHƒƒƒZ%edIƒeGdJdK„dKƒƒƒZ&edLƒeGdMdN„dNƒƒƒZ'dS)Pé)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassN)Údebugger)Úruntimec@sfeZdZUdZded<ded<dZded<dZd    ed
<dZd ed <dZd ed<dd„Z    e
dd„ƒZ dS)Ú ProfileNodezY
    Profile node. Holds callsite information, execution statistics and child nodes.
    ÚintÚid_zruntime.CallFrameÚ
call_frameNztyping.Optional[int]Ú    hit_countú!typing.Optional[typing.List[int]]Úchildrenútyping.Optional[str]Ú deopt_reasonz.typing.Optional[typing.List[PositionTickInfo]]Úposition_tickscCs†tƒ}|j|d<|j ¡|d<|jdk    r2|j|d<|jdk    rPdd„|jDƒ|d<|jdk    rd|j|d<|jdk    r‚dd„|jDƒ|d    <|S)
NÚidÚ    callFrameÚhitCountcSsg|]}|‘qS©r©Ú.0Úirrúfd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v85/profiler.pyÚ
<listcomp>/sz'ProfileNode.to_json.<locals>.<listcomp>rÚ deoptReasoncSsg|] }| ¡‘qSr©Úto_jsonrrrrr3sÚ positionTicks)Údictr r rr rrr©ÚselfÚjsonrrrr(s
 
 
 
 
 
 
zProfileNode.to_jsonc    Cs„|t|dƒtj |d¡d|kr.t|dƒndd|krJdd„|dDƒndd|kr`t|dƒndd|kr|d    d„|dDƒndd
S) NrrrrcSsg|] }t|ƒ‘qSr©r
rrrrr<sz)ProfileNode.from_json.<locals>.<listcomp>rrcSsg|]}t |¡‘qSr)ÚPositionTickInfoÚ    from_jsonrrrrr>s)r r r rrr)r
rZ    CallFramer&Ústr©Úclsr#rrrr&6s
úzProfileNode.from_json) Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú__annotations__r rrrrÚ classmethodr&rrrrr    s
    r    c@sVeZdZUdZded<ded<ded<dZded    <dZded
<d d „Zed d„ƒZ    dS)ÚProfilez
    Profile.
    ztyping.List[ProfileNode]ÚnodesÚfloatÚ
start_timeÚend_timeNrÚsamplesÚ time_deltascCsntƒ}dd„|jDƒ|d<|j|d<|j|d<|jdk    rLdd„|jDƒ|d<|jdk    rjdd„|jDƒ|d    <|S)
NcSsg|] }| ¡‘qSrrrrrrrYsz#Profile.to_json.<locals>.<listcomp>r1Ú    startTimeÚendTimecSsg|]}|‘qSrrrrrrr]sr5cSsg|]}|‘qSrrrrrrr_sÚ
timeDeltas)r r1r3r4r5r6r!rrrrWs
 
 
 
zProfile.to_jsoncCsd|dd„|dDƒt|dƒt|dƒd|kr@dd„|dDƒndd|kr\d    d„|dDƒndd
S) NcSsg|]}t |¡‘qSr)r    r&rrrrresz%Profile.from_json.<locals>.<listcomp>r1r7r8r5cSsg|] }t|ƒ‘qSrr$rrrrrhsr9cSsg|] }t|ƒ‘qSrr$rrrrris)r1r3r4r5r6©r2r(rrrr&bs
 
ûzProfile.from_json)
r*r+r,r-r.r5r6rr/r&rrrrr0Bs
   r0c@s6eZdZUdZded<ded<dd„Zedd„ƒZd    S)
r%zP
    Specifies a number of samples attributed to a certain source position.
    r
ÚlineÚtickscCstƒ}|j|d<|j|d<|S)Nr;r<)r r;r<r!rrrrxs
 
zPositionTickInfo.to_jsoncCs|t|dƒt|dƒdS)Nr;r<)r;r<r$r(rrrr&~s
 
þzPositionTickInfo.from_jsonN©r*r+r,r-r.rr/r&rrrrr%ms
r%c@s>eZdZUdZded<ded<ded<dd„Zedd    „ƒZd
S) Ú CoverageRangez+
    Coverage data for a source range.
    r
Ú start_offsetÚ
end_offsetÚcountcCs(tƒ}|j|d<|j|d<|j|d<|S)NÚ startOffsetÚ    endOffsetrA)r r?r@rAr!rrrr”s
 
 
 
zCoverageRange.to_jsoncCs&|t|dƒt|dƒt|dƒdS)NrBrCrA)r?r@rAr$r(rrrr&›s
 
 
 
ýzCoverageRange.from_jsonNr=rrrrr>†s
r>c@s>eZdZUdZded<ded<ded<dd    „Zed
d „ƒZd S) ÚFunctionCoveragez2
    Coverage data for a JavaScript function.
    r'Ú function_nameztyping.List[CoverageRange]ÚrangesÚboolÚis_block_coveragecCs2tƒ}|j|d<dd„|jDƒ|d<|j|d<|S)NÚ functionNamecSsg|] }| ¡‘qSrrrrrrrµsz,FunctionCoverage.to_json.<locals>.<listcomp>rFÚisBlockCoverage)r rErFrHr!rrrr²s
 
 
zFunctionCoverage.to_jsoncCs,|t|dƒdd„|dDƒt|dƒdS)NrIcSsg|]}t |¡‘qSr)r>r&rrrrr½sz.FunctionCoverage.from_json.<locals>.<listcomp>rFrJ)rErFrH)r'rGr(rrrr&¹s
 
 
ýzFunctionCoverage.from_jsonNr=rrrrrD¤s
rDc@s>eZdZUdZded<ded<ded<dd    „Zed
d „ƒZd S) ÚScriptCoveragez0
    Coverage data for a JavaScript script.
    úruntime.ScriptIdÚ    script_idr'Úurlztyping.List[FunctionCoverage]Ú    functionscCs6tƒ}|j ¡|d<|j|d<dd„|jDƒ|d<|S)NÚscriptIdrNcSsg|] }| ¡‘qSrrrrrrrÔsz*ScriptCoverage.to_json.<locals>.<listcomp>rO)r rMrrNrOr!rrrrÐs
 
zScriptCoverage.to_jsoncCs0|tj |d¡t|dƒdd„|dDƒdS)NrPrNcSsg|]}t |¡‘qSr)rDr&rrrrrÜsz,ScriptCoverage.from_json.<locals>.<listcomp>rO)rMrNrO©rZScriptIdr&r'r(rrrr&×s
 
ýzScriptCoverage.from_jsonNr=rrrrrKÂs
rKc@s.eZdZUdZded<dd„Zedd„ƒZdS)    Ú
TypeObjectz4
    Describes a type collected during runtime.
    r'ÚnamecCstƒ}|j|d<|S)NrS)r rSr!rrrrès
zTypeObject.to_jsoncCs|t|dƒdS)NrS)rS)r'r(rrrr&ís
ÿzTypeObject.from_jsonNr=rrrrrRàs
 
rRc@s6eZdZUdZded<ded<dd„Zedd    „ƒZd
S) ÚTypeProfileEntryzB
    Source offset and types for a parameter or return value.
    r
Úoffsetztyping.List[TypeObject]ÚtypescCs(tƒ}|j|d<dd„|jDƒ|d<|S)NrUcSsg|] }| ¡‘qSrrrrrrrsz,TypeProfileEntry.to_json.<locals>.<listcomp>rV)r rUrVr!rrrrÿs
zTypeProfileEntry.to_jsoncCs"|t|dƒdd„|dDƒdS)NrUcSsg|]}t |¡‘qSr)rRr&rrrrr    sz.TypeProfileEntry.from_json.<locals>.<listcomp>rV)rUrVr$r(rrrr&s
þzTypeProfileEntry.from_jsonNr=rrrrrTôs
rTc@s>eZdZUdZded<ded<ded<dd    „Zed
d „ƒZd S) ÚScriptTypeProfilezM
    Type profile data collected during runtime for a JavaScript script.
    rLrMr'rNztyping.List[TypeProfileEntry]ÚentriescCs6tƒ}|j ¡|d<|j|d<dd„|jDƒ|d<|S)NrPrNcSsg|] }| ¡‘qSrrrrrrrsz-ScriptTypeProfile.to_json.<locals>.<listcomp>rX)r rMrrNrXr!rrrrs
 
zScriptTypeProfile.to_jsoncCs0|tj |d¡t|dƒdd„|dDƒdS)NrPrNcSsg|]}t |¡‘qSr)rTr&rrrrr'sz/ScriptTypeProfile.from_json.<locals>.<listcomp>rX)rMrNrXrQr(rrrr&"s
 
ýzScriptTypeProfile.from_jsonNr=rrrrrW s
rWc@s6eZdZUdZded<ded<dd„Zedd    „ƒZd
S) Ú CounterInfoz(
    Collected counter information.
    r'rSr
ÚvaluecCstƒ}|j|d<|j|d<|S)NrSrZ)r rSrZr!rrrr6s
 
zCounterInfo.to_jsoncCs|t|dƒt|dƒdS)NrSrZ)rSrZ)r'r
r(rrrr&<s
 
þzCounterInfo.from_jsonNr=rrrrrY+s
rYz0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])Úreturnccsddi}|V}dS)NÚmethodzProfiler.disabler©Úcmd_dictr#rrrÚdisableDsÿr_ccsddi}|V}dS)Nr\zProfiler.enablerr]rrrÚenableLsÿr`zGtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[ScriptCoverage]]ccs ddi}|V}dd„|dDƒS)z±
    Collect coverage data for the current isolate. The coverage data may be incomplete due to
    garbage collection.
 
    :returns: Coverage data for the current isolate.
    r\zProfiler.getBestEffortCoveragecSsg|]}t |¡‘qSr©rKr&rrrrr_sz,get_best_effort_coverage.<locals>.<listcomp>Úresultrr]rrrÚget_best_effort_coverageTs
ÿrcr
)Úintervalr[ccs"tƒ}||d<d|dœ}|V}dS)z¤
    Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
 
    :param interval: New sampling interval in microseconds.
    rdzProfiler.setSamplingInterval©r\ÚparamsN)r )rdrfr^r#rrrÚset_sampling_intervalbs þrgccsddi}|V}dS)Nr\zProfiler.startrr]rrrÚstartssÿrhztyping.Optional[bool]z1typing.Generator[T_JSON_DICT, T_JSON_DICT, float])Ú
call_countÚdetailedÚallow_triggered_updatesr[ccsRtƒ}|dk    r||d<|dk    r&||d<|dk    r6||d<d|dœ}|V}t|dƒS)aW
    Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code
    coverage may be incomplete. Enabling prevents running optimized code and resets execution
    counters.
 
    :param call_count: *(Optional)* Collect accurate call counts beyond simple 'covered' or 'not covered'.
    :param detailed: *(Optional)* Collect block-based coverage.
    :param allow_triggered_updates: *(Optional)* Allow the backend to send updates on its own initiative
    :returns: Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
    NZ    callCountrjZallowTriggeredUpdateszProfiler.startPreciseCoveragereÚ    timestamp)r r2)rirjrkrfr^r#rrrÚstart_precise_coverage{sþrmccsddi}|V}dS)z4
    Enable type profile.
 
    **EXPERIMENTAL**
    r\zProfiler.startTypeProfileNrr]rrrÚstart_type_profile™sÿrnz3typing.Generator[T_JSON_DICT, T_JSON_DICT, Profile]ccsddi}|V}t |d¡S)z'
 
 
    :returns: Recorded profile.
    r\z Profiler.stopÚprofile)r0r&r]rrrÚstop¥s
ÿrpccsddi}|V}dS)zˆ
    Disable precise code coverage. Disabling releases unnecessary execution count records and allows
    executing optimized code.
    r\zProfiler.stopPreciseCoverageNrr]rrrÚstop_precise_coverage²sÿrqccsddi}|V}dS)zl
    Disable type profile. Disabling releases type profile data collected so far.
 
    **EXPERIMENTAL**
    r\zProfiler.stopTypeProfileNrr]rrrÚstop_type_profile½sÿrrz\typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[ScriptCoverage], float]]ccs,ddi}|V}dd„|dDƒt|dƒfS)ar
    Collect coverage data for the current isolate, and resets execution counters. Precise code
    coverage needs to have started.
 
    :returns: A tuple with the following items:
 
        0. **result** - Coverage data for the current isolate.
        1. **timestamp** - Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
    r\zProfiler.takePreciseCoveragecSsg|]}t |¡‘qSrrarrrrrØsz)take_precise_coverage.<locals>.<listcomp>rbrlr:r]rrrÚtake_precise_coverageÉs ÿ
þrszJtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[ScriptTypeProfile]]ccs ddi}|V}dd„|dDƒS)z‰
    Collect type profile.
 
    **EXPERIMENTAL**
 
    :returns: Type profile for all scripts since startTypeProfile() was turned on.
    r\zProfiler.takeTypeProfilecSsg|]}t |¡‘qSr)rWr&rrrrrész%take_type_profile.<locals>.<listcomp>rbrr]rrrÚtake_type_profileÝs
    ÿrtccsddi}|V}dS)zF
    Enable run time call stats collection.
 
    **EXPERIMENTAL**
    r\zProfiler.enableRuntimeCallStatsNrr]rrrÚenable_runtime_call_statsìsÿruccsddi}|V}dS)zG
    Disable run time call stats collection.
 
    **EXPERIMENTAL**
    r\z Profiler.disableRuntimeCallStatsNrr]rrrÚdisable_runtime_call_statsøsÿrvzDtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[CounterInfo]]ccs ddi}|V}dd„|dDƒS)zk
    Retrieve run time call stats.
 
    **EXPERIMENTAL**
 
    :returns: Collected counter information.
    r\zProfiler.getRuntimeCallStatscSsg|]}t |¡‘qSr)rYr&rrrrrsz*get_runtime_call_stats.<locals>.<listcomp>rbrr]rrrÚget_runtime_call_statss
    ÿrwzProfiler.consoleProfileFinishedc@sBeZdZUded<ded<ded<ded<ed    dd
œd d „ƒZd S)ÚConsoleProfileFinishedr'r údebugger.LocationÚlocationr0rorÚtitler©r#r[cCsB|t|dƒtj |d¡t |d¡d|kr:t|dƒnddS)Nrrzror{)r rzror{)r'rÚLocationr&r0r(rrrr&s 
 üz ConsoleProfileFinished.from_jsonN)r*r+r,r.r/r&rrrrrxs
rxzProfiler.consoleProfileStartedc@s>eZdZUdZded<ded<ded<eddd    œd
d „ƒZd S) ÚConsoleProfileStartedzR
    Sent when new profile recording is started using console.profile() call.
    r'r ryrzrr{rr|cCs6|t|dƒtj |d¡d|kr.t|dƒnddS)Nrrzr{)r rzr{)r'rr}r&r(rrrr&3s
 
ýzConsoleProfileStarted.from_jsonN©r*r+r,r-r.r/r&rrrrr~'s
r~z#Profiler.preciseCoverageDeltaUpdatec@s>eZdZUdZded<ded<ded<eddd    œd
d „ƒZd S) ÚPreciseCoverageDeltaUpdateat
    **EXPERIMENTAL**
 
    Reports coverage delta since the last poll (either from an event like this, or from
    ``takePreciseCoverage`` for the current isolate. May only be sent if precise code
    coverage has been started. This event can be trigged by the embedder to, for example,
    trigger collection of coverage data immediatelly at a certain point in time.
    r2rlr'Ú    occassionztyping.List[ScriptCoverage]rbrr|cCs,|t|dƒt|dƒdd„|dDƒdS)NrlrcSsg|]}t |¡‘qSrrarrrrrSsz8PreciseCoverageDeltaUpdate.from_json.<locals>.<listcomp>rb)rlrrb)r2r'r(rrrr&Ns
 
 
ýz$PreciseCoverageDeltaUpdate.from_jsonNrrrrrr€<s
    r€)NNN)(Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingÚrrr    r0r%r>rDrKrRrTrWrYr_r`rcrgrhrmrnrprqrrrsrtrurvrwrxr~r€rrrrÚ<module>sj    1*    ý