import{d as C,v as x,a as k,u as q,r as c,D as w,l as G,c as D,T as m,b as R,w as d,n as v,P as _,U as M,e as n,o as f,J as V,f as A,t as T,z as E,_ as $}from"./index-FX23dEwE.js";import{g as O,a as P}from"./serverInfo-6H9DfUIE.js";import{S as B,a as Y}from"./SearchUtil-_PbmflM7.js";import{b as z}from"./app-VLUV72AC.js";import"./request-dCC5BMJA.js";import{p as J,q as u}from"./PromQueryUtil-fadptBha.js";const L={class:"__container_app_service"},Q=C({__name:"service",setup(F){x(a=>({"020139bb":v(_)+"22",eda9eb56:v(_)}));const b=k(),g=q();let t=c({info:{},report:{}}),h=c({info:{}});w(async()=>{o.tableStyle={scrollX:"100",scrollY:"calc(100vh - 600px)"};let a=(await O({})).data;h.info=(await P({})).data,t.info=a,t.report={providers:{icon:"carbon:branch",value:t.info.providers},consumers:{icon:"mdi:merge",value:t.info.consumers}}});const N=[{title:"provideServiceName",key:"service",dataIndex:"serviceName"},{title:"version",key:"version",dataIndex:"version"},{title:"subset",key:"group",dataIndex:"group"}],S=G(()=>{var a;return(a=b.params)==null?void 0:a.pathId});function y(a){return z(a).then(async p=>J(p,["qps","rt","request"],async e=>{e.versionGroupSelect={},e.versionGroupSelect.versionGroupArr=e.versionGroups.map(r=>r.versionGroup=(r.version?"version: "+r.version+", ":"")+(r.group?"group: "+r.group:"")||"无"),e.versionGroupSelect.versionGroupValue=e.versionGroupSelect.versionGroupArr[0];let i=await u(`sum (dubbo_provider_qps_total{interface='${e.serviceName}'}) by (interface)`),s=await u(`avg(dubbo_consumer_rt_avg_milliseconds_aggregate{interface="${e.serviceName}",method=~"$method"}>0)`),l=await u(`sum (increase(dubbo_provider_requests_total{interface="${e.serviceName}"}[1m]))`);e.avgQPS=i,e.avgRT=s,e.requestTotal=l}))}const o=c(new B([{label:"serviceName",param:"serviceName"},{label:"",param:"appName",defaultValue:S}],y,N,{pageSize:4},!0));o.onSearch();const I=a=>{g.push("/resources/services/distribution/"+a)};return M(E.SEARCH_DOMAIN,o),(a,p)=>{n("a-statistic"),n("a-flex"),n("a-card");const e=n("a-button");return f(),D("div",L,[m("",!0),R(Y,{"search-domain":o},{bodyCell:d(({column:i,text:s})=>[i.dataIndex==="serviceName"?(f(),V(e,{key:0,type:"link",onClick:l=>I(s)},{default:d(()=>[A(T(s),1)]),_:2},1032,["onClick"])):m("",!0)]),_:1},8,["search-domain"])])}}}),Z=$(Q,[["__scopeId","data-v-7b4acb37"]]);export{Z as default};
