import{r as j,j as t}from"./vendor-react-wBh_31cN.js";import{C as k,a as I,b as g,c as F}from"./card-DISTA6Ay.js";import{G as N}from"./GrafanaDashboard--MThg1z8.js";import{R as T}from"./ResourceNotFound-DwuevSJ8.js";import{M as y,aq as C,g as p,r as o}from"./index-BKr2rJhV.js";import{u as D}from"./useTitle-DQo_L6Ox.js";import{t as E}from"./titles-CzjGGAB3.js";import{P as G}from"./Panel-epT8eD0X.js";import{N as _}from"./NoData-jkjqmCYT.js";import{u as M}from"./useUserPermissions-BVMFDLlq.js";import{c as R,u as z}from"./vendor-router-D1GqFWiT.js";import"./tabs-DF7ID_Y6.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-redux-CJZrIb6x.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-grid-CeFlDWv4.js";import"./MissingMandatoryTagsWarning-DpOcErx3.js";import"./tooltip-Da8-EbK8.js";import"./badge-nyizWwTN.js";import"./combobox-CcK1PxyF.js";import"./input-group-Z3Qmt3PL.js";import"./input-H6_qmzms.js";import"./label-Dnebucx5.js";import"./textarea-Co48BFy3.js";import"./vendor-recharts-DmJlpLaF.js";import"./list-page-header-DZysveul.js";import"./animated-progress-BdqEbBYd.js";import"./separator-2OqrG5Vy.js";import"./value-76ihWpF6.js";import"./metadata-field-B_vcklh-.js";import"./time-utils-tK1noPML.js";import"./addDays-DjM7nKyN.js";import"./always-CtAmwIxm.js";import"./init-BDcDHUTz.js";import"./concat-AxOj0lUI.js";import"./formatDistance-qDinyJzC.js";import"./CardActionButton-Ch696ne3.js";import"./Deprecated-lKLzSfj7.js";import"./uniqBy-qYjau2JN.js";import"./sort-BIlPehKK.js";import"./ascend-D9xyxTFQ.js";import"./selectors-CMD4o3wq.js";import"./index-DkvW68Om.js";import"./useCurrentProject-C6qZaZgv.js";import"./useProject-FSnHbCQX.js";import"./index-BeaoFlb1.js";import"./project-eQY1xQe-.js";const H=()=>{D(E.fgMetrics);const{id:s,fsId:n,fgId:m}=R(),{currentData:e,isFetching:d,refetch:u}=y({pId:+s,fsId:+n,fgId:+m}),i=[{name:"feature_group_id",value:m}],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:""}],h=z(),{canEdit:b,isLoading:f,isDataScientist:v,isFeatureStoreRestricted:P}=M(),r="grafana/d-solo/onlineFS/onlinefs",a="350px",x=[{title:"Deserialization Time",height:a,linkParams:{urlPath:r,variables:i,panelId:9}},{title:"Processing Time",height:a,linkParams:{urlPath:r,variables:i,panelId:10}},{title:"Messages rate",height:a,linkParams:{urlPath:r,variables:i,panelId:7}},{title:"Error rate",height:a,linkParams:{urlPath:r,variables:i,panelId:30}},{title:"Byte rate",height:a,linkParams:{urlPath:r,variables:i,panelId:15}},{title:"Record Size",height:a,linkParams:{urlPath:r,variables:i,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:r,variables:c,panelId:56}},{title:"Online ingestions",height:a,linkParams:{urlPath:r,variables:i,panelId:64}}];return d?t.jsx(C,{}):e?t.jsxs(t.Fragment,{children:[t.jsx(G,{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:!b||v||P||f,onClickEdit:()=>{h(p(o.project.featureGroup.edit,o.project.value,{id:s,fsId:n,fgId:m}))},onClickRefresh:u,pathnamePostFix:"/metrics"}),t.jsxs(k,{className:"mt-2.5 h-auto",children:[t.jsx(I,{children:t.jsx(g,{children:"Online metrics"})}),t.jsxs(F,{children:[!(e!=null&&e.onlineEnabled)&&t.jsx(_,{mainText:"Metrics not supported for non-online feature groups"}),(e==null?void 0:e.onlineEnabled)&&t.jsx(N,{panels:x})]})]}),t.jsx("div",{className:"invisible min-h-[40px] w-full"})]}):t.jsx(T,{resource:"feature group",backHref:p(o.project.featureGroup.list,o.project.value,{id:s,fsId:n}),backLabel:"Back to feature groups"})},Ge=j.memo(H);export{Ge as default};
