import{r as x,bb as b,u as I,dm as f,b4 as P,j as t,L as j,bW as E,o as F,q as l,Q as k,d as v,bc as D}from"./index-CK33qGU_.js";import{G}from"./GrafanaDashboard-CINcp9ef.js";import{P as y}from"./Panel-q_vviXAK.js";import{N as L}from"./NoData-CuLyR2Bg.js";import{u as M}from"./useUserPermissions-CGy0I-II.js";import"./Deprecated-D5xZ0QMJ.js";import"./CardActionButton-DcsFpjJz.js";import"./useDownload-hrjXceJg.js";import"./useProject-BzBQtp4J.js";import"./length-fOfC3W0h.js";import"./FileUploaderButton-Bppadu35.js";import"./dumbPluralize-CcxDsNiu.js";const N=()=>{b(D.fgMetrics);const{id:n,fsId:o,fgId:i}=I(),{currentData:e,isFetching:m,refetch:d}=f({pId:+n,fsId:+o,fgId:+i}),a=[{name:"feature_group_id",value:i}],p=P(),{canEdit:u,isLoading:c,isDataScientist:h}=M(),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:()=>{p(F(l.featureGroup.edit,l.project.value,{id:n,fsId:o,fgId:i}))},onClickRefresh:d,pathnamePostFix:"/metrics"}),t.jsxs(k,{mt:"10px",title:"Online metrics",height:"auto",children:[!(e!=null&&e.onlineEnabled)&&t.jsx(L,{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,{})},W=x.memo(N);export{W as default};
