import{r as x,bC as I,u as f,dZ as P,bw as b,j as t,L as j,ck as E,q as F,s as l,m as k,B as v,bD as D}from"./index-dP1W1_bd.js";import{G}from"./GrafanaDashboard-uDleUeMz.js";import{P as y}from"./Panel-M9AVvYdm.js";import{N as B}from"./NoData-DLZ_8GEo.js";import{u as L}from"./useUserPermissions-Olw8jjZn.js";import"./Deprecated-ClfPkp7s.js";import"./CardActionButton-BtCnEqTK.js";import"./uniqBy-6mvKp2Ip.js";import"./FileUploaderButton-frSujVRY.js";import"./useDownload-C3yCvYJa.js";import"./useProject-CXVt1xnE.js";import"./length-BzpOfCdE.js";import"./uniq-98MdbBvs.js";import"./dumbPluralize-CcxDsNiu.js";const M=()=>{I(D.fgMetrics);const{id:n,fsId:o,fgId:i}=f(),{currentData:e,isFetching:m,refetch:p}=P({pId:+n,fsId:+o,fgId:+i}),a=[{name:"feature_group_id",value:i}],d=b(),{canEdit:u,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 m?t.jsx(j,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(y,{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:!u||h||c,onClickEdit:()=>{d(F(l.featureGroup.edit,l.project.value,{id:n,fsId:o,fgId:i}))},onClickRefresh:p,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(G,{panels:g})]}),t.jsx(v,{width:"100%",minHeight:"40px",sx:{visibility:"hidden"},children:"INVISIBLE"})]}):t.jsx(E,{})},A=x.memo(M);export{A as default};
