403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.141
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/profiling/sampling/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/profiling/sampling/__pycache__/jsonl_collector.cpython-315.opt-1.pyc
R
>lqj�#c�v�Qs]QHGs]PHs]PHs]QHGs]QHGs]QH$G
s
]QH,GsQs
]sQQ\2sP!)	a�
JSON Lines (JSONL) collector for the sampling profiler.

Emits a normalized newline-delimited JSON record stream suitable for
programmatic consumption by external tools, scripts, and agents. Each line
is one JSON object; consumers can parse the file incrementally line by
line, but the producer writes the whole file at the end of the run (it is
not a live/streaming producer).

Record schema
=============

Every record is a JSON object with at least ``"type"``, ``"v"`` (record
schema version), and ``"run_id"`` (UUID4 hex tagging the run; allows
demultiplexing concatenated streams). Records appear in this fixed order:

1. ``meta`` (exactly one, first line)::

      {"type":"meta","v":0,"run_id":"<hex>",
       "sample_interval_usec":<int>,"mode":"wall|cpu|gil|all|exception"}

   ``mode`` is omitted when not provided.

2. ``string_table`` (zero or more)::

      {"type":"string_table","v":0,"run_id":"<hex>",
       "strings":[{"str_id":<int>,"value":"<str>"}, ...]}

   Strings (filenames, function names) are interned to keep repeated values
   compact. IDs are zero-based. Each chunk holds up to ``_CHUNK_SIZE``
   entries, and each entry carries its explicit ``str_id`` so consumers do
   not need to infer offsets across chunks.

3. ``frame_table`` (zero or more)::

      {"type":"frame_table","v":0,"run_id":"<hex>",
       "frames":[{"frame_id":<int>,"path_str_id":<int>,"func_str_id":<int>,
                  "line":<int>,"end_line":<int>,"col":<int>,
                  "end_col":<int>}, ...]}

   ``end_line``/``col``/``end_col`` are *omitted* when source location data
   is unavailable (a missing key means "not available", not zero or null).
   ``line`` is ``0`` for synthetic frames (for example, internal marker
   frames whose source location is None). Frame IDs are zero-based.

4. ``agg`` (zero or more)::

      {"type":"agg","v":0,"run_id":"<hex>","kind":"frame","scope":"final",
       "samples_total":<int>,
       "entries":[{"frame_id":<int>,"self":<int>,"cumulative":<int>}, ...]}

   ``self`` counts samples where the frame was the leaf (currently
   executing); ``cumulative`` counts samples where the frame appeared
   anywhere in the stack (deduped per sample so recursion does not
   double-count). ``samples_total`` is the run-wide total, repeated on
   each chunk so a streaming consumer always knows the denominator.

5. ``end`` (exactly one, last line)::

      {"type":"end","v":0,"run_id":"<hex>","samples_total":<int>}

   Presence of ``end`` is the consumer's signal that the file is complete.

Forward compatibility
=====================

Consumers MUST ignore unknown record ``"type"`` values and unknown object
fields. New fields will be added by adding optional keys; an incompatible
schema change will bump the per-record ``"v"``.
)�Counter)�batched)�PROFILING_MODE_NAMES��normalize_location)�StackTraceCollector�c�``�\sQs]UsnQsQP
QP-U1QkksQQksQsQsQs	Q	s
Q
sQs\
Q2sQ
s\
Q2sQsUsU9s!)�JsonlCollectorz�Collector that exports finalized profiling data as JSONL.

