§
    &`ƒi).  ã                   ó”   — d dl mZ  G d„ d¦  «        Z	 d dlmZmZmZmZ  G d„ d¦  «        ZdS # e	$ r  G d„ de
¦  «        ZY dS w xY w)	é    )ÚOptionalc                   ó0   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ ZdS )Ú
NullMetriczGMock metric class to be used in case of prometheus_client import error.c                 ó   — d S ©N© ©ÚselfÚargsÚkwargss      úx/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/autoscaler/_private/prom_metrics.pyÚsetzNullMetric.set   ó   € Øˆó    c                 ó   — d S r   r   r	   s      r   ÚobservezNullMetric.observe
   r   r   c                 ó   — d S r   r   r	   s      r   ÚinczNullMetric.inc   r   r   c                 ó   — | S r   r   r	   s      r   ÚlabelszNullMetric.labels   s   € Øˆr   c                 ó   — d S r   r   ©r
   s    r   ÚclearzNullMetric.clear   r   r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r      se   € € € € € ØQÐQðð ð ðð ð ðð ð ðð ð ðð ð ð ð r   r   )ÚCollectorRegistryÚCounterÚGaugeÚ	Histogramc                   óD   — e Zd Z	 ddedee         fd„Zed„ ¦   «         ZdS )ÚAutoscalerPrometheusMetricsNÚsession_nameÚregistryc           	      óº  — |pt          d¬¦  «        | _        || _        g d¢}g d¢}t          ddddd	| j        |¬
¦  «                             |¬¦  «        | _        t          ddddd	| j        |¬
¦  «                             |¬¦  «        | _        t          ddddd	| j        |¬
¦  «                             |¬¦  «        | _        t          ddddd	| j        ¬¦  «        | _	        t          ddddd	| j        ¬¦  «        | _
        t          ddddd	| j        ¬¦  «        | _        t          ddddd	| j        ¬¦  «                             |¬¦  «        | _        t          ddddd	| j        ¬¦  «                             |¬¦  «        | _        t          ddddd	| j        ¬¦  «                             |¬¦  «        | _        t          ddddd	| j        ¬¦  «                             |¬¦  «        | _        t          d d!ddd	| j        ¬¦  «                             |¬¦  «        | _        t          d"d#ddd	| j        ¬¦  «                             |¬¦  «        | _        t          d$d%dd&d	| j        ¬¦  «                             |¬¦  «        | _        t          d'd(dd&d	| j        ¬¦  «                             |¬¦  «        | _        t          d)d*dd+d	| j        ¬¦  «                             |¬¦  «        | _        t          d,d-dd+d	| j        ¬¦  «                             |¬¦  «        | _        t          d.d/dd0d	| j        ¬¦  «                             |¬¦  «        | _        t          d1d2dd0d	| j        ¬¦  «                             |¬¦  «        | _        t          d3d4dd0d	| j        ¬¦  «                             |¬¦  «        | _        t          d5d6dd0d	| j        ¬¦  «                             |¬¦  «        | _        t          d7d8dd0d	| j        ¬¦  «                             |¬¦  «        | _        t          d9d:d;d<d	| j        ¬¦  «        | _        t          d=d>d;d<d	| j        ¬¦  «        | _        d S )?NT)Úauto_describe)é   é
   é   é   é-   é<   éZ   éx   é´   éð   i,  ih  ià  iX  iÐ  i„  i°  iÜ  i  )g{®Gáz„?gš™™™™™¹?é   r)   éd   iè  Úworker_create_node_time_secondsaU  Worker launch time. This is the time it takes for a call to a node provider's create_node method to return. Note that when nodes are launched in batches, the launch time for that batch will be observed once for *each* node in that batch. For example, if 8 nodes are launched in 3 minutes, a launch time of 3 minutes will be observed 8 times.)ÚSessionNameÚsecondsÚ
autoscaler)Ú
labelnamesÚunitÚ	namespacer%   ÚbucketsÚworker_update_time_secondsz¬Worker update time. This is the time between when an updater thread begins executing and when it exits successfully. This metric only observes times for successful updates.Úupdate_timezXAutoscaler update time. This is the time for an autoscaler update iteration to complete.Úpending_nodesz&Number of nodes pending to be started.)ÚNodeTyper5   Únodes)r8   r9   r:   r%   Úactive_nodeszNumber of nodes in the cluster.Úrecently_failed_nodeszOThe number of recently failed nodes. This count could reset at undefined times.Ústarted_nodeszNumber of nodes started.Ústopped_nodeszNumber of nodes stopped.Úupdating_nodesz+Number of nodes in the process of updating.Úrecovering_nodesz-Number of nodes in the process of recovering.Úrunning_workerszNumber of worker nodes running.Úfailed_create_nodeszhNumber of nodes that failed to be created due to an exception in the node provider's create_node method.Úfailed_updatesz%Number of failed worker node updates.ÚupdatesÚsuccessful_updatesz)Number of succesfful worker node updates.Úfailed_recoveriesz!Number of failed node recoveries.Ú
recoveriesÚsuccessful_recoveriesz%Number of successful node recoveries.Úupdate_loop_exceptionszANumber of exceptions raised in the update loop of the autoscaler.Ú
exceptionsÚnode_launch_exceptionsz2Number of exceptions raised while launching nodes.Úreset_exceptionsz;Number of exceptions raised while resetting the autoscaler.Úconfig_validation_exceptionszGNumber of exceptions raised while validating the config during a reset.Údrain_node_exceptionszQNumber of exceptions raised when making a DrainNode rpcprior to node termination.Úcluster_resourcesz'Total logical resources in the cluster.)Úresourcer5   Ú	resourcesÚpending_resourcesz)Pending logical resources in the cluster.)r   r%   Ú_session_namer!   r   Úworker_create_node_timeÚworker_update_timer=   r    r>   rA   rB   r   rC   rD   rE   rF   rG   rH   rI   rK   rL   rN   rO   rQ   rR   rS   rT   rU   rX   )r
   r$   r%   Úhistogram_bucketsÚupdate_time_bucketss        r   Ú__init__z$AutoscalerPrometheusMetrics.__init__   sñ  € ð 08ð 0Õ;LØ"ð<ñ <ô <ˆDŒMð ".ˆDÔð!ð !ð !Ðð. #@Ð"?Ð"?ÐÝ6?Ø1ð>ð ,ØØ&ØœØ)ð7ñ 7ô 7÷ Šf ˆfÑ.Ô.ð Ô(õ 2;Ø,ðEð ,ØØ&ØœØ)ð
2ñ 
2ô 
2÷ Šf ˆfÑ.Ô.ð Ô#õ +4Øð0à+ØØ&ØœØ+ð	+ñ 	+ô 	+÷ Šf ˆfÑ.Ô.ð Ôõ ).ØØ8ðð Ø&Øœð
)ñ 
)ô 
)ˆDÔõ (-ØØ1ðð Ø&Øœð
(ñ 
(ô 
(ˆDÔõ */Ø'ð&ðð Ø&Øœð*ñ *ô *ˆDÔ&õ +2ØØ*Ø+ØØ&Øœð+ñ +ô +÷ Šf ˆfÑ.Ô.ð Ôõ +2ØØ*Ø+ØØ&Øœð+ñ +ô +÷ Šf ˆfÑ.Ô.ð Ôõ */Ø Ø=Ø+ØØ&Øœð*ñ *ô *÷ Šf ˆfÑ.Ô.ð Ôõ ,1Ø"Ø?Ø+ØØ&Øœð,ñ ,ô ,÷ Šf ˆfÑ.Ô.ð Ô!õ +0Ø!Ø1Ø+ØØ&Øœð+ñ +ô +÷ Šf ˆfÑ.Ô.ð Ô õ 18Ø%ðGà+ØØ&Øœð1ñ 1ô 1÷ Šf ˆfÑ.Ô.ð Ô$õ ,3Ø Ø7Ø+ØØ&Øœð,ñ ,ô ,÷ Šf ˆfÑ.Ô.ð Ôõ 07Ø$Ø;Ø+ØØ&Øœð0ñ 0ô 0÷ Šf ˆfÑ.Ô.ð Ô#õ /6Ø#Ø3Ø+Ø!Ø&Øœð/ñ /ô /÷ Šf ˆfÑ.Ô.ð Ô"õ 3:Ø'Ø7Ø+Ø!Ø&Øœð3ñ 3ô 3÷ Šf ˆfÑ.Ô.ð Ô&õ 4;Ø(ØSØ+Ø!Ø&Øœð4ñ 4ô 4÷ Šf ˆfÑ.Ô.ð Ô'õ 4;Ø(ØDØ+Ø!Ø&Øœð4ñ 4ô 4÷ Šf ˆfÑ.Ô.ð Ô'õ .5Ø"ØMØ+Ø!Ø&Øœð.ñ .ô .÷ Šf ˆfÑ.Ô.ð Ô!õ :AØ.ð"à+Ø!Ø&Øœð:ñ :ô :÷ Šf ˆfÑ.Ô.ð Ô-õ 3:Ø'ð-à+Ø!Ø&Øœð3ñ 3ô 3÷ Šf ˆfÑ.Ô.ð Ô&õ -2Ø#Ø9Ø6Ø Ø&Øœð-ñ -ô -ˆDÔ"õ -2Ø#Ø;Ø6Ø Ø&Øœð-ñ -ô -ˆDÔ"Ð"Ð"r   c                 ó   — | j         S r   )rY   r   s    r   r$   z(AutoscalerPrometheusMetrics.session_name  s   € àÔ%Ð%r   )NN)	r   r   r   Ústrr   r   r^   Úpropertyr$   r   r   r   r#   r#      si   € € € € € àTXðy	ð y	Ø #ðy	Ø6>Ð?PÔ6Qðy	ð y	ð y	ð y	ðv 
ð	&ð 	&ñ 
Œð	&ð 	&ð 	&r   r#   c                   ó"   — e Zd Zddefd„Zd„ ZdS )r#   Nr$   c                 ó   — d S r   r   )r
   r$   s     r   r^   z$AutoscalerPrometheusMetrics.__init__   s   € ØˆDr   c                 ó   — t          ¦   «         S r   )r   )r
   Úattrs     r   Ú__getattr__z'AutoscalerPrometheusMetrics.__getattr__#  s   € Ý‘<”<Ðr   r   )r   r   r   r`   r^   rf   r   r   r   r#   r#     sC   € € € € € ð	ð 	¨ð 	ð 	ð 	ð 	ð	 ð 	 ð 	 ð 	 ð 	 r   N)Útypingr   r   Úprometheus_clientr   r   r    r!   r#   ÚImportErrorÚobjectr   r   r   ú<module>rk      sü   ðØ Ð Ð Ð Ð Ð ðð ð ð ð ñ ô ð ð&M àNÐNÐNÐNÐNÐNÐNÐNÐNÐNÐNÐNð~&ð ~&ð ~&ð ~&ð ~&ñ ~&ô ~&ð ~&ð ~&ð ~&øð@ ð  ð  ð  ð ð  ð  ð  ð   fñ  ô  ð  ð  ð  ð  ð øøøs   •0 °AÁA