
     f5                       d dl mZ ddlmZmZ d dlmZ d dlZd dlZddl	m
Z
  G d de          Ze G d	 d
                      Ze G d d                      Ze G d d                      Zd>dZd?dZd?dZd?dZd@dZ	 dAdBdZdCdZ	 	 	 dDdEd%Z	 dAdFd'ZdCd(Z	 	 	 	 dGdHd-Z	 	 	 	 dGdHd.Z ed/          e G d0 d1                                  Z ed2          e G d3 d4                                  Z ed5          e G d6 d7                                  Z ed8          e G d9 d:                                  Z ed;          e G d< d=                                  Z dS )I    )annotations   )event_classT_JSON_DICT)	dataclassN)runtimec                  B     e Zd ZdZddZed	d            Z fdZ xZS )
HeapSnapshotObjectIdz"
    Heap snapshot object id.
    returnstrc                    | S N )selfs    x/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/selenium/webdriver/common/devtools/v127/heap_profiler.pyto_jsonzHeapSnapshotObjectId.to_json   s        jsonc                     | |          S r   r   clsr   s     r   	from_jsonzHeapSnapshotObjectId.from_json   s    s4yyr   c                j    d                     t                                                                S )NzHeapSnapshotObjectId({}))formatsuper__repr__)r   	__class__s    r   r   zHeapSnapshotObjectId.__repr__   s'    )001A1A1C1CDDDr   )r   r   )r   r   r   r
   )	__name__
__module____qualname____doc__r   classmethodr   r   __classcell__)r   s   @r   r
   r
      s                [E E E E E E E E Er   r
   c                  X    e Zd ZU dZded<   ded<   ded<   ded	<   d
 Zed             ZdS )SamplingHeapProfileNodezh
    Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
    zruntime.CallFrame
call_framefloat	self_sizeintid_z$typing.List[SamplingHeapProfileNode]childrenc                    t                      }| j                                        |d<   | j        |d<   | j        |d<   d | j        D             |d<   |S )N	callFrameselfSizeidc                6    g | ]}|                                 S r   r   .0is     r   
<listcomp>z3SamplingHeapProfileNode.to_json.<locals>.<listcomp>4   s     ???AAIIKK???r   r+   )dictr&   r   r(   r*   r+   r   r   s     r   r   zSamplingHeapProfileNode.to_json/   sY    vv O3355[>ZXT
?????Zr   c                     | t           j                            |d                   t          |d                   t	          |d                   d |d         D                       S )Nr-   r.   r/   c                B    g | ]}t                               |          S r   r%   r   r2   s     r   r5   z5SamplingHeapProfileNode.from_json.<locals>.<listcomp>=   s'    UUUq-77::UUUr   r+   )r&   r(   r*   r+   )r   	CallFramer   r'   r)   r   s     r   r   z!SamplingHeapProfileNode.from_json7   sg    s(2243DEED,--DJUUDDTUUU	
 
 
 	
r   Nr   r   r    r!   __annotations__r   r"   r   r   r   r   r%   r%      s           "!!!  HHH 3222   
 
 [
 
 
r   r%   c                  N    e Zd ZU dZded<   ded<   ded<   d Zed             Zd	S )
SamplingHeapProfileSamplez2
    A single sample from a sampling profile.
    r'   sizer)   node_idordinalc                ^    t                      }| j        |d<   | j        |d<   | j        |d<   |S )Nr@   nodeIdrB   )r6   r@   rA   rB   r7   s     r   r   z!SamplingHeapProfileSample.to_jsonP   s1    vvyVX,Yr   c                     | t          |d                   t          |d                   t          |d                             S )Nr@   rD   rB   )r@   rA   rB   )r'   r)   r   s     r   r   z#SamplingHeapProfileSample.from_jsonW   sH    stF|$$X''$y/**
 
 
 	
r   Nr<   r   r   r   r?   r?   A   sk           KKK LLL NNN   
 
 [
 
 
r   r?   c                  D    e Zd ZU dZded<   ded<   d Zed             ZdS )	SamplingHeapProfilez
    Sampling profile.
    r%   headz&typing.List[SamplingHeapProfileSample]samplesc                    t                      }| j                                        |d<   d | j        D             |d<   |S )NrH   c                6    g | ]}|                                 S r   r1   r2   s     r   r5   z/SamplingHeapProfile.to_json.<locals>.<listcomp>l   s     ===1199;;===r   rI   )r6   rH   r   rI   r7   s     r   r   zSamplingHeapProfile.to_jsoni   s@    vvy((**V=====Yr   c                x     | t                               |d                   d |d         D                       S )NrH   c                B    g | ]}t                               |          S r   )r?   r   r2   s     r   r5   z1SamplingHeapProfile.from_json.<locals>.<listcomp>s   s'    UUU.88;;UUUr   rI   )rH   rI   r:   r   s     r   r   zSamplingHeapProfile.from_jsono   sE    s(224<@@UUT)_UUU
 
 
 	