See the module docstring for the full record schema. The collector
accumulates samples in memory and writes the complete file at
``export()`` time.
�	skip_idle�modec�:�[RU_VQ5[O2OUm-Um,Um-Um,Um	[2Um[2Um]Um
[2UmV0mP!))r
)�super�__init__�uuid�uuid4�hex�run_id�
_string_to_id�_strings�_frame_to_id�_framesr�_frame_self�_frame_cumulative�_samples_total�set�_seen_frame_ids�_mode)�self�sample_interval_usecr
r�	__class__s&&$$��7C:\Python315\\Lib\profiling\sampling\jsonl_collector.pyr�JsonlCollector.__init__]sp���
���-��C��j�j�l�&�&��������
�������"�9���!(�������"�u����
�c���U9OU*
tmUOO2[U2FD�vovqVqxUO	VVU2o	U]6Ho
V�O7oU%cUOOU	2U
%c UOU	99*U*
tt$U%fJ�UOU	99*U*
tt$J�	P!)�)rr�clear�	enumerate�_get_or_create_frame_id�addrr)r�frames�
_thread_id�weight�i�filename�location�funcname�_opcode�frame_id�is_leaf�count_cumulatives&&&&        r �process_frames�JsonlCollector.process_framesns������v�%�����"�"�$�:C�F�:K�6�A�6��H��3�3��H��H��1�f�G�'�/C�/C�C����$�$�(�(��2��� � ��*�f�4�*����&�&�x�0�F�:�0�;Lr"c�X�[UQQQ59^tt^2oUOV O22UOUQQQ[QUO
-QUO2UOUQQQ[QUO
-Q	UO2UOUQQ
Q[QUO
QQQ
QQUO-QUO22UOV O22PPP2[QU02P	!)%fhK 9h)�wzutf-8)�encoding�type�string_table�vr�strings�frame_tabler)�agg�kind�frame�scope�final�
samples_total�entrieszJSONL profile written to )�open�_write_message�_build_meta_record�_write_chunked_records�_SCHEMA_VERSIONrrrr�_iter_final_agg_entries�_build_end_record�print)rr-�outputs&& r �export�JsonlCollector.export�s&��
�(�C�'�
2�
2�f�����(?�(?�(A�B��'�'���N����d�k�k��
��
�
�	
�
�'�'���M����d�k�k��
����	
�
�'�'���E����d�k�k��G��W�#�T�%8�%8�
���,�,�.�
�
����(>�(>�(@�A�G3�H	�)�(��4�5��K3�
2�s�C)D�D)	�"D)	c���QQQ[QUOQUO-oUOd8[O
UO[
UO22UQ$U!)r9�metar;rrr)rIrrrr�get�str�r�records& r rG�!JsonlCollector._build_meta_record�s_���F����d�k�k�"�D�$=�$=�	
���:�:�!�1�5�5��
�
�C��
�
�O��F�6�N��
r"c�L�QQQ[QUOQUO-oU!)r9�endr;rrC)rIrrrTs& r rK� JsonlCollector._build_end_record�s.���E����d�k�k��T�0�0�	
���
r"c	#� �UOFD9oUQ*oQUQUOU*QUOU*-w�	J;	P!3h)r1r�
cumulative)rrr)r�frame_recordr1s&  r rJ�&JsonlCollector._iter_final_agg_entries�sL��� �L�L�L�#�J�/�H��H���(�(��2��d�4�4�X�>��
�)�s�AAc��UOU2oUOU2oUOU2oUUUQ*UOQ2UOQ2UOQ21oUOOU29odU![	UO
2oQUQUQU-UAo	V�OU$UO
O
U	2U!)�line�end_line�col�end_colr1�path_str_id�func_str_id)�_location_to_export_fields�_intern_stringrRr�lenr�append)
rr-r.r/�location_fieldsrdrc�	frame_keyr1r\s
&&&&      r r'�&JsonlCollector._get_or_create_frame_id�s����9�9�(�C���)�)�(�3���)�)�(�3��
���F�#����
�+�����&����	�*�

�	��)�)�-�-�i�8�8�H�E��O��t�|�|�$�����;��;�
��	
��(0���)�$������L�)��r"c���[U2oUOOU29odU![UO2oV OU$UOOQUQU-2U!)N�str_id�value)rSrrRrgrrh)rrn�	string_ids&& r rf�JsonlCollector._intern_string�sj���E�
���+�+�/�/��6�6�I�C�����
�
�&�	�$-���5�!��
�
���h�	�7�E�B�C��r"c�n�[U2vqq4QU-oU]6�cV%Q$U]6�cV5Q$U]6�cVEQ$U!)r_r`rarbr)r.�lineno�
end_lineno�
col_offset�end_col_offset�fieldss&     r re�)JsonlCollector._location_to_export_fields�sR��9K��:
�6��J��&�!����>�!+�:����?�&�5�M��Q�� .�9���
r"c�f�[U[2FDoUOU-UAV5-A2J	P!)N)r�_CHUNK_SIZErF)rrM�base_record�chunk_fieldrD�chunks&&&&& r rH�%JsonlCollector._write_chunked_recordss0���W�k�2�E�����(K�;�(K��(K�L�3r"c�x�UO[OUQQ52UOQ2P!)�,)�
separators�
)r�:)�write�json�dumps)rMrUs&&r rF�JsonlCollector._write_message	s%�����T�Z�Z��:�>�?����T�r")
rrrrrrrrrr)�)�__name__�
__module__�__qualname__�__firstlineno__�__doc__rr4rNrGrKrJr'rf�staticmethodrerHrF�__static_attributes__�__classdictcell__�
__classcell__)r�
__classdict__s@@r r	r	Ust������%��d��";�(&�P
����:	�����M�����r"r	)r��collectionsrr�r�	itertoolsr�	constantsr�	collectorr�stack_collectorrryrIr	�r"r �<module>r�s>��D�L ����+�)�0�����w�(�wr"

Youez - 2016 - github.com/yon3zu
LinuXploit