import{r as x,bx as I,u as f,dU as P,bp as b,j as t,L as j,cr as E,q as F,s as l,y as k,B as v,by as y}from"./index-C1DmWO_C.js";import{G as D}from"./GrafanaDashboard-DSm1z0fH.js";import{P as G}from"./Panel-Z-sMb6LN.js";import{N as B}from"./NoData-Y_e6mfNf.js";import{u as L}from"./useUserPermissions-BiARnwL4.js";import"./Deprecated-BQWZLUTP.js";const M=()=>{I(y.fgMetrics);const{id:n,fsId:o,fgId:i}=f(),{currentData:e,isFetching:d,refetch:m}=P({pId:+n,fsId:+o,fgId:+i}),a=[{name:"feature_group_id",value:i}],u=b(),{canEdit:p,isLoading:c,isDataScientist:h}=L(),s="grafana/d-solo/onlineFS/onlinefs",r="350px",g=[{title:"Deserialization Time",height:r,linkParams:{urlPath:s,variables:a,panelId:9}},{title:"Processing Time",height:r,linkParams:{urlPath:s,variables:a,panelId:10}},{title:"Messages rate",height:r,linkParams:{urlPath:s,variables:a,panelId:7}},{title:"Error rate",height:r,linkParams:{urlPath:s,variables:a,panelId:30}},{title:"Byte rate",height:r,linkParams:{urlPath:s,variables:a,panelId:15}},{title:"Record Size",height:r,linkParams:{urlPath:s,variables:a,panelId:45}}];return d?t.jsx(j,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(G,{title:e==null?void 0:e.name,version:e==null?void 0:e.version,data:e,idColor:(e==null?void 0:e.type)==="onDemandFeaturegroupDTO"?"labels.blue":"labels.orange",isEditDisabled:!p||h||c,onClickEdit:()=>{u(F(l.featureGroup.edit,l.project.value,{id:n,fsId:o,fgId:i}))},onClickRefresh:m,pathnamePostFix:"/metrics"}),t.jsxs(k,{mt:"10px",title:"Online metrics",height:"auto",children:[!(e!=null&&e.onlineEnabled)&&t.jsx(B,{mainText:"Metrics not supported for non-online feature groups"}),(e==null?void 0:e.onlineEnabled)&&t.jsx(D,{panels:g})]}),t.jsx(v,{width:"100%",minHeight:"40px",sx:{visibility:"hidden"},children:"INVISIBLE"})]}):t.jsx(E,{})},z=x.memo(M);export{z as default};
