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
transaction_profiler.cpython-312.pyc
� w�/iBm � � � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl mZmZ ddl mZ ddlZddlmZ ddlmZmZ ddlmZmZmZmZmZmZmZmZ ddlmZ er{dd lm Z dd lm!Z! ddlm"Z" ddlm#Z# dd lm$Z$ ddlm%Z% ddlm&Z& ddlm'Z' ddl(m)Z) ddlm*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 ddl1m2Z2m3Z3m4Z4 e)de5e/e6d�� Z7 e)de$e+ e$e* e$e7 e#e/e,f d�� Z8 ddl9m:Z: ddl;m<Z= e=Z< e:dd� Z>daAdZBd� ZCd� ZDd� ZE e6d � ZF G d!� d"� ZG G d#� d$e� ZH G d%� d&eH� ZI G d'� d(eH� ZJy# e?$ r ej� Z>dZ<Y �Vw xY w))a� This file is originally based on code from https://github.com/nylas/nylas-perftools, which is published under the following license: The MIT License (MIT) Copyright (c) 2014 Nylas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. � N)�ABC�abstractmethod)�deque)�LRUCache)�DEFAULT_SAMPLING_FREQUENCY� extract_stack)�capture_internal_exception�capture_internal_exceptions�get_current_thread_meta� is_gevent�is_valid_sample_rate�logger�nanosecond_time�set_in_app_in_frames)� TYPE_CHECKING)�Any)�Callable)�Deque)�Dict)�List)�Optional)�Set)�Type)� TypedDict)�ProcessedStack�ProcessedFrame�ProcessedThreadMetadata�FrameId�StackId�ThreadId�ExtractedSample)�Event�SamplingContext�ProfilerMode�ProcessedSample��elapsed_since_start_ns� thread_id�stack_id�ProcessedProfile��frames�stacks�samples�thread_metadata)�get_original)� ThreadPool�time�sleep� c � � | d }|�y| d }|�|dkD ry| d j d� }|�t j d� |dkD ryy)N�profiles_samplerT�profiles_sample_rater �_experimentszy_experiments['profiles_sample_rate'] is deprecated. Please use the non-experimental profiles_sample_rate option directly.F)�getr �warning)�optionsr6 r7 s �W/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/profiler/transaction_profiler.py�has_profiling_enabledr= y sr � ��1�2���#��"�#9�:���'�,@�1�,D��"�>�2�6�6�7M�N���'���� � � �!�#��� c �� � t �t j d� yt }t � rt j }nt j }| j d� �| d }n>| j di � j d� }|�t j d� |xs |}|t j k( s|dk( r t |�� a n:|t j k( r t |�� a nt dj |� � �t j d j t j � � � t j � t j t � y)Nz%[Profiling] Profiler is already setupF� profiler_moder8 zk_experiments['profiler_mode'] is deprecated. Please use the non-experimental profiler_mode option directly.r3 �� frequencyzUnknown profiler mode: {}z.[Profiling] Setting up profiler in {mode} mode)�modeT)� _schedulerr �debugr r �GeventSchedulerrC �ThreadSchedulerr9 r: � ValueError�format�setup�atexit�register�teardown_profiler)r; rB �default_profiler_moder@ s r<