import{r as P,bx as v,by as j,u as g,ee as k,bo as y,j as t,D as T,cq as f,s as D,t as m,W as E,bT as F,a as N}from"./index-_eM6l4Nf.js";import{G}from"./GrafanaDashboard-C8RHXN8Z.js";import{P as _}from"./Panel-BNKhRIJO.js";import{u as M}from"./useUserPermissions-Dd9YjnbM.js";import"./Deprecated-Cn0z8EIY.js";const z=()=>{v(j.fgMetrics);const{id:i,fsId:o,fgId:n}=g(),{currentData:e,isFetching:d,refetch:u}=k({pId:+i,fsId:+o,fgId:+n}),r=[{name:"feature_group_id",value:n}],l=[{name:"database",value:e!=null&&e.featurestoreName?e==null?void 0:e.featurestoreName.replace(/_featurestore$/,""):""},{name:"table",value:e!=null&&e.name&&(e!=null&&e.version)?`${e.name}_${e.version}`:""}],p=[{name:"topic",value:e!=null&&e.onlineTopicName?e==null?void 0:e.onlineTopicName:""}],c=y(),{canEdit:h,isLoading:b,isDataScientist:x}=M(),s="grafana/d-solo/onlineFS/onlinefs",a="350px",I=[{title:"Deserialization Time",height:a,linkParams:{urlPath:s,variables:r,panelId:9}},{title:"Processing Time",height:a,linkParams:{urlPath:s,variables:r,panelId:10}},{title:"Messages rate",height:a,linkParams:{urlPath:s,variables:r,panelId:7}},{title:"Error rate",height:a,linkParams:{urlPath:s,variables:r,panelId:30}},{title:"Byte rate",height:a,linkParams:{urlPath:s,variables:r,panelId:15}},{title:"Record Size",height:a,linkParams:{urlPath:s,variables:r,panelId:45}},{title:"Table memory size",height:a,linkParams:{urlPath:"grafana/d-solo/ndb_memory/database-memory",variables:l,panelId:18}},{title:"Table disk size",height:a,linkParams:{urlPath:"grafana/d-solo/ndb_memory/database-memory",variables:l,panelId:22}},{title:"Onlinefs offsets",height:a,width:"100%",linkParams:{urlPath:s,variables:p,panelId:56}}];return d?t.jsx(T,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(_,{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:!h||x||b,onClickEdit:()=>{c(D(m.project.featureGroup.edit,m.project.value,{id:i,fsId:o,fgId:n}))},onClickRefresh:u,pathnamePostFix:"/metrics"}),t.jsxs(E,{mt:"10px",title:"Online metrics",height:"auto",children:[!(e!=null&&e.onlineEnabled)&&t.jsx(F,{mainText:"Metrics not supported for non-online feature groups"}),(e==null?void 0:e.onlineEnabled)&&t.jsx(G,{panels:I})]}),t.jsx(N,{width:"100%",minHeight:"40px",sx:{visibility:"hidden"},children:"INVISIBLE"})]}):t.jsx(f,{})},O=P.memo(z);export{O as default};
