o
    ci                     @   s   d dl Z d dlmZ d dlmZmZ d dlmZ e jdde j	de
dd	d
e j	de
ddd
e j	de
ddd
e j	de
ddd
de
de
de
defddZedkrXe  dS dS )    N)serve)BenchmarkerHello)DeploymentHandlez'Benchmark deployment handle throughput.)helpz--batch-sized   zBNumber of requests to send to downstream deployment in each trial.)typedefaultr   z--num-replicas   z0Number of replicas in the downstream deployment.z--num-trials   z)Number of trials of the benchmark to run.z--trial-runtimez:Duration to run each trial of the benchmark for (seconds).
batch_sizenum_replicas
num_trialstrial_runtimec                 C   sd   t tj|ddid }t|}|jj| ||d \}}t	d
d| d|  d|| d S )	Nnum_cpusr   )r   ray_actor_options)r   r   r   z3DeploymentHandle throughput {}: {} +- {} requests/sz(num_replicas=z, batch_size=))r   bindr   optionsr   runrun_throughput_benchmarkremoteresultprintformat)r   r   r   r   apphmeanstddev r   c/home/ubuntu/.local/lib/python3.10/site-packages/ray/serve/_private/benchmarks/handle_throughput.pymain   s*   
r!   __main__)clickrayr   $ray.serve._private.benchmarks.commonr   r   ray.serve.handler   commandoptionintfloatr!   __name__r   r   r   r    <module>   sR    

