import{r as x,bw as I,bx as b,u as P,eb as f,bo as j,j as t,D as E,cp as F,o as D,q as l,b as k,bS as v,$ as G}from"./index-46ma1THH.js";import{G as y}from"./GrafanaDashboard-EkwQvwgz.js";import{P as M}from"./Panel-CnxQ3Lqy.js";import{u as S}from"./useUserPermissions-DiAMkzC6.js";import"./Deprecated-CcWZugSq.js";const T=()=>{I(b.fgMetrics);const{id:n,fsId:o,fgId:i}=P(),{currentData:e,isFetching:d,refetch:u}=f({pId:+n,fsId:+o,fgId:+i}),a=[{name:"feature_group_id",value:i}],m=j(),{canEdit:p,isLoading:c,isDataScientist:h}=S(),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(E,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(M,{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:()=>{m(D(l.project.featureGroup.edit,l.project.value,{id:n,fsId:o,fgId:i}))},onClickRefresh:u,pathnamePostFix:"/metrics"}),t.jsxs(k,{mt:"10px",title:"Online metrics",height:"auto",children:[!(e!=null&&e.onlineEnabled)&&t.jsx(v,{mainText:"Metrics not supported for non-online feature groups"}),(e==null?void 0:e.onlineEnabled)&&t.jsx(y,{panels:g})]}),t.jsx(G,{width:"100%",minHeight:"40px",sx:{visibility:"hidden"},children:"INVISIBLE"})]}):t.jsx(F,{})},R=x.memo(T);export{R as default};
