o
    $i'7                     @   s  d dl mZmZ d dlmZ d dlmZmZ d dlm	Z	 e	eG dd dZ
ddd	d	d
ddZdddddddZddddddddZe	G dd deZe	eG dd dZddi g ddddddiddd dddd d!d"d#d$id%d&id'did(d)d*d+ddd,d-ddd.d/
d0g d1dd2d3d	dd4ddd5d6d7d4dd4d4dd5gd8
Zi d9i d:dd;d<d=dd>dd?dd@i g ddAdBdd d dCdDd<dEd dFddGdHdIddddddddddJddddKdLddMddNd4dOdPdii dQddRdSdTdUdVddWdXdYdZd[dd\d dd]d^d_dd`dZdaddbd dd]gdcd<ddddeddfg dgg dhd4dig djd4dkd1dldd dmdndodpd4dqd4dg drd2d3d	dd4ddd5d6d7d4dd4d4dd5gdd4dsdtZddudgig d dQdvd4dwdxdydwdzd{dwgd|d7d}g dd~ddd(d(dgd	ddi d(ddSg d4d4d1dd2dd	dd4ddd5d6d7d4dd4d4dd5gdZddudig dQdd4dwgd|d7dg dd<dgd	ddddddiddSg d1dd2dd	dd4ddd5d6d7d4dd4d4dd5gd	Zddi g ddHg ddddgdddgd	ddi ddSg d4d4d1dd2d3d	dd4ddd5d6d7d4dd4d4dd5gdZi d9i d;d<d=dd>dd?dd@i g ddAdBdd d dCdFddGdHdIddddddddddJddddKdLddMdd:ddNd4dOdddddddQddRdSi dTdUdVddWdXdcd<ddddeddfg dgg dhd4dig djd4dkd1dldd dmdndodpdd4dd4ddgdrdd2d3d	dd4ddd5d6d7d4dd4d4dd5gddd4dsZe	G dd deZe	eG dd dZe	eG dd dZe	eG dd dZd4S )    )	dataclassfield)Enum)ListOptional)DeveloperAPIc                   @   s.   e Zd ZU eed< eed< eed< eed< dS )GridPosxywhN)__name__
__module____qualname__int__annotations__ r   r   l/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/ray/dashboard/modules/metrics/dashboards/common.pyr      s
   
 r   T0 
randomWalkA)exemplarexprintervallegendFormat	queryTyperefIdheatmapF)formatfullMetaSearchincludeNullMetadatainstantrange
useBackend)r   r   r    r!   r"   r#   r$   c                   @   s   e Zd ZeZeZeZdS )TargetTemplateN)	r   r   r   GRAPH_TARGET_TEMPLATEGRAPHHEATMAP_TARGET_TEMPLATEHEATMAP#HISTOGRAM_BAR_CHART_TARGET_TEMPLATEHISTOGRAM_BAR_CHARTr   r   r   r   r%   .   s    r%   c                   @   s4   e Zd ZU dZeed< eed< ejZe	e ed< dS )Targeta  Defines a Grafana target (time-series query) within a panel.

    A panel will have one or more targets. By default, all targets are rendered as
    stacked area charts, with the exception of legend="MAX", which is rendered as
    a blue dotted line. Any legend="FINISHED|FAILED|DEAD|REMOVED" series will also be
    rendered hidden by default.

    Attributes:
        expr: The prometheus query to evaluate.
        legend: The legend string to format for each time-series.
    r   legendtemplateN)
r   r   r   __doc__strr   r%   r'   r.   r   r   r   r   r   r,   5   s
   
 r,   z${datasource}z<Description>)defaults	overrides      unitnoneg      ?zdark-orangeschemeexponentialSpectral@   )exponentfillminmodereversescaler7   stepscolorzrgba(255,0,255,0.7)leg&.>showautozRequest count)layoutvaluesingle)r>   showColorScale
yHistogramleft)axisPlacementr?   r5   )
	calculatecellGap
cellValuesrB   	exemplarsfilterValuesr-   	rowsFrametooltipyAxisz11.2.0z<Title>z
object:628unitsN)	$$hashKeyr   labellogBasemaxr=   rD   z
object:629short)

datasourcedescriptionfieldConfigidoptionspluginVersiontargetstitletypeyaxesaliasColorsbars
dashLength
   dashesr[   r\   r]   gridPos   )r   r   r	   r
   r<   fillGradienthiddenSeriesr^      r-   current)alignAsTableavgro   	hideEmptyhideZerorY   r=   	rightSiderD   sortsortDesctotalvalueslines	linewidthnullPointModer_   alertThreshold
percentager`   z7.5.17pointradius   pointsrendererflotseriesOverrideszobject:2987MAXz#1F60C4)rV   aliasri   rB   r<   stackz	object:78z,/FINISHED|FAILED|DEAD|REMOVED|Failed Nodes:/)rV   r   rm   zMAX + PENDINGz#777777spaceLengthr   steppedLinera   
thresholdstimeFromtimeRegions	timeShiftrb   rS   
individual)sharedru   
value_typerc   graphtime)bucketsr>   namerD   rx   )align
alignLevel)xaxisrd   yaxisr>   zsuper-light-yellow)rB   rG   zsuper-light-green2   greend   )r>   rA   )rB   mappingsr=   r   r5   N   rG   arealastNotNull)calcsfieldsrx   )	colorMode	graphModejustifyModeorientationreduceOptionstexttextModestatTokens)r[   r]   r^   r_   r`   ra   r   r   rb   rc   rd   zcontinuous-YlBlzrgb(230, 230, 230))rB   r   r   r5   	titleSize)r   showThresholdLabelsshowThresholdMarkersr   gauge)	r[   r]   r^   r_   r`   ra   rb   rc   rd   tablerightpercent)displayMode	placementrx   pie)displayLabelsr-   pieTyper   r   piechart)r[   r\   r]   r^   r_   r`   ra   r   r   rb   rc   rd   bottom)
showLegendr   r   )r|   r-   r   seriesrw   rd   r   c                   @   s$   e Zd ZeZeZeZe	Z
eZeZdS )PanelTemplateN)r   r   r   GRAPH_PANEL_TEMPLATEr'   HEATMAP_TEMPLATEr)   PIE_CHART_TEMPLATE	PIE_CHARTSTAT_PANEL_TEMPLATESTATGAUGE_PANEL_TEMPLATEGAUGEBAR_CHART_PANEL_TEMPLATE	BAR_CHARTr   r   r   r   r     s    r   c                   @   s   e Zd ZU dZeed< eed< eed< eed< ee ed< dZ	eed< d	Z
eed
< dZeed< dZee ed< ejZee ed< dZeed< dS )Panela|  Defines a Grafana panel (graph) for the Ray dashboard page.

    A panel contains one or more targets (time-series queries).

    Attributes:
        title: Short name of the graph. Note: please keep this in sync with the title
            definitions in Metrics.tsx.
        description: Long form description of the graph.
        id: Integer id used to reference the graph from Metrics.tsx.
        unit: The unit to display on the y-axis of the graph.
        targets: List of query targets.
        fill: Whether or not the graph will be filled by a color.
        stack: Whether or not the lines in the graph will be stacked.
    rb   r\   r^   r5   ra   rh   r<   Tr   r4   rz   Ngrid_posr.   F	hideXAxis)r   r   r   r/   r0   r   r   r   r,   r<   r   boolrz   r   r   r   r   r'   r.   r   r   r   r   r   r     s   
 r   c                   @   s:   e Zd ZU dZeed< eed< ee ed< dZ	e
ed< dS )RowzDefines a Grafana row that can contain multiple panels.

    Attributes:
        title: The title of the row
        panels: List of panels contained in this row
        collapsed: Whether the row should be collapsed by default
    rb   r^   panelsF	collapsedN)r   r   r   r/   r0   r   r   r   r   r   r   r   r   r   r   r     s   
 r   c                   @   sf   e Zd ZU eed< eed< ee ed< eed< eedZee	 ed< eedZ
ee ed< dd	 Zd
S )DashboardConfigr   default_uidstandard_global_filtersbase_json_file_name)default_factoryr   rowsc                 C   s   | j s
| jstdd S d S )Nz0At least one of panels or rows must be specified)r   r   
ValueError)selfr   r   r   __post_init__  s   zDashboardConfig.__post_init__N)r   r   r   r0   r   r   r   listr   r   r   r   r   r   r   r   r   r     s   
 r   )dataclassesr   r   enumr   typingr   r   ray.util.annotationsr   r   r&   r(   r*   r%   r,   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>   s   





4
	
 !"#$%(	?@ABCDEFGHIK	
i	
;
	
0
,
	
&'()*+,-./0123456?

SW	