text: var y=Object.defineProperty;var d=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var p=(e,t,s)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,m=(e,t)=>{for(var s in t||(t={}))g.call(t,s)&&p(e,s,t[s]);if(d)for(var s of d(t))x.call(t,s)&&p(e,s,t[s]);return e};import{E as b}from"./ExLoading.befd655b.js";import{s as k,Y as v}from"./index.14cddf8e.js";import{u as S,h as q,i as E,j as R,E as w,k as L,l as T}from"./ExFluxDetail.87b8dedc.js";import{E as j}from"./ExTable.2a9f5263.js";import{F as a}from"./ExFormInterface.d1e14f35.js";import{h as F,b as N,z as C,G as i,f as u}from"./ui.c327b114.js";import{u as I,L as D}from"./naive.650dd42a.js";import"./common.c9fa31ee.js";const n=[{label:"\u6240\u6709",value:""}],o=[{label:"\u6240\u6709",value:""}],U="u1nflspg";function O(){return[{key:"result",name:"\u7ED3\u679C\uFF1A",type:a.Select,placeholder:"\u8BF7\u9009\u62E9\u8981\u7B5B\u9009\u7684\u7ED3\u679C",options:[{label:"\u6240\u6709",value:""},{label:"\u6210\u529F",value:"0"},{label:"\u5931\u8D25",value:"1"}]},{key:"service",name:"\u670D\u52A1\uFF1A",type:a.Select,placeholder:"\u8BF7\u9009\u62E9\u8981\u7B5B\u9009\u7684\u8C03\u7528\u670D\u52A1",options:n},{key:"route",name:"\u8DEF\u7531",type:a.Select,placeholder:"\u8BF7\u9009\u62E9\u8981\u7B5B\u9009\u7684\u8C03\u7528\u8DEF\u7531",options:o},{key:"exception",name:"\u5F02\u5E38",type:a.Select,placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u7B5B\u9009\u5F02\u5E38\u51FA\u9519",options:[{label:"\u6240\u6709",value:""},{label:"\u662F",value:"true"}]},{key:"limit",name:"\u67E5\u8BE2\u6570\u91CF\uFF1A",type:a.InputNumber,placeholder:"\u8BF7\u8F93\u5165\u8981\u67E5\u8BE2\u7684\u8BB0\u5F55\u6570\u91CF"},{key:"useGt",name:"\u8BF7\u6C42\u8017\u65F6\u5927\u4E8E\uFF1A",type:a.InputNumber,placeholder:"\u8BF7\u8F93\u5165\u8981\u67E5\u8BE2\u7684\u8017\u65F6\u8BB0\u5F55"},{key:"begin:end",name:"\u5F00\u59CB\u7ED3\u675F\u65F6\u95F4\uFF1A",type:a.DateRange,span:8,defaultValue:[v(3).toISOString(),new Date().toISOString()]}]}function P(){return[{title:"\u670D\u52A1\u540D\u79F0",key:"service",width:100},{title:"\u8BF7\u6C42\u8DEF\u7531",key:"route",width:200,ellipsis:{tooltip:!0}},{title:"\u5B8C\u6574\u5730\u5740",key:"uri",width:100,ellipsis:{tooltip:!0}},{title:"\u7ED3\u679C",key:"result",width:80,render(e){return e.result==="0"?"\u6210\u529F":"\u5931\u8D25"}},{title:"\u72B6\u6001\u7801",key:"status",width:70},{title:"\u8BF7\u6C42\u5730\u5740",key:"addr",width:150},{title:"\u8017\u65F6",key:"use",width:100,render(e){let t=0;if(e.use&&(t=e.use),!t)return"--";const s={trigger:()=>i("span",null,[t.toLocaleString(),u("ms")])},r=[],l=(c,f)=>{if(!e[c])return;const h=e[c];r.push(i("li",null,[f,u(": "),h.toLocaleString(),u("ms")]))};return l("dnsUse","DNS"),l("tcpUse","TCP"),l("tlsUse","TLS"),l("processingUse","PROCESSING"),l("transferUse","TRANSFER"),i(D,null,m({default:()=>[i("ul",{class:U},[r])]},s))}},{title:"\u51FA\u9519\u7C7B\u578B",key:"errCategory",width:100},{title:"\u5F02\u5E38",key:"exception",width:80,render(e){return e.exception?"\u662F":"\u5426"}},{title:"\u51FA\u9519\u4FE1\u606F",key:"error"},{title:"\u5B8C\u6574\u8BB0\u5F55",key:"requestDetail",width:90,render(e){return i(w,{measurement:L,data:e,tagKeys:["service","route","method","result"]},null)}},{title:"\u65F6\u95F4",key:"createdAt",width:180,fixed:"right"}]}var B=F({name:"RequestStats",setup(){const e=I(),{requestServices:t,requests:s,requestRoutes:r}=S();return N(async()=>{try{await q(),await E()}catch(l){k(e,l)}}),C(()=>{R()}),{requests:s,requestServices:t,requestRoutes:r}},render(){const{requests:e,requestServices:t,requestRoutes:s}=this;return t.processing||s.processing?i(b,null,null):(n.length===1&&t.items.length!==0&&t.items.forEach(r=>{n.push({label:r,value:r})}),o.length===1&&s.items.length!==0&&s.items.forEach(r=>{o.push({label:r,value:r})}),i(j,{disableAutoFetch:!0,hidePagination:!0,title:"HTTP\u8BF7\u6C42\u7EDF\u8BA1",data:e,filters:O(),columns:P(),fetch:T},null))}});export{B as default};
  