o
    Á¿iŒ  ã                   @   sV   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ G dd„ dƒZ	dS )	é    N)Ú_extract_span)ÚBENCHMARK_INFO)ÚPLUGIN_METRICS)ÚPLUGIN_OUTLIERS)Ú	TEST_TYPEc                   @   s   e Zd Ze ¡ dd„ ƒZdS )Ú_PytestBenchmarkPluginc                 C   sª   t |dƒo
|j d¡}|rO|jrQ|jj}t|ƒ}|d u rd S | td¡ | td¡ t 	¡ D ]$\}}t ||ƒrN|t
krE| |t||ƒ¡ q.| |t||ƒ¡ q.d S d S d S )NÚfuncargsÚ	benchmarkÚTime)Úhasattrr   ÚgetÚstatsr   Ú_set_tag_strr   r   r   Úitemsr   ÚgetattrÚset_tag)ÚselfÚitemÚcallÚfixtureÚstat_objectÚspanÚ	span_pathÚtag© r   úe/home/ubuntu/.local/lib/python3.10/site-packages/ddtrace/contrib/internal/pytest_benchmark/_plugin.pyÚpytest_runtest_makereport   s"   

€ò	z0_PytestBenchmarkPlugin.pytest_runtest_makereportN)Ú__name__Ú
__module__Ú__qualname__ÚpytestÚhookimplr   r   r   r   r   r   
   s    r   )
r    Ú&ddtrace.contrib.internal.pytest._utilsr   Ú3ddtrace.contrib.internal.pytest_benchmark.constantsr   r   r   Úddtrace.ext.testr   r   r   r   r   r   Ú<module>   s    