
    &`i                        d dl Z d dlmZmZmZ d dlmZ d dlmZm	Z	m
Z
mZmZmZ d dlmZ d dlZd dlmZ d dlmZmZ d dlmZ d d	lmZmZmZ d d
lm Z  d dl!m"Z" dZ# ed           G d d                      Z$ e"d           ed           G d d                                  Z%e&Z'e(Z)e&Z*e G d d                      Z+ G d de&e          Z, G d de&e          Z G d de&e          Z G d de&e          Z-ej.        fd ej/        fdej0        fd ej1        ej2        fd ej3        ej2        fd ej1        ej4        fd!ej3        ej4        fd!ej5        fd!iZ6 ed"           G d# d$                      Z ed           G d% d&                      Z7 ed           G d' d(                      Z8 G d) d*e&e          Z9 G d+ d,e&e          Z:e G d- d.                      Z;e G d/ d0                      Z< G d1 d2e&e          Z= G d3 d4e&e          Z>e G d5 d6                      Z? G d7 d8          Z@ G d9 d:e&e          ZA ed           G d; d<                      ZB ed           G d= d>                      ZC eDd?          ZEd@ZFdAZGdBZH edC           G dD dE                      ZIeeI         ZJe G dF dG                      ZKe G dH dI                      ZLdS )J    N)asdict	dataclassfield)Enum)Any	AwaitableCallableDictListOptional)Scope)ActorHandle)SERVE_DEFAULT_APP_NAMESERVE_NAMESPACE)RoutePattern)DeploymentStatusDeploymentStatusInfoDeploymentStatusTrigger)RayServegRPCContext)	PublicAPIzSERVE_REPLICA::T)frozenc                   :    e Zd ZU eed<   eZeed<   d Zd Zd Z	dS )DeploymentIDnameapp_namec                 &    d| j          d| j         S )NzServeReplica::)r   r   selfs    m/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/serve/_private/common.pyto_replica_actor_class_namez(DeploymentID.to_replica_actor_class_name   s    :t}::ty:::    c                 (    d| j          d| j         dS )NzDeployment(name='', app='')r   r   r   s    r    __str__zDeploymentID.__str__   s    G49GGdmGGGGr"   c                      t          |           S Nstrr   s    r    __repr__zDeploymentID.__repr__"       4yyr"   N)
__name__
__module____qualname__r+   __annotations__r   r   r!   r'   r,    r"   r    r   r      s_         
III*Hc***; ; ;H H H    r"   r   alpha)	stabilityc                       e Zd ZU dZeed<   	 eed<   	 defdZedede	fd            Z
edefd            Zdefd	Zdefd
ZdS )	ReplicaIDz"A unique identifier for a replica.	unique_iddeployment_idreturnc                 ~    | j         j         d| j         }| j         j        r| j         j         d| }t           | S )N#)r8   r   r7   r   REPLICA_ID_FULL_ID_STR_PREFIX)r   ss     r    to_full_id_strzReplicaID.to_full_id_str1   sU    !&9999& 	5%.4444A/4444r"   r=   c                 6    |                      t                    S r)   )
startswithr<   )r=   s    r    is_full_id_strzReplicaID.is_full_id_str8   s    ||9:::r"   c                 V   |                      |          sJ |t          t                    d                              d          }t          |          dk    r|\  }}}n.t          |          dk    rd}|\  }}nt	          d| d           | |t          ||                    S )	Nr;          zGiven replica ID string z\ didn't match expected pattern, ensure it has either two or three fields with delimiter '#'.r&   )r8   )rA   lenr<   split
ValueErrorr   )clsr=   parsedr   deployment_namer7   s         r    from_full_id_strzReplicaID.from_full_id_str<   s    !!!$$$$$3455778>>sCCv;;!390Hoyy[[AH)/&OYYO1 O O O  
 s&OhOOO
 
 
 	
r"   c                      t          |           S r)   r*   r   s    r    r,   zReplicaID.__repr__Q   r-   r"   c                 L    d| j          d| j        j         d| j        j         dS )z{Returns a human-readable string.

        This is used in user-facing log messages, so take care when updating it.
        zReplica(id='z', deployment='r$   r%   )r7   r8   r   r   r   s    r    r'   zReplicaID.__str__T   sH    > -2  &/  	
r"   N)r.   r/   r0   __doc__r+   r1   r   r>   staticmethodboolrA   classmethodrL   r,   r'   r2   r"   r    r6   r6   &   s          -,NNND15 5 5 5 5 ;# ;$ ; ; ; \; 
 
 
 
 [
(#    
 
 
 
 
 
 
r"   r6   c                   R    e Zd ZU dZeed<   dZeed<   dZe	e
d                  ed<   dS )EndpointInfoa^  Metadata about a deployment's HTTP/gRPC endpoint.

    This represents the public routing interface for a deployment. It's created when
    a deployment is registered with a route prefix and broadcast to all proxies via
    the long poll mechanism (ROUTE_TABLE namespace).

    Flow:
        1. Created in ApplicationState when deployment is applied
        2. Stored in EndpointState (controller's source of truth)
        3. Broadcast to all ProxyActors via long poll (ROUTE_TABLE)
        4. Cached in ProxyRouter for request routing
        5. Used to route incoming HTTP/gRPC requests to correct deployments
        6. Used to determine route patterns for accurate metrics tagging

    Key Difference from DeploymentInfo:
        - EndpointInfo: Just HTTP/gRPC routing metadata (shared with proxies)
        - DeploymentInfo: Complete deployment config (replicas, resources, etc.)

    Attributes:
        route: The route prefix for this deployment (e.g., "/api").
        app_is_cross_language: Whether the deployment uses a different language
            than the proxy (e.g., Java deployment with Python proxy). This affects
            how the proxy serializes/deserializes requests.
        route_patterns: List of RoutePattern objects for ASGI route patterns.
            Each RoutePattern has methods (list of HTTP methods or None) and path.
            Examples: [RoutePattern(methods=["GET", "POST"], path="/"),
                      RoutePattern(methods=["PUT"], path="/users/{id}"),
                      RoutePattern(methods=None, path="/websocket")]
            Used by proxies to match incoming requests to specific route patterns
            for accurate metrics tagging. This avoids high cardinality by using
            parameterized patterns instead of individual request paths.
            Only populated for deployments with ASGI apps (FastAPI/Starlette).
    routeFapp_is_cross_languageNr   route_patterns)r.   r/   r0   rO   r+   r1   rV   rQ   rW   r   r   r2   r"   r    rT   rT   g   sS            D JJJ"'4'''59NHT.1299999r"   rT   c                   &    e Zd ZdZdZdZdZdZdZdS )ReplicaStateSTARTINGUPDATING
RECOVERINGRUNNINGSTOPPINGPENDING_MIGRATIONN)	r.   r/   r0   rZ   r[   r\   r]   r^   r_   r2   r"   r    rY   rY      s/        HHJGH+r"   rY   c                   &    e Zd ZdZdZdZdZdZdZdS )r   r[   HEALTHY	UNHEALTHYDEPLOY_FAILED	UPSCALINGDOWNSCALINGN)	r.   r/   r0   r[   ra   rb   rc   rd   re   r2   r"   r    r   r      s,        HGI#MIKKKr"   r   c                   :    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdS )r   z?Explains how a deployment reached its current DeploymentStatus.UNSPECIFIEDCONFIG_UPDATE_STARTEDCONFIG_UPDATE_COMPLETEDUPSCALE_COMPLETEDDOWNSCALE_COMPLETEDAUTOSCALINGREPLICA_STARTUP_FAILEDHEALTH_CHECK_FAILEDINTERNAL_ERRORDELETINGN)r.   r/   r0   rO   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   r2   r"   r    r   r      sL        IIK37+/K5/%NHHHr"   r   c                   6    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdS )DeploymentStatusInternalTriggerra   CONFIG_UPDATEAUTOSCALE_UPAUTOSCALE_DOWNMANUALLY_INCREASE_NUM_REPLICASMANUALLY_DECREASE_NUM_REPLICASrm   rn   ro   DELETEN)r.   r/   r0   ra   rs   rt   ru   rv   rw   rm   rn   ro   rx   r2   r"   r    rr   rr      sG        G#M!L%N &F"%E"5/%NFFFr"   rr      rD   rC   )eqc                       e Zd ZU eed<   eed<   eed<   dZeed<   ede	fd            Z
d Z	 	 	 ddededefd
ZdefdZ	 ddededd fdZd Zedefd            Zd	S )r   r   statusstatus_triggerrE   messager9   c                     | j         ft          v rt          | j         f         S | j         | j        ft          v rt          | j         | j        f         S dS )zGet priority of state based on ranking_order().

        The ranked order indicates what the status should be of a
        hierarchically "higher" resource when derived from a group of
        `DeploymentStatusInfo` sub-resources.
        N)r|   DEPLOYMENT_STATUS_RANKING_ORDERr}   r   s    r    rankzDeploymentStatusInfo.rank   sW     K><<<2DK>BBk4./3RRR2DKAT3UVV SRr"   c                 H    t          j        t          |           d          S )N   )indent)jsondumpsr   r   s    r    debug_stringz!DeploymentStatusInfo.debug_string   s    z&,,q1111r"   Nc                 V    t          | j        |r|n| j        |r|n| j        |          S )zGReturns a copy of the current object with the passed in kwargs updated.r   r|   r}   r~   )r   r   r|   r}   )r   r|   r}   r~   s       r    _updated_copyz"DeploymentStatusInfo._updated_copy   s@     $#466-;T>>AT	
 
 
 	
r"   c                 .    |                      |          S )N)r~   )r   )r   r~   s     r    update_messagez#DeploymentStatusInfo.update_message  s    !!'!222r"   triggerc                    |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S | j	        t          j        k    r|t           j
        k    r,|                     t          j
        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        t           j        hv r| S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S n9| j	        t          j        t          j        hv r{|t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j
        k    rM|                     t          j
        | j	        t          j        k    rt
          j        nt
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S | j        t
          j        k    r|t           j        k    r!|                     t          j        |          S |t           j        k    r!|                     t          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S n| j        t
          j        k    rb|t           j        k    r!|                     t          j        |          S |t           j        k    r!|                     t          j        |          S n| j	        t          j
        k    r||t           j
        k    r| S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S n| j	        t          j        k    r|t           j
        k    r,|                     t          j
        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S n| j	        t          j        k    r|t           j
        k    r,|                     t          j
        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S |t           j        k    r,|                     t          j        t
          j        |          S | S )a  Handles a transition from the current state to the next state.

        Args:
            trigger: An internal trigger that determines the state
                transition. This is the new incoming trigger causing the
                transition.
            message: The message to set in status info.

        Returns:
            New instance of DeploymentStatusInfo representing the
            next state to transition to.
        )r|   r}   r~   )r|   r~   )rr   ro   r   r   rb   r   rx   r[   rp   r|   ra   ri   rs   rh   rt   rd   rl   ru   re   rv   rw   rn   rc   rm   rj   rk   r}   rg   )r   r   r~   s      r    handle_transitionz&DeploymentStatusInfo.handle_transition  s   ( 5DDD%%'16E &    7>>>%%'06? &    [,5559AAA))+3#:#R# *    ;III))+4#:#P# *    ;HHH))+5#:#F# *   
 ;JJJ))+7#:#F# *    /N/N    ;OOO))+9#:#N# *   
 ;RRR))+9#:#Q# *    S [-79I9UVVV9MMM))+5#:#N# *   
 ;RRR))+5#:#Q# *    ;CCC))+3{&6&@@@ $;#L#L0D# *    ;III))+4#:#P# *    $(?(KKK=JJJ--/9 ' .   
  ? NNN--/; ' .    6UV V  --/9'>'T ' .    6UV V  --/;'>'T ' .   V $(?(UUU 6UV V  --/97 .    6UV V  --/;W .    [,4449AAA ;III))+4#:#P# *    2QR R ))+5#:#P# *    2QR R ))+7#:#P# *   
 ;HHH))+5#:#F# *   
 ;JJJ))+7#:#F# *    ;OOO))+5#:#N# *    P [,6669AAA))+3#:#F# *    ;III))+4#:#P# *    ;OOO))+5#:#N# *   
 ;RRR))+5#:#Q# *    S [,:::9AAA))+3#:#F# *    ;III))+4#:#P# *    ;OOO))+9#:#N# *   
 ;RRR))+9#:#Q# *    r"   c                 p    t          | j        d| j        j         d| j        j         | j                  S NDEPLOYMENT_STATUS_DEPLOYMENT_STATUS_TRIGGER_r   )DeploymentStatusInfoProtor   r|   r}   r~   r   s    r    to_protozDeploymentStatusInfo.to_proto-  sD    (:(8::R8K8PRRL	
 
 
 	
r"   protoc                     t          j        |j                  t          d          d          }t	          j        |j                  t          d          d          } | |j        t          |          t          |          |j	                  S r   )
DeploymentStatusProtoNamer|   rF   DeploymentStatusTriggerProtor}   r   r   r   r~   )rI   r   r|   r}   s       r    
from_protozDeploymentStatusInfo.from_proto5  s    &+EL99#>R:S:S:U:UV5:5;OPP,--//
 s#F++2>BBM	
 
 
 	
r"   )NNrE   )rE   )r.   r/   r0   r+   r1   r   r   r~   propertyintr   r   r   r   rr   r   r   rR   r   r   r2   r"   r    r   r      sU        
III++++GSWc W W W XW2 2 2
 $(26	
 
 
 0
 	
 
 
 
3c 3 3 3 3 c c0c c 
 	c c c cJ	
 
 
 

8 

 

 

 [

 

 

r"   r   c                      e Zd ZU eed<   ee         ed<   ee         ed<   ee         ed<   eed<   eed<   dZe	ed<    e
e	          Zee         ed
<    e
e	          Zeeef         ed<   dZee         ed<   d Zd Zd ZdefdZdS )RunningReplicaInfo
replica_idnode_idnode_ipavailability_zone
actor_namemax_ongoing_requestsFis_cross_language)default_factorymultiplexed_model_idsrouting_statsNportc                 t   t          d                    | j                                        | j        r| j        nd| j        t          | j                  t          | j                  t          | j	                  t          | j
                  g                    }t                              | d|           d S )N rE   _hash)hashjoinr   r>   r   r   r+   r   r   r   r   object__setattr__)r   hash_vals     r    __post_init__z RunningReplicaInfo.__post_init__P  s     HHO2244$(L8DLLbO122.//233*++
 

 
  	4(33333r"   c                     | j         S r)   )r   r   s    r    __hash__zRunningReplicaInfo.__hash__i  s
    zr"   c                 f    t          t          |t                    | j        |j        k    g          S r)   )all
isinstancer   r   )r   others     r    __eq__zRunningReplicaInfo.__eq__l  s3    5"455
ek)
 
 	
r"   r9   c                 F    t          j        | j        t                    }|S N)	namespace)ray	get_actorr   r   )r   actor_handles     r    get_actor_handlez#RunningReplicaInfo.get_actor_handlet  s    }T_PPPr"   )r.   r/   r0   r6   r1   r   r+   r   r   rQ   r   listr   r   dictr   r
   r   r   r   r   r   r   r   r2   r"   r    r   r   C  s        c]c]}$$$OOO#t###',uT'B'B'B49BBB$)E$$?$?$?M4S>???D(3-4 4 42  
 
 
+      r"   r   c                   0    e Zd ZU eed<   ee         ed<   dS )DeploymentTargetInfois_availablerunning_replicasN)r.   r/   r0   rQ   r1   r   r   r2   r"   r    r   r   y  s0         -......r"   r   c                       e Zd ZdZdS )ServeDeployMode	MULTI_APPN)r.   r/   r0   r   r2   r"   r    r   r     s        IIIr"   r   c                       e Zd ZdZdS )ServeComponentTypereplicaN)r.   r/   r0   REPLICAr2   r"   r    r   r     s        GGGr"   r   c                   n    e Zd ZU dZeed<   dZeee	                  ed<   dZ
eee	ef                  ed<   dS )RequestRoutingInfozInformation about the request routing.

    It includes deployment name (from ReplicaID), replica tag (from ReplicaID),
    multiplex model ids, and routing stats.
    r   Nr   r   )r.   r/   r0   rO   r6   r1   r   r   r   r+   r   r
   r   r2   r"   r    r   r     sa           158DI.555.2M8DcN+22222r"   r   c                       e Zd ZU dZeed<   dS )gRPCRequestzKSent from the GRPC proxy to replicas on both unary and streaming codepaths.user_request_protoN)r.   r/   r0   rO   r   r1   r2   r"   r    r   r     s$         UUr"   r   c                       e Zd ZdZdZdZdS )RequestProtocol	UNDEFINEDHTTPgRPCN)r.   r/   r0   r   r   GRPCr2   r"   r    r   r     s        IDDDDr"   r   c                       e Zd ZdZdZdZdS )DeploymentHandleSourceUNKNOWNPROXYr   N)r.   r/   r0   r   r   r   r2   r"   r    r   r     s        GEGGGr"   r   c                       e Zd ZU eed<   eed<   dZeed<   dZeed<   dZeed<   dZeed<   d	Z	e
ed
<   dZeed<   ej        Zeed<   dZee         ed<   dZe
ed<   ede
fd            Zede
fd            ZdS )RequestMetadata
request_idinternal_request_id__call__call_methodrE   rU   r   multiplexed_model_idFis_streaming_http_method_request_protocolNgrpc_contextT_by_referencer9   c                 ,    | j         t          j        k    S r)   )r   r   r   r   s    r    is_http_requestzRequestMetadata.is_http_request      %)===r"   c                 ,    | j         t          j        k    S r)   )r   r   r   r   s    r    is_grpc_requestzRequestMetadata.is_grpc_request  r   r"   )r.   r/   r0   r+   r1   r   rU   r   r   r   rQ   r   r   r   r   r   r   r   r   r   r   r   r2   r"   r    r   r     s!        
 OOO  "K!!! E3OOO Hc !##""" L$L# *9)BBBB 37L(./666M4> > > > X> > > > > X> > >r"   r   c                       e Zd ZdZddddedee         deeege	e
         f                  fdZedefd	            Zedeege	e
         f         fd
            ZdS )StreamingHTTPRequestz?Sent from the HTTP proxy to replicas on the streaming codepath.N)proxy_actor_namereceive_asgi_messages
asgi_scoper   r   c                d    || _         ||t          d          || _        d | _        || _        d S )NzBEither proxy_actor_name or receive_asgi_messages must be provided.)_asgi_scoperH   _proxy_actor_name_cached_proxy_actor_receive_asgi_messages)r   r   r   r   s       r    __init__zStreamingHTTPRequest.__init__  sS     #-#(=(ET   1A:>  " 	###r"   r9   c                     | j         S r)   )r   r   s    r    r   zStreamingHTTPRequest.asgi_scope  s    r"   c                     | j         ;t          j        | j        t                    | _        | j        j        j        | _         | j         S r   )r   r   r   r   r   r   r   remoter   s    r    r   z*StreamingHTTPRequest.receive_asgi_messages  sM    &.'*}&/( ( (D$ (>E ' **r"   )r.   r/   r0   rO   r   r   r+   r	   r   r   bytesr   r   r   r   r2   r"   r    r   r     s        II +/ " " "" #3-	"
  (o&	%(889 
" " " "4  E       X  	+x0A9UCS0S'T 	+ 	+ 	+ X	+ 	+ 	+r"   r   c                       e Zd ZdZdZdZdS )TargetCapacityDirectionz9Determines what direction the target capacity is scaling.UPDOWNN)r.   r/   r0   rO   r   r  r2   r"   r    r   r     s        CC	BDDDr"   r   c                   $    e Zd ZU eed<   eed<   dS )ReplicaQueueLengthInfoacceptednum_ongoing_requestsN)r.   r/   r0   rQ   r1   r   r2   r"   r    r  r    s'         NNNr"   r  c                   n    e Zd ZU eeeef                  ed<   eed<   eed<   eed<   dZe	e         ed<   dS )CreatePlacementGroupRequestbundlesstrategytarget_node_idr   Nruntime_env)
r.   r/   r0   r   r
   r+   floatr1   r  r   r2   r"   r    r  r    s^         $sEz"####MMM
III!%K#%%%%%r"   r  z|Converting by-value DeploymentResponses to ObjectRefs is not supported. Use handle.options(_by_reference=True) to enable it.running_requestsongoing_requestsqueued_requests)orderc                   <    e Zd ZU eed<    ed          Zeed<   dS )TimeStampedValue	timestampF)comparevalueN)r.   r/   r0   r  r1   r   r  r2   r"   r    r  r  #  s;         5'''E5'''''r"   r  c                       e Zd ZU dZeed<   eed<   eed<   eed<   eed<   e	ed<   e
ee
eef         f         ed<   e
ee
ee	f         f         ed	<   eed
<   edefd            Zedefd            ZdS )HandleMetricReporta  Report from a deployment handle on queued and ongoing requests.

    Args:
        deployment_id: The deployment ID of the deployment handle.
        handle_id: The handle ID of the deployment handle.
        actor_id: If the deployment handle (from which this metric was
            sent) lives on an actor, the ID of that actor.
        handle_source: Describes what kind of entity holds this
            deployment handle: a Serve proxy, a Serve replica, or
            unknown.
        aggregated_queued_requests: average number of queued requests at the
            handle over the past look_back_period_s seconds.
        queued_requests: list of values of queued requests at the
            handle over the past look_back_period_s seconds. This is a list because
            we take multiple measurements over time.
        aggregated_metrics: A map of metric name to the aggregated value over the past
            look_back_period_s seconds at the handle for each replica.
        metrics: A map of metric name to the list of values running at that handle for each replica
            over the past look_back_period_s seconds. This is a list because
            we take multiple measurements over time.
        timestamp: The time at which this report was created.
    r8   	handle_idactor_idhandle_sourceaggregated_queued_requestsr  aggregated_metricsmetricsr  r9   c                     | j         t          | j                            t          i                                                     z   S )z,Total number of queued and running requests.)r  sumr  getRUNNING_REQUESTS_KEYvaluesr   s    r    total_requestsz!HandleMetricReport.total_requestsP  sC     .#''(<bAAHHJJ2
 2
 
 	
r"   c                 @    | j         t          j        t          j        fv S )aQ  Whether the handle source is a Serve actor.

        More specifically, this returns whether a Serve actor tracked
        by the controller holds the deployment handle that sent this
        report. If the deployment handle lives on a driver, a Ray task,
        or an actor that's not a Serve replica, then this returns False.
        )r  r   r   r   r   s    r    is_serve_component_sourcez,HandleMetricReport.is_serve_component_sourceW  s%     !"("*&
 
 	
r"   N)r.   r/   r0   rO   r   r1   r+   r   r  
TimeSeriesr
   r6   r   r#  rQ   r%  r2   r"   r    r  r  -  s          .  NNNMMM)))) %%%%S$y%'7"889999#tIz1223333
 
 
 
 X
 
4 
 
 
 X
 
 
r"   r  c                   \    e Zd ZU dZeed<   eeef         ed<   eee	f         ed<   eed<   dS )ReplicaMetricReporta  Report from a replica on ongoing requests.

    Args:
        replica_id: The replica ID of the replica.
        aggregated_metrics: A map of metric name to the aggregated value over the past
            look_back_period_s seconds at the replica.
        metrics: A map of metric name to the list of values running at that replica
            over the past look_back_period_s seconds. This is a list because
            we take multiple measurements over time.
        timestamp: The time at which this report was created.
    r   r  r  r  N)
r.   r/   r0   rO   r6   r1   r
   r+   r  r&  r2   r"   r    r(  r(  f  s`         
 
 S%Z((((#z/""""r"   r(  )Mr   dataclassesr   r   r   enumr   typingr   r   r	   r
   r   r   starlette.typesr   r   	ray.actorr   ray.serve._private.constantsr   r   1ray.serve._private.thirdparty.get_asgi_route_namer   ray.serve.generated.serve_pb2r   r   r   r   r   r   ray.serve.grpc_utilr   ray.util.annotationsr   r<   r   r6   r+   NodeIdr  DurationApplicationNamerT   rY   rr   rc   rb   r[   rd   rh   re   rl   ra   r   r   r   r   r   r   r   r   r   r   r   r   r  r  RuntimeErrorOBJ_REF_NOT_SUPPORTED_ERRORr!  ONGOING_REQUESTS_KEYQUEUED_REQUESTS_KEYr  r&  r  r(  r2   r"   r    <module>r:     s    0 0 0 0 0 0 0 0 0 0       A A A A A A A A A A A A A A A A ! ! ! ! ! ! 



 ! ! ! ! ! ! P P P P P P P P J J J J J J         
 4 3 3 3 3 3 * * * * * * 1  $        W
$7
 7
 7
 7
 7
 7
 7
  7
t 
 %: %: %: %: %: %: %: %:R, , , , ,3 , , ,         sD          c4        c4   4 #%q!1 !!8!NOQR$5 	!8!DEq!#:#FG!# ( da
 a
 a
 a
 a
 a
 a
 a
H $2 2 2 2 2 2 2 2j $/ / / / / / / /
    c4       d    	3 	3 	3 	3 	3 	3 	3 	3            c4       S$    (> (> (> (> (> (> (> (>V++ ++ ++ ++ ++ ++ ++ ++\    c4    $       
 $& & & & & & & & +l;  
 * ) '  ( ( ( ( ( ( ( ( "#
 5
 5
 5
 5
 5
 5
 5
 5
p          r"   