r   Nr<   r   r   r   rG   rG   `   sd           "!!!3333   
 
 [
 
 
r   rG   heap_object_idr   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c              #  f   K   t                      }|                                 |d<   d|d}|V }dS )z
    Enables console to refer to the node with given id via $x (see Command Line API for more details
    $x functions).

    :param heap_object_id: Heap snapshot object id to be accessible by means of $x command line API.
    heapObjectIdz#HeapProfiler.addInspectedHeapObjectmethodparamsN)r6   r   )rN   rT   cmd_dictr   s       r   add_inspected_heap_objectrV   w   sH       &&F+3355F>7 H >>DDDr   c               #     K   ddi} | V }d S )NrS   zHeapProfiler.collectGarbager   rU   r   s     r   collect_garbagerY      s$       	/H >>DDDr   c               #     K   ddi} | V }d S )NrS   zHeapProfiler.disabler   rX   s     r   disabler[      s$       	(H >>DDDr   c               #     K   ddi} | V }d S )NrS   zHeapProfiler.enabler   rX   s     r   enabler]      s$       	'H >>DDDr   	object_idruntime.RemoteObjectId@typing.Generator[T_JSON_DICT, T_JSON_DICT, HeapSnapshotObjectId]c              #     K   t                      }|                                 |d<   d|d}|V }t                              |d                   S )z
    :param object_id: Identifier of the object to get heap object id for.
    :returns: Id of the heap snapshot object corresponding to the passed remote object id.
    objectIdzHeapProfiler.getHeapObjectIdrR   heapSnapshotObjectId)r6   r   r
   r   )r^   rT   rU   r   s       r   get_heap_object_idrd      s^       &&F"**,,F:0 H >>D))$/E*FGGGr   object_grouptyping.Optional[str]@typing.Generator[T_JSON_DICT, T_JSON_DICT, runtime.RemoteObject]c              #     K   t                      }|                                 |d<   |||d<   d|d}|V }t          j                            |d                   S )z
    :param object_id:
    :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects.
    :returns: Evaluation result.
    rb   NobjectGroupz$HeapProfiler.getObjectByHeapObjectIdrR   result)r6   r   r   RemoteObjectr   )r^   re   rT   rU   r   s        r   get_object_by_heap_object_idrl      so       &&F"**,,F: ,}8 H >>D))$x.999r   ?typing.Generator[T_JSON_DICT, T_JSON_DICT, SamplingHeapProfile]c               #  V   K   ddi} | V }t                               |d                   S )zB


    :returns: Return the sampling profile being collected.
    rS   zHeapProfiler.getSamplingProfileprofilerG   r   rX   s     r   get_sampling_profilerq      s8       	3H >>D((i999r   sampling_intervaltyping.Optional[float]%include_objects_collected_by_major_gctyping.Optional[bool]%include_objects_collected_by_minor_gcc              #  b   K   t                      }| | |d<   |||d<   |||d<   d|d}|V }dS )a  
    :param sampling_interval: *(Optional)* Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
    :param include_objects_collected_by_major_gc: *(Optional)* By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by major GC, which will show which functions cause large temporary memory usage or long GC pauses.
    :param include_objects_collected_by_minor_gc: *(Optional)* By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by minor GC, which is useful when tuning a latency-sensitive application for minimal GC activity.
    NsamplingInterval includeObjectsCollectedByMajorGC includeObjectsCollectedByMinorGCzHeapProfiler.startSamplingrR   r6   )rr   rt   rv   rT   rU   r   s         r   start_samplingr|      se       &&F$%6!",85Z12,85Z12. H >>DDDr   track_allocationsc              #  F   K   t                      }| | |d<   d|d}|V }dS )z0
    :param track_allocations: *(Optional)*
    NtrackAllocationsz%HeapProfiler.startTrackingHeapObjectsrR   r{   )r}   rT   rU   r   s       r   start_tracking_heap_objectsr      sC       &&F$%6!"9 H >>DDDr   c               #  V   K   ddi} | V }t                               |d                   S )z5


    :returns: Recorded sampling heap profile.
    rS   zHeapProfiler.stopSamplingro   rp   rX   s     r   stop_samplingr      s8       	-H >>D((i999r   report_progresstreat_global_objects_as_rootscapture_numeric_valueexpose_internalsc              #  p   K   t                      }| | |d<   |||d<   |||d<   |||d<   d|d}|V }dS )a  
    :param report_progress: *(Optional)* If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
    :param treat_global_objects_as_roots: *(Optional)* Deprecated in favor of ```exposeInternals```.
    :param capture_numeric_value: *(Optional)* If true, numerical values are included in the snapshot
    :param expose_internals: **(EXPERIMENTAL)** *(Optional)* If true, exposes internals of the snapshot.
    NreportProgresstreatGlobalObjectsAsRootscaptureNumericValueexposeInternalsz$HeapProfiler.stopTrackingHeapObjectsrR   r{   r   r   r   r   rT   rU   r   s          r   stop_tracking_heap_objectsr   	  sv       &&F"#2 $0.K*+((=$%#$4 !8 H >>DDDr   c              #  p   K   t                      }| | |d<   |||d<   |||d<   |||d<   d|d}|V }dS )a  
    :param report_progress: *(Optional)* If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
    :param treat_global_objects_as_roots: *(Optional)* If true, a raw snapshot without artificial roots will be generated. Deprecated in favor of ```exposeInternals```.
    :param capture_numeric_value: *(Optional)* If true, numerical values are included in the snapshot
    :param expose_internals: **(EXPERIMENTAL)** *(Optional)* If true, exposes internals of the snapshot.
    Nr   r   r   r   zHeapProfiler.takeHeapSnapshotrR   r{   r   s          r   take_heap_snapshotr   %  sv       &&F"#2 $0.K*+((=$%#$4 !1 H >>DDDr   z!HeapProfiler.addHeapSnapshotChunkc                  2    e Zd ZU ded<   edd            ZdS )	AddHeapSnapshotChunkr   chunkr   r   r   c                @     | t          |d                             S )Nr   )r   )r   r   s     r   r   zAddHeapSnapshotChunk.from_jsonF  s*    sd7m$$
 
 
 	
r   N)r   r   r   r   r   r   r    r=   r"   r   r   r   r   r   r   A  s?          JJJ
 
 
 [
 
 
r   r   zHeapProfiler.heapStatsUpdatec                  6    e Zd ZU dZded<   ed	d            ZdS )
HeapStatsUpdatezj
    If heap objects tracking has been started then backend may send update for one or more fragments
    ztyping.List[int]stats_updater   r   r   c                :     | d |d         D                       S )Nc                ,    g | ]}t          |          S r   )r)   r2   s     r   r5   z-HeapStatsUpdate.from_json.<locals>.<listcomp>[  s    >>>Q#a&&>>>r   statsUpdate)r   r   r   s     r   r   zHeapStatsUpdate.from_jsonX  s1    s>>$}*=>>>
 
 
 	
r   N)r   r   r   r   r   r   r    r!   r=   r"   r   r   r   r   r   r   M  sL           #"""
 
 
 [
 
 
r   r   zHeapProfiler.lastSeenObjectIdc                  @    e Zd ZU dZded<   ded<   edd	            Zd
S )LastSeenObjectIda(  
    If heap objects tracking has been started then backend regularly sends a current value for last
    seen object id and corresponding timestamp. If the were changes in the heap since last event
    then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
    r)   last_seen_object_idr'   	timestampr   r   r   c                h     | t          |d                   t          |d                             S )NlastSeenObjectIdr   )r   r   )r)   r'   r   s     r   r   zLastSeenObjectId.from_jsonj  s<    s #D);$< = =D-..
 
 
 	
r   N)r   r   r   r   r   r   r   r   r   r   _  sX          
 
 
 
 [
 
 
r   r   z'HeapProfiler.reportHeapSnapshotProgressc                  F    e Zd ZU ded<   ded<   ded<   edd	            Zd
S )ReportHeapSnapshotProgressr)   donetotalru   finishedr   r   r   c                     | t          |d                   t          |d                   d|v rt          |d                   nd           S )Nr   r   r   )r   r   r   )r)   boolr   s     r   r   z$ReportHeapSnapshotProgress.from_jsony  sX    sT&\""d7m$$/9T/A/AT$z*+++t
 
 
 	
r   N)r   r   r   r   r   r   r   r   r   r   r  sT          IIIJJJ####
 
 
 [
 
 
r   r   zHeapProfiler.resetProfilesc                  &    e Zd Zedd            ZdS )ResetProfilesr   r   r   c                     |             S r   r   r   s     r   r   zResetProfiles.from_json  s    s 
 
 	
r   N)r   r   r   r   )r   r   r    r"   r   r   r   r   r   r     s4        
 
 
 
 [
 
 
r   r   )rN   r
   r   rO   )r   rO   )r^   r_   r   r`   r   )r^   r
   re   rf   r   rg   )r   rm   )NNN)rr   rs   rt   ru   rv   ru   r   rO   )r}   ru   r   rO   )NNNN)
r   ru   r   ru   r   ru   r   ru   r   rO   )!
__future__r   utilr   r   dataclassesr   enumtyping r   r   r
   r%   r?   rG   rV   rY   r[   r]   rd   rl   rq   r|   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s   # " " " " " * * * * * * * * ! ! ! ! ! !        E E E E E3 E E E 
 
 
 
 
 
 
 
D 
 
 
 
 
 
 
 
< 
 
 
 
 
 
 
 
,   $         H H H H& .2: : : : :*
: 
: 
: 
: 59GKGK    2 48     
: 
: 
: 
: 26?C7;26	    : 26?C7;26	    8 011

 
 
 
 
 
 
  21
 +,,

 
 
 
 
 
 
  -,
  ,--

 
 
 
 
 
 
  .-
" 677

 
 
 
 
 
 
  87
 )**

 
 
 
 
 
 
  +*
 
 
r   