import{r as n,t as i,j as e,a as c,n as x,p as h,b as d}from"./index-B-YXshIJ.js";import{a as j,u as o}from"./query-hooks-C0Pc4MKj.js";const p=()=>{const r=j(),t=o(),l=n.useMemo(()=>{const s=new Date;return s.setDate(s.getDate()-t),s},[t]),a=i.builds.allTimelineStats.useQuery({...r,queryFrom:l});return a.data?e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Analysed ".concat(x(a.data.count)," runs")}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl",children:"Slowest tasks"}),e.jsxs("table",{className:"table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{children:"Name"}),e.jsx("td",{children:"Time taken"})]})}),e.jsx("tbody",{children:a.data.slowest.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.name}),e.jsx("td",{children:h(s.time)})]},s.name))})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl",children:"High failure rate"}),a.data.failing.length===0?"No stages failed > 5% of the time":e.jsxs("table",{className:"table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{children:"Name"}),e.jsx("td",{children:"Failure rate"})]})}),e.jsx("tbody",{children:a.data.failing.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.name}),e.jsx("td",{children:d(s.failureRate)})]},s.name))})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl",children:"Frequently skipped"}),e.jsxs("table",{className:"table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{children:"Name"}),e.jsx("td",{children:"Time taken"})]})}),e.jsx("tbody",{children:a.data.skipped.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.name}),e.jsx("td",{children:d(s.skippedPercentage)})]},s.name))})]})]})]})]}):e.jsx(c,{})};export{p as default};
