
    uYf                     t    d dl Z d dlZd dlmZ d dlmZ d dlmZ  ee	      Z
ddZ G d de      Z e       Zy)	    N)En)
get_logger)parse_tags_strc                 f   | j                   }||S | j                  sy	 ddlm} |j	                         j
                  |j                         j
                  z   }d}t        t        t        j                  ||z        |            S # t        $ r  t        j                  d|dz  d       |cY S w xY w)Nr   )psutilzBUnable to get total memory available, using default value of %d KBi   T)exc_infoi   )_sample_sizeenabledddtrace.vendorr   swap_memorytotalvirtual_memory	Exceptionloggerwarningintmaxmathceil)heap_configdefault_heap_sample_sizeheap_sample_sizer   	total_memmax_sampless         Z/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/ddtrace/settings/profiling.py _derive_default_heap_sample_sizer      s    "//#
()&&(..1F1F1H1N1NN	 Ks499Y457OPQQ  (P$t+ 	 	

 ('(s   ;B &B0/B0c                      e Zd ZdZ ej
                  edddd      Z ej
                  edddd      Z ej
                  ed	d
dd      Z	 ej
                  edd
dd      Z
 ej
                  ej                  e   dddd      Z ej
                  edddd      Z ej
                  edddd      Z ej
                  edddd      Z ej
                  edddd      Z ej
                  edddd      Z ej
                  ed ddd!      Z ej
                  ed"d#dd$      Z ej
                  ed%ei d&d'(      Z G d) d*e      Z G d+ d,e      Z G d- d.e      Z G d/ d0e      Z G d1 d2e      Zy)3ProfilingConfigzdd.profilingr
   FBooleanz3Enable Datadog profiling when using ``ddtrace-run``default	help_typehelp	agentless enable_code_provenanceTz!Whether to enable code provenanceendpoint_collection_enabledz:Whether to enable the endpoint data collection in profilesoutput_pprofNString
max_eventsi @  Integerupload_intervalg      N@FloatzCThe interval in seconds to wait before flushing out recorded eventscapture_pctg      ?zThe percentage of events that should be captured (e.g. memory allocation). Greater values reduce the program execution speed. Must be greater than 0 lesser or equal to 100
max_frames@   zBThe maximum number of frames to capture in stack execution tracingignore_profilerzD**Deprecated**: whether to ignore the profiler in the generated datamax_time_usage_pctzThe percentage of maximum time the stack profiler can use when computing statistics. Must be greater than 0 and lesser or equal to 100api_timeoutg      $@zLThe timeout in seconds before dropping events if the HTTP API does not replytagsMappingz^The tags to apply to uploaded profile. Must be a list in the ``key1:value,key2:value2`` format)parserr!   r"   r#   c                   X    e Zd ZdxZZ ej                  edddd      Z G d de      Z	y	)
ProfilingConfig.Stackstackr
   Tr   z$Whether to enable the stack profilerr    c                   B    e Zd ZdxZZ ej                  edddd      Zy)ProfilingConfig.Stack.V2v2r
   Fr   zOWhether to enable the v2 stack profiler. Also enables the libdatadog collector.r    N	__name__
__module____qualname____item__
__prefix__r   vboolr
        r   V2r;      s+    $((Hzbdd#fGrF   rG   N)
r>   r?   r@   rA   rB   r   rC   rD   r
   rG   rE   rF   r   Stackr8      s7     '':"$$7
		 		rF   rH   c                   B    e Zd ZdxZZ ej                  edddd      Zy)ProfilingConfig.Locklockr
   Tr   z#Whether to enable the lock profilerr    Nr=   rE   rF   r   LockrJ      s+     &&:"$$6
rF   rL   c                   p    e Zd ZdxZZ ej                  edddd      Z ej                  e	ddd	d
      Z
y)ProfilingConfig.Memorymemoryr
   Tr   z%Whether to enable the memory profilerr    events_buffer   r+   r%   N)r>   r?   r@   rA   rB   r   rC   rD   r
   r   rP   rE   rF   r   MemoryrN      sL     ((:"$$8
 
rF   rR   c                       e Zd ZdxZZ ej                  edddd      Z ej                  e	j                  e   ddd	d
      Z ej                  ee      Zy)ProfilingConfig.Heapheapr
   Tr   z*Whether to enable the heap memory profilerr    sample_sizeNr+   r%   )r>   r?   r@   rA   rB   r   rC   rD   r
   tOptionalr   r	   dr   rV   rE   rF   r   HeaprT      si     &&:"$$=
 rttJJsO
 bdd3 @ArF   rZ   c                   B    e Zd ZdxZZ ej                  edddd      Zy)ProfilingConfig.Exportexportlibdd_enabledFr   z=Enables collection and export using the experimental exporterr    N)	r>   r?   r@   rA   rB   r   rC   rD   r^   rE   rF   r   Exportr\      s+     ((:P
rF   r_   ) r>   r?   r@   rB   r   rC   rD   r
   r$   code_provenanceendpoint_collectionrW   rX   strr(   r   r*   floatr,   r.   r/   r1   r2   r3   dictr   r4   rH   rL   rR   rZ   r_   rE   rF   r   r   r   (   s   JbddBG I bdd 0O "$$%I 244	

3L J bddRO "$$0K QJ bddSO H "$$[K 244mD ,	
r 	

 
&Br B(	
 	
rF   r   )i   )r   typingrW   envierr   ddtrace.internal.loggerr   ddtrace.internal.utils.formatsr   r>   r   r   r   configrE   rF   r   <module>rj      s?       . 9 
H	R6@
b @
F 
	rF   