1"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[4182],{95797(e,s,a){var n=a(79015),l=a(43866),t=a(85052),c=a(32115),r=a(37417),i=a(65311),m=a(89077),d=a(98847),o=a(93539),x=a(10879),u=a(79072),p=a(47801);function f(e,s,a){let n=0,l=0;for(let t of e){let e=Number(t[s]);a(e)&&(n+=e,l++)}return l>0?n/l:NaN}function h(){let{t:e}=(0,m.Bd)(),s=(0,l.I)({queryKey:["perf-metrics-summary",24],queryFn:()=>(0,x.R)(24),staleTime:6e4,retry:!1}),a=(0,i.useMemo)(()=>s.data?.data.models??[],[s.data]),p=(0,i.useMemo)(()=>({totalRequests:a.length,avgLatencyMs:Math.round(f(a,"avg_latency_ms",e=>Number.isFinite(e)&&e>0)),avgTps:f(a,"avg_tps",e=>Number.isFinite(e)&&e>0),successRate:f(a,"success_rate",Number.isFinite)}),[a]),h=(0,i.useMemo)(()=>a.slice(0,6),[a]),v=s.isLoading,j=a.length>0;return v||j?(0,n.jsx)("div",{className:"overflow-hidden rounded-lg border",children:(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2.5 px-4 py-2.5 sm:px-5 sm:py-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(d.f,{tone:"success",size:"xs",children:(0,n.jsx)(t.A,{})}),(0,n.jsx)("span",{className:"text-xs font-semibold whitespace-nowrap",children:e("Performance health")})]}),(0,n.jsx)("div",{className:"bg-border hidden h-4 w-px sm:block"}),v?(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2",children:["success","latency","throughput"].map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(o.E,{className:"h-3 w-14"}),(0,n.jsx)(o.E,{className:"h-4 w-16"})]},e))}):(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2",children:[(0,n.jsx)(g,{icon:t.A,label:e("Success rate"),value:(0,u.Fm)(p.successRate),valueClassName:(0,u.NA)(p.successRate),tone:"success"}),(0,n.jsx)(g,{icon:c.A,label:e("Average latency"),value:(0,u.YL)(p.avgLatencyMs),tone:"warning"}),(0,n.jsx)(g,{icon:r.A,label:e("Throughput"),value:(0,u.Y5)(p.avgTps),tone:"info"})]}),(0,n.jsx)("div",{className:"bg-border hidden h-4 w-px lg:block"}),!v&&j&&(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:h.map(e=>(0,n.jsx)(N,{model:e},e.model_name))})]})}):(0,n.jsx)("div",{className:"text-muted-foreground overflow-hidden rounded-lg border px-4 py-3 text-center text-xs",children:e("No performance data available")})}function g(e){let s=e.icon;return(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(d.f,{tone:e.tone,size:"xs",children:(0,n.jsx)(s,{})}),(0,n.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.label}),(0,n.jsx)("span",{className:(0,p.cn)("font-mono text-xs font-semibold tabular-nums",e.valueClassName),children:e.value})]})}function N(e){let s=e.model;return(0,n.jsxs)("span",{className:"bg-muted/50 inline-flex items-center gap-1.5 rounded-full px-2.5 py-1",children:[(0,n.jsx)("span",{className:"max-w-[10rem] truncate font-mono text-[11px]",children:s.model_name}),(0,n.jsx)("span",{className:(0,p.cn)("size-1.5 rounded-full",(0,u.NY)(s.success_rate)),"aria-hidden":"true"}),(0,n.jsx)("span",{className:(0,p.cn)("font-mono text-[11px] font-semibold tabular-nums",(0,u.NA)(s.success_rate)),children:(0,u.Fm)(s.success_rate)})]})}a.d(s,{PerformanceOverview:()=>h})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.