o
    iz                     @   s   d dl mZ d dlZd dlZdZddiZi dddd	d
ddddddddddddddddddddddd	d d!d"d#d$d%ZeG d&d' d'Zd(ej	d)ej
e fd*d+ZdS ),    )	dataclassNzbenchmark.duration.infoz&benchmark.duration.statistics.outliersoutlierszbenchmark.duration.meanmeanzbenchmark.duration.runsroundsz%benchmark.duration.statistics.hd15iqrhd15iqrz!benchmark.duration.statistics.iqriqrz*benchmark.duration.statistics.iqr_outliersiqr_outliersz%benchmark.duration.statistics.ld15iqrld15iqrz!benchmark.duration.statistics.maxmaxz"benchmark.duration.statistics.meanz$benchmark.duration.statistics.medianmedianz!benchmark.duration.statistics.minminz!benchmark.duration.statistics.opsopsz benchmark.duration.statistics.q1q1z benchmark.duration.statistics.q3q3zbenchmark.duration.statistics.nz%benchmark.duration.statistics.std_devstddevz.benchmark.duration.statistics.std_dev_outliersstddev_outliersz#benchmark.duration.statistics.totaltotalc                   @   s.   e Zd ZU eeef ed< eeef ed< dS )BenchmarkDatatagsmetricsN)__name__
__module____qualname__dictstr__annotations__float r   r   ]/home/ubuntu/.local/lib/python3.10/site-packages/ddtrace/testing/internal/pytest/benchmark.pyr   "   s   
 r   itemreturnc           	      C   s   | j jds	d S t| dd }|sd S | jd}|r|js d S | jdjj}ti i d}d|jt	< t
 D ]\}}t||d }|d urJ||j|< q7t D ]\}}t||d }|d urb||j|< qO|S )N	benchmarkfuncargs)r   r   Time)configpluginmanager	hasplugingetattrr"   getstatsr   r   BENCHMARK_INFO_TAGTAGS_TO_PYTEST_BENCHMARK_ATTRSitems!METRICS_TO_PYTEST_BENCHMARK_ATTRSr   )	r   r"   benchmark_fixturer)   datatag_name
stats_attrvaluemetric_namer   r   r   get_benchmark_tags_and_metrics(   s,   



r4   )dataclassesr   typingtpytestr*   r+   r-   r   ItemOptionalr4   r   r   r   r   <module>   sX    	
