import{r as v,bG as g,bH as k,u as f,bm as j,bx as E,j as t,L as F,cE as y,t as T,x as m,f as D,c5 as G,q as N}from"./index-DNBEEyYo.js";import{G as _}from"./GrafanaDashboard-alAWX7sj.js";import{P as M}from"./Panel-LhPx0w--.js";import{u as L}from"./useUserPermissions-j5Zhfxzb.js";import"./Deprecated-DmDD0-tM.js";const S=()=>{g(k.fgMetrics);const{id:n,fsId:o,fgId:i}=f(),{currentData:e,isFetching:d,refetch:u}=j({pId:+n,fsId:+o,fgId:+i}),r=[{name:"feature_group_id",value:i}],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}`:""}],c=[{name:"topic",value:e!=null&&e.onlineTopicName?e==null?void 0:e.onlineTopicName:""}],p=E(),{canEdit:h,isLoading:b,isDataScientist:x,isFeatureStoreRestricted:P}=L(),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:c,panelId:56}},{title:"Online ingestions",height:a,linkParams:{urlPath:s,variables:r,panelId:64}}];return d?t.jsx(F,{}):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:!h||x||P||b,onClickEdit:()=>{p(T(m.project.featureGroup.edit,m.project.value,{id:n,fsId:o,fgId:i}))},onClickRefresh:u,pathnamePostFix:"/metrics"}),t.jsxs(D,{mt:"10px",title:"Online metrics",height:"auto",children:[!(e!=null&&e.onlineEnabled)&&t.jsx(G,{mainText:"Metrics not supported for non-online feature groups"}),(e==null?void 0:e.onlineEnabled)&&t.jsx(_,{panels:I})]}),t.jsx(N,{width:"100%",minHeight:"40px",sx:{visibility:"hidden"},children:"INVISIBLE"})]}):t.jsx(y,{})},C=v.memo(S);export{C as default};
