zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
U
[±d‚2ã@s–ddlmZddlmZmZddlmZddlZddlZddl    m
Z
ddl    m Z eGdd    „d    ƒƒZ eGd
d „d ƒƒZ eGd d „d ƒƒZeGdd„dƒƒZeGdd„dƒƒZeGdd„dƒƒZddœdd„Zddœdd„Zddœdd„Zdddœdd „Zddœd!d"„Zd9d#d#d#d$d%œd&d'„Zd(dœd)d*„Zddœd+d,„Zd-dœd.d/„Zed0ƒeGd1d2„d2ƒƒƒZed3ƒeGd4d5„d5ƒƒƒZed6ƒeGd7d8„d8ƒƒƒZdS):é)Ú 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úgd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v111/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.
    zruntime.ScriptIdÚ    script_idr'Úurlztyping.List[FunctionCoverage]Ú    functionscCs6tƒ}|j ¡|d<|j|d<dd„|jDƒ|d<|S)NÚscriptIdrMcSsg|] }| ¡‘qSrrrrrrrÔsz*ScriptCoverage.to_json.<locals>.<listcomp>rN)r rLrrMrNr!rrrrÐs
 
zScriptCoverage.to_jsoncCs0|tj |d¡t|dƒdd„|dDƒdS)NrOrMcSsg|]}t |¡‘qSr)rDr&rrrrrÜsz,ScriptCoverage.from_json.<locals>.<listcomp>rN)rLrMrN)rZScriptIdr&r'r(rrrr&×s
 
ýzScriptCoverage.from_jsonNr=rrrrrKÂs
rKz0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])Úreturnccsddi}|V}dS)NÚmethodzProfiler.disabler©Úcmd_dictr#rrrÚdisableàsÿrTccsddi}|V}dS)NrQzProfiler.enablerrRrrrÚenableèsÿrUzGtyping.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.
    rQzProfiler.getBestEffortCoveragecSsg|]}t |¡‘qSr©rKr&rrrrrûsz,get_best_effort_coverage.<locals>.<listcomp>ÚresultrrRrrrÚget_best_effort_coverageðs
ÿrXr
)ÚintervalrPccs"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.
    rYzProfiler.setSamplingInterval©rQÚparamsN)r )rYr[rSr#rrrÚset_sampling_intervalþs þr\ccsddi}|V}dS)NrQzProfiler.startrrRrrrÚstartsÿr]ztyping.Optional[bool]z1typing.Generator[T_JSON_DICT, T_JSON_DICT, float])Ú
call_countÚdetailedÚallow_triggered_updatesrPccsRtƒ}|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    callCountr_ZallowTriggeredUpdateszProfiler.startPreciseCoveragerZÚ    timestamp)r r2)r^r_r`r[rSr#rrrÚstart_precise_coveragesþrbz3typing.Generator[T_JSON_DICT, T_JSON_DICT, Profile]ccsddi}|V}t |d¡S)z'
 
 
    :returns: Recorded profile.
    rQz Profiler.stopÚprofile)r0r&rRrrrÚstop5s
ÿrdccsddi}|V}dS)zˆ
    Disable precise code coverage. Disabling releases unnecessary execution count records and allows
    executing optimized code.
    rQzProfiler.stopPreciseCoverageNrrRrrrÚstop_precise_coverageBsÿrez\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.
    rQzProfiler.takePreciseCoveragecSsg|]}t |¡‘qSrrVrrrrr\sz)take_precise_coverage.<locals>.<listcomp>rWrar:rRrrrÚtake_precise_coverageMs ÿ
þrfzProfiler.consoleProfileFinishedc@sBeZdZUded<ded<ded<ded<ed    dd
œd d „ƒZd S)ÚConsoleProfileFinishedr'r údebugger.LocationÚlocationr0rcrÚtitler©r#rPcCsB|t|dƒtj |d¡t |d¡d|kr:t|dƒnddS)Nrrircrj)r rircrj)r'rÚLocationr&r0r(rrrr&ks 
 üz ConsoleProfileFinished.from_jsonN)r*r+r,r.r/r&rrrrrgas
rgzProfiler.consoleProfileStartedc@s>eZdZUdZded<ded<ded<eddd    œd
d „ƒZd S) ÚConsoleProfileStartedzR
    Sent when new profile recording is started using console.profile() call.
    r'r rhrirrjrrkcCs6|t|dƒtj |d¡d|kr.t|dƒnddS)Nrrirj)r rirj)r'rrlr&r(rrrr&s
 
ýzConsoleProfileStarted.from_jsonN©r*r+r,r-r.r/r&rrrrrmus
rmz#Profiler.preciseCoverageDeltaUpdatec@s>eZdZUdZded<ded<ded<eddd    œd
d „ƒZd S) ÚPreciseCoverageDeltaUpdateas
    **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 immediately at a certain point in time.
    r2rar'Úoccasionztyping.List[ScriptCoverage]rWrrkcCs,|t|dƒt|dƒdd„|dDƒdS)NrarpcSsg|]}t |¡‘qSrrVrrrrr¡sz8PreciseCoverageDeltaUpdate.from_json.<locals>.<listcomp>rW)rarprW)r2r'r(rrrr&œs
 
 
ýz$PreciseCoverageDeltaUpdate.from_jsonNrnrrrrroŠs
    ro)NNN)Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingÚrrr    r0r%r>rDrKrTrUrXr\r]rbrdrerfrgrmrorrrrÚ<module>sN    1*    ý