Uname : Linux premium36.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Soft : LiteSpeed
Ip : 198.54.115.237
Port : 443
~
/
opt
/
hc_python
/
lib64
/
python3.12
/
site-packages
/
sentry_sdk
/
profiler
/
__pycache__
[ HOME ]
Exec
Submit
File Name : continuous_profiler.cpython-312.pyc
� w�/iZ � � � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlm Z d dl m Z mZ d dlm Z d dlmZ d dlmZ d dlmZmZ d dlmZmZmZmZmZ d d lmZ erad d lmZ d dlmZ d dlmZ d d lm Z d dlm!Z! d dlm"Z" d dlm#Z# d dlm$Z$ d dlm%Z% d dl&m'Z' d dl(m)Z)m*Z* d dlm+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 e'de1e.e2d�� Z3 d dl4m5Z5 d dl6m7Z8 e8Z7 e5dd� Z9da<d� Z=d� Z>d� Z?d� Z@d � ZAd!� ZBd"� ZCd#� ZDd$� ZEd%� ZFd&� ZG G d'� d(� ZH G d)� d*� ZI G d+� d,eI� ZJ G d-� d.eI� ZKd/ZL G d0� d1� ZM G d2� d3� ZNy# e:$ r ejv Z9dZ7Y �yw xY w)4� N)�deque)�datetime�timezone)�VERSION)�Envelope)�LRUCache)�DEFAULT_SAMPLING_FREQUENCY� extract_stack)�capture_internal_exception� is_gevent�logger�now�set_in_app_in_frames)� TYPE_CHECKING)�Any)�Callable)�Deque)�Dict)�List)�Optional)�Set)�Type)�Union)� TypedDict)�ContinuousProfilerMode�SDKInfo)�ExtractedSample�FrameId�StackId�ThreadId�ProcessedFrame�ProcessedStack�ProcessedSample�� timestamp� thread_id�stack_id)�get_original)� ThreadPool�time�sleepc � � t d u}|rt j d� t � t � rt j }nt j }| j d� �| d }n'| j di � }|j d� xs |}t }|t j k( rt || ||� a n<|t j k( rt || ||� a nt dj |� � �t j dj t j �� � |st j t � y) Nz0[Profiling] Continuous Profiler is already setup� profiler_mode�_experiments�continuous_profiling_modez$Unknown continuous profiler mode: {}z9[Profiling] Setting up continuous profiler in {mode} mode)�modeT)� _schedulerr �debug�teardown_continuous_profilerr �GeventContinuousSchedulerr0 �ThreadContinuousScheduler�getr � ValueError�format�atexit�register)�options�sdk_info�capture_func�already_initialized�default_profiler_moder- �experiments� frequencys �V/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/profiler/continuous_profiler.py�setup_continuous_profilerrC J s+ � � %�D�0������G�H�$�&��{� !:� >� >�� 9� >� >���{�{�?�#�/���0� � �k�k�.�"�5�� �O�O�7�8�Q�<Q� � +�I��1�6�6�6�.��w��,� � � �3�8�8� 8�.��w��,� � � �?�F�F�}�U�V�V� �L�L�C�J�J���� K� �� ����4�5�� c �0 � t �yt j S �NF)r1 �sampled� rD rB �is_profile_session_sampledrI � s � �������rD c �d � t �y t j � sy t j � y �N)r1 �is_auto_start_enabled�manual_startrH rD rB �!try_autostart_continuous_profilerrN � s( � � ����+�+�-�����rD c �8 � t �y t j � S rK )r1 � auto_startrH rD rB �!try_profile_lifecycle_trace_startrQ � s � ����� � �"�"rD c �: � t �y t j � y rK )r1 rM rH rD rB �start_profilerrS � s � �������rD c �P � t j dt d�� t � y )NzWThe `start_profile_session` function is deprecated. Please use `start_profile` instead.� �� stacklevel)�warnings�warn�DeprecationWarningrS rH rD rB �start_profile_sessionr[ � s! � � �M�M�a���� �rD c �: � t �y t j � y rK )r1 �manual_stoprH rD rB � stop_profilerr^ � s � �������rD c �P � t j dt d�� t � y )NzUThe `stop_profile_session` function is deprecated. Please use `stop_profile` instead.rU rV )rX rY rZ r^ rH rD rB �stop_profile_sessionr` � s � � �M�M�_���� �OrD c � � t � d ay rK )r^ r1 rH rD rB r3 r3 � s � ��O� �JrD c �0 � t �y t j S rK )r1 �profiler_idrH rD rB �get_profiler_idrd � s � �����!�!�!rD c �H � | syt j � t | � k S rF )�random�float)�sample_rates rB �+determine_profile_session_sampling_decisionri � s � � ���=�=�?�U�;�/�/�/rD c �"