sparkforensics-server 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/lib/static-files.js +5 -4
- package/package.json +4 -3
- package/public/assets/AutoscalingChurn-B96FKx97.js +1 -0
- package/public/assets/CacheUtilization-lKua3J1x.js +1 -0
- package/public/assets/CachingOpportunity-U0g-8HPV.js +1 -0
- package/public/assets/ColdStart-w8QYTNKo.js +1 -0
- package/public/assets/ConfigAudit-ClZp5BpV.js +1 -0
- package/public/assets/CoreUsageArea-o3kqQwyi.js +1 -0
- package/public/assets/Dashboard-Bjl-MYMm.js +1 -0
- package/public/assets/DuplicatePlanSubtree-Cm_UU3lY.js +1 -0
- package/public/assets/DurationHistogram-ltF-7M0A.js +1 -0
- package/public/assets/EmptyState-BCA3xioa.js +1 -0
- package/public/assets/ExecutorUtilization-Cn69i0uq.js +1 -0
- package/public/assets/GcPressure-CYsmU1d7.js +1 -0
- package/public/assets/ImpactEstimate-BGt-4WX5.js +1 -0
- package/public/assets/IncompleteRun-s6uQ8OLf.js +1 -0
- package/public/assets/JobFailures-DJ2dDvPA.js +1 -0
- package/public/assets/MemoryUtilization-C9G7P94X.js +1 -0
- package/public/assets/OverBroadcast-DYauoYWQ.js +1 -0
- package/public/assets/PartitionSizing-Cz_B0-uG.js +1 -0
- package/public/assets/PlanExplorer-_2oB5ouy.js +1 -0
- package/public/assets/PlanGraphRoute-Cj-GWM8W.js +1 -0
- package/public/assets/RetryWaste-D_m8ASwP.js +1 -0
- package/public/assets/RowPagination-BLsm8I6i.js +1 -0
- package/public/assets/ShuffleIO-pyDhxdaz.js +1 -0
- package/public/assets/Skew-BGLJuZZR.js +1 -0
- package/public/assets/SlowHost-ChdWVvGO.js +1 -0
- package/public/assets/SmallFiles-gTilBtjW.js +1 -0
- package/public/assets/SpeculationWaste-CVzgJnSj.js +1 -0
- package/public/assets/Spill-NGJGQaTB.js +1 -0
- package/public/assets/StageFailed-sGhki53z.js +1 -0
- package/public/assets/StageFindingGroup-AyI7BMd3.js +1 -0
- package/public/assets/StageHeader-BTzGkK8k.js +1 -0
- package/public/assets/StagePill-BlMOW_pU.js +1 -0
- package/public/assets/StageShape-DfOW93Z1.js +1 -0
- package/public/assets/StageSlowness-BMZ-K_5e.js +1 -0
- package/public/assets/Straggler-dffcAN7t.js +1 -0
- package/public/assets/TaskFailures-DGDwUK2A.js +1 -0
- package/public/assets/TinyTask-CfT8zZDr.js +1 -0
- package/public/assets/UnderBroadcast-CiOiJ0k1.js +1 -0
- package/public/assets/WidgetLeadSummary-BdUUi7L5.js +1 -0
- package/public/assets/charts-vendor-0VMaLVLN.js +59 -0
- package/public/assets/downsample-WmNM1qc9.js +1 -0
- package/public/assets/finding-anchor-DEV8JvgH.js +1 -0
- package/public/assets/impact-sort-DxaUheWV.js +1 -0
- package/public/assets/inbox-_QCYkBsP.js +1 -0
- package/public/assets/index-3vlFVNCg.js +9 -0
- package/public/assets/index-CjVklAdW.css +2 -0
- package/public/assets/parser-worker-B2bc0lWe.js +112 -0
- package/public/assets/plan-graph-vendor-B0sEms9Z.js +7 -0
- package/public/assets/plan-graph-vendor-DLioOiRN.css +1 -0
- package/public/assets/react-vendor-D2TLlSzI.js +9 -0
- package/public/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/public/assets/select-kuy1MiAo.js +1 -0
- package/public/assets/toggle-group-CUd-KWkp.js +1 -0
- package/public/assets/usePagedRows-jNUWgVTD.js +1 -0
- package/public/assets/useRecentFiles-D0OA_EOK.js +11 -0
- package/public/assets/useSortMode-BaeAA5cw.js +1 -0
- package/public/docs/404.html +3 -3
- package/public/docs/assets/{app.BgzsaTS3.js → app.APoq_UBs.js} +1 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.CvM5fuxe.js +1 -0
- package/public/docs/assets/chunks/{VPLocalSearchBox.DOq3t-On.js → VPLocalSearchBox.B3TPzlHq.js} +1 -1
- package/public/docs/assets/chunks/theme.PavXO_vz.js +2 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.CWpj01WU.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.CWpj01WU.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.CgzUsQ6W.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_impact-estimation.md.DYCDPgkh.js → contributor-guide_architecture_impact-estimation.md.CooslVJt.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.C-xxn0q7.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.C-xxn0q7.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.R27gQrgY.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.IbnfNrV3.js +6 -0
- package/public/docs/assets/{style.DXOMCXxn.css → style.DSixAiZE.css} +1 -1
- package/public/docs/assets/{user-guide_alternative-log-retrieval.md.sU3KGarf.js → user-guide_alternative-log-retrieval.md.B4tPGIal.js} +1 -1
- package/public/docs/assets/{user-guide_alternative-log-retrieval.md.sU3KGarf.lean.js → user-guide_alternative-log-retrieval.md.B4tPGIal.lean.js} +1 -1
- package/public/docs/assets/user-guide_getting-started.md.BJvwLEIM.js +3 -0
- package/public/docs/assets/user-guide_getting-started.md.BJvwLEIM.lean.js +1 -0
- package/public/docs/assets/{user-guide_mcp-tools.md.C8MiIu7F.js → user-guide_mcp-tools.md.Vi3RoflJ.js} +3 -3
- package/public/docs/assets/{user-guide_mcp-tools.md.C8MiIu7F.lean.js → user-guide_mcp-tools.md.Vi3RoflJ.lean.js} +1 -1
- package/public/docs/assets/user-guide_run-comparison.md.CQc1aoU8.js +1 -0
- package/public/docs/assets/user-guide_run-comparison.md.CQc1aoU8.lean.js +1 -0
- package/public/docs/assets/user-guide_understanding-findings.md.DL1UDhvR.js +1 -0
- package/public/docs/assets/user-guide_understanding-findings.md.DL1UDhvR.lean.js +1 -0
- package/public/docs/contributor-guide/architecture/board-widgets.html +6 -6
- package/public/docs/contributor-guide/architecture/detector-contract.html +6 -6
- package/public/docs/contributor-guide/architecture/drill-down.html +4 -4
- package/public/docs/contributor-guide/architecture/impact-estimation.html +6 -6
- package/public/docs/contributor-guide/architecture/index.html +4 -4
- package/public/docs/contributor-guide/architecture/overview.html +4 -4
- package/public/docs/contributor-guide/architecture/state-and-history.html +6 -6
- package/public/docs/contributor-guide/architecture/widget-rendering.html +6 -6
- package/public/docs/contributor-guide/architecture/worker-protocol.html +6 -6
- package/public/docs/contributor-guide/contributing.html +4 -4
- package/public/docs/contributor-guide/development-setup.html +4 -4
- package/public/docs/contributor-guide/testing.html +4 -4
- package/public/docs/hashmap.json +1 -1
- package/public/docs/index.html +4 -4
- package/public/docs/tuning-reference/anti-patterns.html +4 -4
- package/public/docs/tuning-reference/aqe.html +4 -4
- package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +4 -4
- package/public/docs/tuning-reference/bottleneck-cold-start.html +4 -4
- package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +4 -4
- package/public/docs/tuning-reference/bottleneck-failures.html +4 -4
- package/public/docs/tuning-reference/bottleneck-gc.html +4 -4
- package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +4 -4
- package/public/docs/tuning-reference/bottleneck-memory-utilization.html +4 -4
- package/public/docs/tuning-reference/bottleneck-retry-waste.html +4 -4
- package/public/docs/tuning-reference/bottleneck-shuffle.html +4 -4
- package/public/docs/tuning-reference/bottleneck-skew.html +4 -4
- package/public/docs/tuning-reference/bottleneck-slow-host.html +4 -4
- package/public/docs/tuning-reference/bottleneck-small-files.html +4 -4
- package/public/docs/tuning-reference/bottleneck-spill.html +4 -4
- package/public/docs/tuning-reference/bottleneck-straggler.html +4 -4
- package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +4 -4
- package/public/docs/tuning-reference/bottleneck-utilization.html +4 -4
- package/public/docs/tuning-reference/caching.html +4 -4
- package/public/docs/tuning-reference/cluster-config.html +4 -4
- package/public/docs/tuning-reference/config.html +4 -4
- package/public/docs/tuning-reference/data-formats.html +4 -4
- package/public/docs/tuning-reference/index.html +4 -4
- package/public/docs/tuning-reference/intro.html +4 -4
- package/public/docs/tuning-reference/joins.html +4 -4
- package/public/docs/tuning-reference/memory-model.html +4 -4
- package/public/docs/tuning-reference/metrics.html +4 -4
- package/public/docs/tuning-reference/partitioning.html +4 -4
- package/public/docs/tuning-reference/pyspark.html +4 -4
- package/public/docs/tuning-reference/shuffle.html +4 -4
- package/public/docs/tuning-reference/spark-architecture.html +4 -4
- package/public/docs/tuning-reference/table-formats.html +4 -4
- package/public/docs/user-guide/alternative-log-retrieval.html +6 -6
- package/public/docs/user-guide/getting-started.html +7 -7
- package/public/docs/user-guide/mcp-tools.html +8 -8
- package/public/docs/user-guide/run-comparison.html +6 -6
- package/public/docs/user-guide/understanding-findings.html +6 -6
- package/public/index.html +7 -6
- package/public/sample-runs/sample-run.ndjson.gz +0 -0
- package/vendor-core/detectors.js +149 -24
- package/vendor-core/docs-content/detection/cache.md +4 -3
- package/vendor-core/docs-content/detection/chrn.md +4 -2
- package/vendor-core/docs-content/detection/local.md +2 -3
- package/vendor-core/docs-content/detection/mem.md +3 -3
- package/vendor-core/docs-content/detection/spec.md +4 -3
- package/vendor-core/evidence-report.js +1 -1
- package/vendor-core/parser-worker.js +2 -2
- package/vendor-core/run-comparison.js +21 -2
- package/public/assets/AutoscalingChurn-CFJkiqxW.js +0 -1
- package/public/assets/CacheUtilization-kTKZBzDA.js +0 -1
- package/public/assets/CachingOpportunity-CU70EWcF.js +0 -1
- package/public/assets/ColdStart-hOI-WOvm.js +0 -1
- package/public/assets/ConfigAudit-B4oAksZY.js +0 -1
- package/public/assets/CoreUsageArea-D-dR3SQk.js +0 -1
- package/public/assets/Dashboard-MDhohsq4.js +0 -4
- package/public/assets/DuplicatePlanSubtree-54RKsfI7.js +0 -1
- package/public/assets/DurationHistogram-CviQyPNM.js +0 -1
- package/public/assets/EmptyState-v2ehFncc.js +0 -1
- package/public/assets/ExecutorUtilization-vHyFHgL6.js +0 -1
- package/public/assets/GcPressure-DINuhcno.js +0 -1
- package/public/assets/ImpactEstimate-C6GzFOY9.js +0 -1
- package/public/assets/IncompleteRun-a1kuCnU6.js +0 -1
- package/public/assets/JobFailures-CYwPfUhR.js +0 -1
- package/public/assets/MemoryUtilization-Dlfj0e_f.js +0 -1
- package/public/assets/OverBroadcast-BMu7Y8l9.js +0 -1
- package/public/assets/PartitionSizing-CvMGfSVB.js +0 -1
- package/public/assets/PlanExplorer-xYFme_Rx.js +0 -1
- package/public/assets/PlanGraphRoute-a3OGg6ET.js +0 -1
- package/public/assets/RetryWaste-JKRjOZ-J.js +0 -1
- package/public/assets/RowPagination-DypWbnic.js +0 -1
- package/public/assets/ShuffleIO-Mi8HiVu-.js +0 -1
- package/public/assets/Skew-C3iOScTC.js +0 -1
- package/public/assets/SlowHost-DKBg18v-.js +0 -1
- package/public/assets/SmallFiles-CCCB6AIu.js +0 -1
- package/public/assets/SpeculationWaste-DUNupw0_.js +0 -1
- package/public/assets/Spill-BlLdatik.js +0 -1
- package/public/assets/StageFailed-qtY7C7Yo.js +0 -1
- package/public/assets/StageFindingGroup-CoVdEZYs.js +0 -1
- package/public/assets/StageHeader-uDBLHgdg.js +0 -1
- package/public/assets/StagePill-CYCMdlIx.js +0 -1
- package/public/assets/StageShape-zs0mAjQJ.js +0 -1
- package/public/assets/StageSlowness-C7vg0u5Q.js +0 -1
- package/public/assets/Straggler-4BRGAQP4.js +0 -1
- package/public/assets/TaskFailures-CSjO23Kg.js +0 -1
- package/public/assets/TinyTask-6Zuovcn5.js +0 -1
- package/public/assets/UnderBroadcast-CePjo0ZV.js +0 -1
- package/public/assets/WidgetLeadSummary-DRNRVvn7.js +0 -1
- package/public/assets/charts-vendor-Cf1-wzeH.js +0 -59
- package/public/assets/downsample-D8XmJk6i.js +0 -1
- package/public/assets/finding-anchor-4TmpXd7j.js +0 -1
- package/public/assets/impact-sort-Cq6KOLqh.js +0 -1
- package/public/assets/inbox-DBFovbUX.js +0 -1
- package/public/assets/index-CHjV2-jB.js +0 -9
- package/public/assets/index-DMEtaP4u.css +0 -1
- package/public/assets/parser-worker-BMPPE37w.js +0 -64
- package/public/assets/plan-graph-vendor-B96a-e4N.js +0 -7
- package/public/assets/plan-graph-vendor-BnuhLJ6X.css +0 -1
- package/public/assets/react-vendor-DA6opS-q.js +0 -9
- package/public/assets/select-D5fK-za0.js +0 -1
- package/public/assets/toggle-group-lbIXRG0W.js +0 -1
- package/public/assets/usePagedRows-CFoZrPr4.js +0 -1
- package/public/assets/useRecentFiles-BPGQ6XII.js +0 -13
- package/public/assets/useSortMode-BOPpfLhJ.js +0 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.PQ5JepCp.js +0 -1
- package/public/docs/assets/chunks/theme.BP14rGBx.js +0 -2
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.B-OsL91z.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.B-OsL91z.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.BOeH4d1J.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.m3S3UdMk.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.m3S3UdMk.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.DbqPf2OT.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.B93qJ_tT.js +0 -6
- package/public/docs/assets/user-guide_getting-started.md.DtEM37MK.js +0 -3
- package/public/docs/assets/user-guide_getting-started.md.DtEM37MK.lean.js +0 -1
- package/public/docs/assets/user-guide_run-comparison.md.S0TWWmLY.js +0 -1
- package/public/docs/assets/user-guide_run-comparison.md.S0TWWmLY.lean.js +0 -1
- package/public/docs/assets/user-guide_understanding-findings.md.D0R_Y-R2.js +0 -1
- package/public/docs/assets/user-guide_understanding-findings.md.D0R_Y-R2.lean.js +0 -1
- /package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.BOeH4d1J.lean.js → contributor-guide_architecture_detector-contract.md.CgzUsQ6W.lean.js} +0 -0
- /package/public/docs/assets/{contributor-guide_architecture_impact-estimation.md.DYCDPgkh.lean.js → contributor-guide_architecture_impact-estimation.md.CooslVJt.lean.js} +0 -0
- /package/public/docs/assets/{contributor-guide_architecture_widget-rendering.md.DbqPf2OT.lean.js → contributor-guide_architecture_widget-rendering.md.R27gQrgY.lean.js} +0 -0
- /package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.B93qJ_tT.lean.js → contributor-guide_architecture_worker-protocol.md.IbnfNrV3.lean.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as t}from"./react-vendor-DA6opS-q.js";import{S as O,a as M,b as W,c as F,d as _}from"./select-D5fK-za0.js";import{at as V,L as p,W as v,n as D,av as R,T as J,E as k,as as z,j as C}from"./index-CHjV2-jB.js";import{W as E}from"./WidgetLeadSummary-DRNRVvn7.js";import{S as H}from"./StageHeader-uDBLHgdg.js";import{u as q,R as G}from"./finding-anchor-4TmpXd7j.js";import{I as N}from"./ImpactEstimate-C6GzFOY9.js";import{c as K}from"./impact-sort-Cq6KOLqh.js";import{u as Q,S as U}from"./useSortMode-BOPpfLhJ.js";import{R as X}from"./RowPagination-DypWbnic.js";import{u as Y}from"./usePagedRows-CFoZrPr4.js";import{P as Z}from"./PlanExplorer-xYFme_Rx.js";import{r as tt}from"./useRecentFiles-BPGQ6XII.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./StagePill-CYCMdlIx.js";import"./toggle-group-lbIXRG0W.js";function et(a){if(a.rule==="lowShuffleParallelism")return`${z(a)} tasks carrying the shuffle`;const n=z(a);return a.rule==="maxPartitionTooBig"?`Largest partition ${C(n)} (too large)`:`Largest partition ${C(n)}`}function st({entry:a,appModel:n}){const g=k(),r=q(a.partitions),u=g==="advanced"&&tt(a.stageId,n);return t.jsxs("div",{ref:r.ref,tabIndex:r.tabIndex,"data-flashed":r.dataFlashed,className:`space-y-2 ${G} transition-colors ${r.flashClassName}`,children:[t.jsx(H,{stageId:a.stageId,appModel:n}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a.partitions.map((i,d)=>t.jsxs("span",{children:[d>0?" · ":"",et(i)]},i.id))}),t.jsx(N,{finding:a.partitions[0]}),t.jsxs("div",{className:"space-y-2 pt-1",children:[t.jsx("ul",{className:"list-disc space-y-1 pl-5 text-xs text-muted-foreground",children:a.partitions.map(i=>t.jsxs("li",{children:[i.recommendation," ",t.jsx(N,{finding:i})]},i.id))}),u?t.jsx(Z,{stageId:a.stageId,appModel:n}):null]})]})}const jt=l.memo(function({appModel:n,catalog:g,defaultCollapsed:r=!0}){const[u,i]=l.useState(0),[d,h]=l.useState(!r),{sortMode:S,setSortMode:T,orderBy:$}=Q(),I=V(),{partitionFindings:x,sorted:m,orderedEntries:f}=l.useMemo(()=>{const e=g.filter(s=>s.type==="partitionSizing"),c=new Map;for(const s of e){if(s.stageId==null)continue;const o=c.get(s.stageId);o?(o.partitions.push(s),p[s.impactBand]<p[o.impactBand]&&(o.impactBand=s.impactBand)):c.set(s.stageId,{stageId:s.stageId,partitions:[s],impactBand:s.impactBand})}const P=[...c.values()].sort((s,o)=>p[s.impactBand]-p[o.impactBand]||s.stageId-o.stageId),A=$(P,s=>s.partitions,s=>s.stageId);return{partitionFindings:e,sorted:P,orderedEntries:A}},[g,S]),b=I?f.findIndex(e=>e.partitions.includes(I.finding)):null,{totalPages:w,effectivePage:j,visible:y}=Y(f,u,i,b);if(x.length===0){const e=n.stages.size;return t.jsx(v,{title:"Partition Sizing",open:d,onOpenChange:h,summary:t.jsx(E,{value:"No issues",context:`no issue detected: partition sizing checked across ${e} stage${e===1?"":"s"}`}),children:t.jsx("p",{className:"text-xs text-muted-foreground",children:"No partition-sizing issues detected."})})}const B=D(x),L=K(x,m.length,d);return t.jsx(v,{title:"Partition Sizing",impactBand:B,open:d,onOpenChange:h,summary:t.jsx(E,{value:`Stage ${m[0].stageId}`,context:`${m.length} stage${m.length===1?"":"s"} flagged`}),badges:t.jsxs(t.Fragment,{children:[t.jsx(J,{type:"partitionSizing",impactBand:B??"info"}),L?t.jsx(U,{mode:S,onChange:e=>{T(e),i(0)}}):null]}),children:t.jsxs("div",{className:"space-y-4",children:[y.map(e=>t.jsx(st,{entry:e,appModel:n},e.stageId)),t.jsx(X,{page:j,totalPages:w,onPrev:()=>i(e=>e-1),onNext:()=>i(e=>e+1),renderJumpControl:()=>t.jsxs(O,{value:String(j*R),onValueChange:e=>i(Math.floor(Number(e)/R)),children:[t.jsx(M,{size:"sm","aria-label":"Jump to stage",children:t.jsx(W,{placeholder:"Jump to stage"})}),t.jsx(F,{children:f.map((e,c)=>t.jsxs(_,{value:String(c),children:["Stage ",e.stageId]},e.stageId))})]})})]})})});export{jt as PartitionSizing};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,j as e}from"./react-vendor-DA6opS-q.js";import{a4 as i,a5 as l,G as o,v as x,a6 as c}from"./index-CHjV2-jB.js";import{r as d,P as m}from"./useRecentFiles-BPGQ6XII.js";function f({stageId:r,appModel:a}){const[s,n]=t.useState(!1);return d(r,a)?e.jsx("div",{className:"space-y-3",children:e.jsxs(i,{open:s,onOpenChange:n,children:[e.jsxs(l,{"aria-expanded":String(s),className:"flex cursor-pointer items-center gap-2 bg-transparent text-left",children:[e.jsx("h3",{className:"font-heading text-sm font-medium",children:"Plan context"}),s?e.jsx(o,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"}):e.jsx(x,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]}),e.jsx(c,{keepMounted:!0,children:e.jsx("div",{className:"pt-3",children:e.jsx(m,{stageId:r,appModel:a})})})]})}):null}export{f as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,T as Ke,t as Qe,v as et,x as tt,y as nt,z as st,A as at,E as ot,F as rt,G as it,H as lt,I as dt,r as p}from"./react-vendor-DA6opS-q.js";import{c as U,a as ct,b as Ie,s as ut,m as gt,w as ht,d as pt,f as ft,g as mt,p as xt,e as Y,I as Pe,t as bt,h as Ce,i as ce,B as Q,X as jt,j as ze,T as $e,C as Fe,k as yt,l as wt,n as Nt,o as vt,q as St,u as kt,D as Et,r as Le}from"./index-CHjV2-jB.js";import{f as He,C as It,D as Pt,a as Ct,b as Mt,c as Tt,d as Dt,u as Gt,r as _t,T as Rt}from"./useRecentFiles-BPGQ6XII.js";import{$ as Me,H as Te,P as De,u as Xe,g as Bt,B as At,E as Ot,R as zt,c as $t,d as Ft,e as Ge,M as Lt}from"./plan-graph-vendor-B96a-e4N.js";import{b as Ht}from"./impact-sort-Cq6KOLqh.js";import"./charts-vendor-Cf1-wzeH.js";const Xt=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],Yt=U("arrow-left-right",Xt);const Wt=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],qt=U("flag",Wt);const Vt=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],Zt=U("map",Vt);const Ut=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Jt=U("maximize-2",Ut);const Kt=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Qt=U("settings",Kt);const en=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],tn=U("timer",en);const nn=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],sn=U("zoom-in",nn);const an=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],on=U("zoom-out",an);function rn({id:t,sourceNodeId:s,planNode:n,category:a,segmentIndex:r,splitRole:o,durationShare:i,exclusiveDurationShare:l,findings:c}){return{id:t,sourceNodeId:s,label:n.name,category:a,operatorDetail:xt(n.name,n.detail??""),primaryMetric:mt(n.metrics),segmentIndex:r,splitRole:o,durationShare:i??null,exclusiveDurationShare:l??null,findings:c,metrics:(n.metrics??[]).map(g=>({name:g.name,value:ft(g)})),detailText:n.detail&&n.detail!==n.name?n.detail:""}}function ln(t,s){const{scope:n,stageId:a,appModel:r,findings:o=[],durationMode:i="exclusive"}=s;if(!t)return{nodes:[],edges:[],segmentIndex:null,segmentCount:0,scope:"full",segmentStageIds:new Map};const c=r.stages.get(a)?.sqlExecutionId??null,g=c!=null?r.sql.get(c):null,{segments:m,segOf:j,segmentTopology:k}=ct(t),N=m.filter(Boolean).length,I=g&&c!=null?Ie(t,r,g,c,i):null,M=i==="exclusive"?I:g&&c!=null?Ie(t,r,g,c,"exclusive"):null,_=new Map,B=g&&c!=null?ut(c,r.stages):[];if(B.length){const u=new Map;for(const f of B){const y=r.stages.get(f);y&&u.set(f,{submittedAt:y.submittedAt,completedAt:y.completedAt})}for(const[f,y]of gt(m,u,B,k))_.set(f,y)}const A=new Map;if(c!=null){for(const u of o)if(u.executionId===c)for(const f of u.planNodeIds??[]){const y=A.get(f);y?y.push(u):A.set(f,[u])}}const R=[],F=[],T=new Map;ht(t,(u,f)=>{const y=u.id,ee=pt(u.name),H=j.get(u),h=f?f.id:null,v=u.exchangeRole==="write"&&f?f.id:y,P=rn({id:y,sourceNodeId:v,planNode:u,category:ee,segmentIndex:H,splitRole:u.exchangeRole??null,durationShare:I?.get(u),exclusiveDurationShare:M?.get(u),findings:A.get(y)??[]});if(R.push(P),u.exchangeRole){const C=T.get(v)??{};C[u.exchangeRole]=P,T.set(v,C)}if(h){const C={id:`${h}->${y}`,source:h,target:y};if(u.exchangeRole==="write"){const D=_.get(H),V=D!=null?r.stages.get(D):void 0,$=V?.shuffleWriteBytes||V?.shuffleReadBytes;if($){C.shuffleBytes=$;const Z=T.get(v)??{};Z.shuffleBytes=$,T.set(v,Z)}}F.push(C)}},{dedupe:!0});for(const{read:u,write:f,shuffleBytes:y}of T.values())u&&f&&(u.pairedNodeId=f.id,f.pairedNodeId=u.id),y!=null&&(u&&(u.exchangeShuffleBytes=y),f&&(f.exchangeShuffleBytes=y));if(n==="full")return{nodes:R,edges:F,segmentIndex:null,segmentCount:N,scope:"full",segmentStageIds:_};let x=null;for(const[u,f]of _)if(f===a){x=u;break}if(x===null)return{nodes:R,edges:F,segmentIndex:null,segmentCount:N,scope:"full",segmentStageIds:_};const O=new Set,L=R.filter(u=>u.segmentIndex!==x?!1:(O.add(u.id),!0)),z=F.filter(u=>O.has(u.source)&&O.has(u.target));return{nodes:L,edges:z,segmentIndex:x,segmentCount:N,scope:"segment",segmentStageIds:_}}const se=220,ae=90,_e=24,dn=32,cn=32,Ye=64,un=0;function me(t,s,n={}){const a=new Me.graphlib.Graph({compound:!!n.groupOf});a.setGraph({rankdir:"RL",nodesep:Ye*2,ranksep:60,ranker:"tight-tree"}),a.setDefaultEdgeLabel(()=>({}));const r=new Set;if(n.groupOf){for(const o of t){const i=n.groupOf(o);i&&r.add(i)}for(const o of r)a.setNode(o,{})}for(const o of t){a.setNode(o.id,{width:se,height:ae});const i=n.groupOf?.(o);i&&a.setParent(o.id,i)}for(const o of s)a.setEdge(o.source,o.target);return Me.layout(a),t.map(o=>{const i=a.node(o.id);return{...o,position:{x:i.x-se/2,y:i.y-ae/2}}})}function gn(t,s,n={}){const a=n.paddingX??_e,r=n.paddingY??_e,o=n.headerHeight??dn,i=new Map;for(const l of t){const c=s(l);if(!c)continue;const g=l.position.x,m=l.position.y,j=g+se,k=m+ae,N=i.get(c);N?(N.minX=Math.min(N.minX,g),N.minY=Math.min(N.minY,m),N.maxX=Math.max(N.maxX,j),N.maxY=Math.max(N.maxY,k)):i.set(c,{minX:g,minY:m,maxX:j,maxY:k})}return[...i.entries()].map(([l,c])=>({id:l,position:{x:c.minX-a,y:c.minY-r-o},width:c.maxX-c.minX+a*2,height:c.maxY-c.minY+r*2+o}))}function xe(t,s,n={}){const a=new Set,r=[];for(const o of s){const i=l=>{const c=t(l);return c&&!a.has(c)?c:null};for(const l of gn(o,i,n))a.add(l.id),r.push(l)}return r}function We({delay:t=0,...s}){return e.jsx(Ke,{"data-slot":"tooltip-provider",delay:t,...s})}function Se({...t}){return e.jsx(Qe,{"data-slot":"tooltip",...t})}function ke({...t}){return e.jsx(et,{"data-slot":"tooltip-trigger",...t})}function Ee({className:t,side:s="top",sideOffset:n=4,align:a="center",alignOffset:r=0,children:o,...i}){return e.jsx(tt,{children:e.jsx(nt,{align:a,alignOffset:r,side:s,sideOffset:n,className:"isolate z-50",children:e.jsxs(st,{"data-slot":"tooltip-content",className:Y("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none",t),...i,children:[o,e.jsx(at,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const hn=40,pn=15;function fn(t){return t==null?null:t>=hn?"critical":t>=pn?"warning":"info"}const oe={scan:"⇩",exchange:"⇄",join:"⋈",aggregate:"Σ",sort:"↕",filter:"∇",aqe:"⚙",boilerplate:"·",transform:"→"};function mn(t){return t.find(s=>s.impactBand==="critical")??t.find(s=>s.impactBand==="warning")??t[0]}function xn({data:t}){const{label:s,operatorDetail:n,primaryMetric:a,category:r,splitRole:o,durationSharePct:i,findings:l}=t,c=oe[r]??oe.transform,g=fn(i);return e.jsxs("div",{className:"relative flex flex-col overflow-visible rounded-md border border-border bg-card px-3 py-2 text-xs shadow-sm",style:{width:se,height:ae},"data-category":r,children:[e.jsx(Te,{type:"target",position:De.Right,className:"opacity-0!"}),e.jsx(Te,{type:"source",position:De.Left,className:"opacity-0!"}),l&&l.length>0?(()=>{const m=mn(l);return e.jsxs(Se,{children:[e.jsxs(ke,{"data-testid":"node-finding-badge",className:Y("absolute -right-1 -top-1 flex items-center gap-1 rounded-full bg-card px-1.5 py-0.5 text-[10px] font-medium leading-none shadow-sm ring-1 ring-border",Ce[m.impactBand]),children:[e.jsx(Pe,{impactBand:m.impactBand}),bt(m.type),l.length>1?e.jsx("span",{children:l.length}):null]}),e.jsx(Ee,{className:"max-w-xs",children:e.jsx("ul",{className:"flex flex-col gap-1 text-left",children:l.map((j,k)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx(Pe,{impactBand:j.impactBand}),e.jsx("span",{children:He(j)})]},j.id??`${j.type}-${k}`))})})]})})():null,o==="read"?e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"paired: see write half"}):null,i!=null&&g?e.jsxs("div",{className:"mb-1 flex shrink-0 items-center gap-1.5",title:"Share of the plan's total stage wall time",children:[e.jsxs("span",{className:Y("shrink-0 text-[10px] font-medium tabular-nums",Ce[g]),children:[i,"%"]}),e.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{"data-testid":"duration-heat-bar-fill",className:Y("h-full rounded-full",ce[g]),style:{width:`${i>0?Math.max(i,4):0}%`}})}),e.jsxs("span",{className:"sr-only",children:["Duration share ",i,"%, ",g==="critical"?"high":g==="warning"?"medium":"low"]})]}):null,e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{"aria-hidden":"true",className:"shrink-0",children:c}),e.jsx("span",{className:"min-w-0 truncate font-medium",title:s,children:s})]}),n?e.jsx("p",{className:"truncate text-muted-foreground",title:n,children:n}):null,a?e.jsx("p",{className:"truncate text-muted-foreground",title:a,children:a}):null]})}const bn={read:"Read half. Consumes the shuffle written by its paired write half.",write:"Write half. Produces the shuffle its paired read half consumes."};function jn({node:t,onClose:s,onJumpToPaired:n}){const a=oe[t.category]??oe.transform,r=t.findings??[],o=t.metrics??[],i=t.category.charAt(0).toUpperCase()+t.category.slice(1);return e.jsxs("div",{"data-testid":"plan-node-detail",role:"dialog","aria-label":`Plan node detail: ${t.label}`,className:"flex h-full w-80 shrink-0 flex-col gap-3 overflow-y-auto border-l border-border bg-card p-3 text-xs",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{"aria-hidden":"true",className:"shrink-0",children:a}),e.jsx("span",{className:"break-words font-medium",children:t.label})]}),e.jsx(Q,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0","aria-label":"Close node detail",onClick:s,children:e.jsx(jt,{className:"size-4"})})]}),e.jsxs("p",{className:"text-muted-foreground",children:[i," · Segment ",t.segmentIndex+1,t.durationSharePct!=null?e.jsxs(e.Fragment,{children:[" · ",e.jsxs("span",{className:"text-foreground",children:[t.durationSharePct,"%"]})," of plan stage time"]}):null]}),t.splitRole?e.jsxs(de,{title:"Exchange",children:[e.jsx("p",{className:"text-muted-foreground",children:bn[t.splitRole]}),t.exchangeShuffleBytes!=null?e.jsxs("p",{className:"mt-1 text-muted-foreground",children:["Shuffle written"," ",e.jsx("span",{className:"font-medium tabular-nums text-foreground",children:ze(t.exchangeShuffleBytes)})]}):t.label.startsWith("Broadcast")?e.jsx("p",{className:"mt-1 text-muted-foreground",children:"Broadcast, no shuffle"}):null,t.pairedNodeId&&n?e.jsxs(Q,{type:"button",variant:"outline",size:"sm",className:"mt-2 h-7 w-full justify-start gap-1.5",onClick:()=>n(t.pairedNodeId),children:[e.jsx(Yt,{className:"size-3.5","aria-hidden":"true"}),"Jump to ",t.splitRole==="read"?"write":"read"," half"]}):null]}):null,r.length>0?e.jsx(de,{title:"Findings",children:e.jsx("ul",{className:"flex flex-col gap-1.5",children:r.map((l,c)=>e.jsxs("li",{className:"flex items-start gap-1.5",children:[e.jsx($e,{type:l.type,impactBand:l.impactBand,className:"shrink-0"}),e.jsx("span",{className:"break-words",children:He(l)})]},l.id??`${l.type}-${c}`))})}):null,o.length>0?e.jsx(de,{title:"Metrics",children:e.jsx("dl",{className:"grid grid-cols-[1fr_auto] gap-x-3 gap-y-1",children:o.map((l,c)=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"min-w-0 break-words text-muted-foreground",children:l.name}),e.jsx("dd",{className:"text-right font-medium tabular-nums",children:l.value})]},`${l.name}-${c}`))})}):null,t.detailText?e.jsx(de,{title:"Plan detail",children:e.jsx("pre",{"data-testid":"plan-node-detail-text",className:"max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-muted p-2 font-mono text-[11px] leading-snug",children:t.detailText})}):null]})}function de({title:t,children:s}){return e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 font-medium text-muted-foreground",children:t}),s]})}const yn=[{category:"scan",label:"Scan"},{category:"filter",label:"Filter"},{category:"join",label:"Join"},{category:"aggregate",label:"Aggregate"},{category:"sort",label:"Sort"},{category:"exchange",label:"Exchange"},{category:"transform",label:"Transform"}];function wn(){return e.jsxs("div",{"data-testid":"plan-graph-legend",role:"region","aria-label":"Plan graph legend",className:"flex max-w-md flex-col gap-2 rounded-md border border-border bg-card p-3 text-xs shadow-md",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 font-medium text-muted-foreground",children:"Operators"}),e.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:yn.map(({category:t,label:s})=>e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{"aria-hidden":"true",children:oe[t]}),s]},t))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 font-medium text-muted-foreground",children:"Duration share"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:Y("h-1.5 w-6 rounded-full",ce.info)})," low"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:Y("h-1.5 w-6 rounded-full",ce.warning)})," medium"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:Y("h-1.5 w-6 rounded-full",ce.critical)})," high"]})]})]}),e.jsxs("p",{className:"text-muted-foreground",children:[e.jsx("span",{className:"text-foreground",children:"Edge thickness"})," = shuffle bytes moved across an exchange."]}),e.jsxs("p",{className:"text-muted-foreground",children:["A ",e.jsx("span",{className:"text-foreground",children:"segment"})," box groups one Exchange-bounded stage of the plan; a"," ",e.jsx("span",{className:"text-foreground",children:"stage"})," box (full-plan view) wraps every segment of one Spark stage."]})]})}function Nn({...t}){return e.jsx(ot,{"data-slot":"popover",...t})}function vn({...t}){return e.jsx(rt,{"data-slot":"popover-trigger",...t})}function Sn({align:t="center",alignOffset:s=0,side:n="bottom",sideOffset:a=8,className:r,...o}){return e.jsx(it,{children:e.jsx(lt,{className:"isolate z-50 outline-none",align:t,alignOffset:s,side:n,sideOffset:a,children:e.jsx(dt,{"data-slot":"popover-content",className:Y("z-50 w-72 origin-(--transform-origin) rounded-lg bg-popover p-3 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none",r),...o})})})}function qe({ariaLabel:t,name:s,options:n,value:a,onChange:r,trailingContent:o}){return e.jsx(We,{children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5",role:"radiogroup","aria-label":t,children:[n.map(i=>e.jsxs(Se,{children:[e.jsxs(ke,{render:e.jsx("label",{className:"tap-target-comfortable flex min-h-8 items-center gap-1.5 px-1 text-sm"}),children:[e.jsx("input",{type:"radio",name:s,value:i.value,checked:a===i.value,onChange:()=>r(i.value)}),i.label]}),e.jsx(Ee,{children:i.description})]},i.value)),o]})})}const kn=[{value:"io",label:"I/O only",description:"Show only scan and exchange nodes, where the plan reads or shuffles/broadcasts data."},{value:"basic",label:"Basic",description:"Add join, aggregate, sort, and filter nodes to I/O; hide pass-through and boilerplate operators like Project or WholeStageCodegen."},{value:"advanced",label:"Advanced",description:"Show every operator, including the pass-through and boilerplate nodes the other two modes hide."}];function En({mode:t,onChange:s,hiddenCount:n}){return e.jsx(qe,{ariaLabel:"Node filter",name:"plan-graph-filter",options:kn,value:t,onChange:s,trailingContent:n>0?e.jsx(Fe,{label:`${n} nodes hidden`,impactBand:"info"}):null})}const In=[{value:"exclusive",label:"Node only",description:"Each node's share reflects time spent in that operator alone, excluding its descendants."},{value:"inclusive",label:"Node + descendants",description:"Each node's share adds in every descendant operator's time, so an ancestor's bar reflects its whole subtree."}];function Pn({mode:t,onChange:s}){return e.jsx(qe,{ariaLabel:"Duration heat bar scope",name:"plan-graph-duration-mode",options:In,value:t,onChange:s})}function Cn({filterMode:t,onFilterModeChange:s,hiddenCount:n,durationMode:a,onDurationModeChange:r,iconOnly:o=!1}){return e.jsxs(Nn,{children:[e.jsxs(vn,{"aria-label":o?"Settings":void 0,title:o?"Settings":void 0,className:Y(yt({variant:"ghost",size:o?"icon":"sm"}),"tap-target-comfortable",o?void 0:"gap-1.5"),children:[e.jsx(Qt,{"aria-hidden":"true"}),o?null:"Settings"]}),e.jsxs(Sn,{align:o?"start":"end",side:o?"right":"bottom","aria-label":"Plan graph settings",className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Node filter"}),e.jsx(En,{mode:t,onChange:s,hiddenCount:n})]}),e.jsx("div",{"aria-hidden":"true",className:"h-px bg-border"}),e.jsxs("div",{children:[e.jsx("h2",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Duration attribution"}),e.jsx(Pn,{mode:a,onChange:r})]})]})]})}const be=t=>t.data;function Mn({planNodes:t,problemNodes:s,filterMode:n,onFilterModeChange:a,hiddenCount:r,durationMode:o,onDurationModeChange:i,legendOpen:l,onToggleLegend:c,miniMapOpen:g,onToggleMiniMap:m}){const{zoomIn:j,zoomOut:k,fitView:N,setCenter:I}=Xe(),[M,_]=p.useState(null),[B,A]=p.useState(null),R=[...t].filter(x=>be(x).durationSharePct!=null).sort((x,O)=>(be(O).durationSharePct??0)-(be(x).durationSharePct??0)),F=x=>{x&&I(x.position.x,x.position.y,{zoom:1,duration:300})},T=(x,O,L)=>{if(x.length===0)return;const z=O?x.findIndex(f=>f.id===O):-1,u=x[(z+1)%x.length];F(u),L(u.id)};return e.jsxs("div",{className:"flex w-12 shrink-0 flex-col items-center gap-1 border-r border-border bg-card/60 py-2",children:[e.jsxs(je,{children:[e.jsx(K,{label:"Zoom in",onClick:()=>j({duration:200}),children:e.jsx(sn,{"aria-hidden":"true"})}),e.jsx(K,{label:"Zoom out",onClick:()=>k({duration:200}),children:e.jsx(on,{"aria-hidden":"true"})}),e.jsx(K,{label:"Fit to view",onClick:()=>N({duration:200}),children:e.jsx(Jt,{"aria-hidden":"true"})})]}),e.jsx(Re,{}),e.jsxs(je,{children:[e.jsx(K,{label:"Next worst duration",disabled:R.length===0,onClick:()=>T(R,M,_),children:e.jsx(tn,{"aria-hidden":"true"})}),s.length>0?e.jsx(K,{label:"Next problem",onClick:()=>T(s,B,A),children:e.jsx(qt,{"aria-hidden":"true"})}):null]}),e.jsx(Re,{}),e.jsxs(je,{children:[e.jsx(Cn,{iconOnly:!0,filterMode:n,onFilterModeChange:a,hiddenCount:r,durationMode:o,onDurationModeChange:i}),e.jsx(K,{label:l?"Hide legend":"Legend",pressed:l,onClick:c,children:e.jsx(wt,{"aria-hidden":"true"})}),e.jsx(K,{label:g?"Hide minimap":"Show minimap",pressed:g,onClick:m,children:e.jsx(Zt,{"aria-hidden":"true"})})]})]})}function je({children:t}){return e.jsx("div",{className:"flex flex-col items-center gap-1",children:t})}function Re(){return e.jsx("div",{"aria-hidden":"true",className:"my-0.5 h-px w-6 bg-border"})}function K({label:t,onClick:s,disabled:n,pressed:a,children:r}){return e.jsx(Q,{type:"button",variant:"ghost",size:"icon",className:Y("tap-target-comfortable",a&&"bg-primary/15 text-primary hover:bg-primary/20 hover:text-primary"),"aria-label":t,title:t,"aria-pressed":a,disabled:n,onClick:s,children:r})}function Tn(t){if(t.type!=="planNode")return"var(--muted)";const s=t.data.findings??[],n=Nt(s);return n?It[n]:"var(--plan-aggregate)"}function Ve({finding:t,className:s}){const n=vt(t);return e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx($e,{type:t.type,impactBand:t.impactBand,className:s}),n?e.jsx("span",{className:"font-mono text-[10px] leading-none whitespace-nowrap text-muted-foreground",children:n}):null]})}function Dn({data:t}){const{width:s,height:n,stageId:a,durationLabel:r,findings:o}=t;return e.jsx("div",{className:"overflow-hidden rounded-lg border border-dashed border-border/70 bg-muted/10 nopan nodrag",style:{width:s,height:n,pointerEvents:"all"},children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1 text-xs text-muted-foreground",children:[e.jsx("span",{title:a==null?"This plan segment couldn't be matched to a specific Spark stage":void 0,children:a!=null?`Stage ${a}`:"Stage —"}),e.jsx(Fe,{label:r??"—",impactBand:"info",title:"Approximate share of this stage's wall time"}),o.length>0?e.jsx("div",{className:"ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1",children:o.map((i,l)=>e.jsx(Ve,{finding:i,className:"h-4 gap-1 px-1.5 text-xs"},i.id??`${i.type}-${l}`))}):null]})})}function Gn({data:t}){const{width:s,height:n,stageId:a,findings:r,showOwnFindings:o=!0,onSelect:i}=t;return e.jsxs("div",{className:"relative rounded-xl border border-primary/25 bg-primary/5 nopan nodrag",style:{width:s,height:n,pointerEvents:"all"},children:[e.jsx("button",{type:"button","aria-label":`Focus stage ${a}`,onClick:i,style:{pointerEvents:"auto"},className:"absolute inset-0 size-full cursor-pointer rounded-xl transition-colors hover:border-primary/50 hover:bg-primary/10"}),o&&r.length>0?e.jsx("div",{className:"absolute left-2 right-2 top-1 flex flex-wrap gap-1",children:r.map((l,c)=>e.jsx(Ve,{finding:l,className:"h-4 gap-1 px-1.5 text-xs"},l.id??`${l.type}-${c}`))}):null,e.jsxs("span",{className:"absolute right-2 bottom-1 text-xs font-medium text-primary",children:["Stage ",a]})]})}const Be=1.5,_n=9,Ae=.55,Rn=1;function Ze(t,s){return!(t>0)||!(s>0)?0:Math.min(1,Math.log(t+1)/Math.log(s+1))}function Bn(t,s){const n=Ze(t,s);return Be+(_n-Be)*n}function An(t,s){const n=Ze(t,s);return Ae+(Rn-Ae)*n}function On({sourceX:t,sourceY:s,targetX:n,targetY:a,sourcePosition:r,targetPosition:o,markerEnd:i,data:l}){const[c,g,m]=Bt({sourceX:t,sourceY:s,targetX:n,targetY:a,sourcePosition:r,targetPosition:o}),{shuffleBytes:j=0,maxShuffleBytes:k=0}=l??{},N=Bn(j,k),I=An(j,k),M=j>0&&j<1e3?"<1 KB":ze(j);return e.jsxs(e.Fragment,{children:[e.jsx(At,{path:c,markerEnd:i,style:{stroke:"var(--text-muted)",strokeWidth:N,strokeOpacity:I}}),e.jsx(Ot,{children:e.jsxs(Se,{children:[e.jsx(ke,{"data-testid":"exchange-edge-label",className:"nodrag nopan pointer-events-auto absolute cursor-help rounded bg-card/90 px-1 py-0.5 font-mono text-[10px] leading-none text-muted-foreground ring-1 ring-border",style:{transform:`translate(-50%, -50%) translate(${g}px, ${m}px)`},children:M}),e.jsx(Ee,{className:"max-w-xs",children:e.jsxs("p",{children:[M," of shuffle written across this exchange. Edge thickness scales with the volume moved."]})})]})})]})}const zn={planNode:xn,segmentGroup:Dn,stageGroup:Gn},$n={exchange:On},Fn=1,Ln=2,Hn=3,Xn=t=>t.data,ue={padding:.06,maxZoom:1.75};function Yn({resizeTick:t,fitSignal:s,centerRequest:n}){const{fitView:a,setCenter:r,getNode:o}=Xe();return p.useEffect(()=>{if(!n||n.token===0||!n.nodeId)return;const i=o(n.nodeId);i?r(i.position.x,i.position.y,{zoom:1,duration:300}):a({nodes:[{id:n.nodeId}],duration:300,maxZoom:1})},[n,r,o,a]),p.useEffect(()=>{const i=()=>a({duration:200,...ue});return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[a]),p.useEffect(()=>{t!==0&&a({duration:200,...ue})},[t,a]),p.useEffect(()=>{s!==0&&a({duration:300,...ue})},[s,a]),null}function Wn(){const t=p.useRef(null),[s,n]=p.useState(0);return p.useEffect(()=>{const a=t.current;if(!a)return;let r=!0;const o=new ResizeObserver(()=>{if(r){r=!1;return}n(i=>i+1)});return o.observe(a),()=>o.disconnect()},[]),{ref:t,tick:s}}function ye(t,s){return t.filter(n=>n.stageId===s||n.stageIds?.includes(s))}function qn({model:t,showMiniMap:s,findings:n=[],stageId:a,segmentStageIds:r,visibleNodeIds:o,visibleEdges:i,onSelectStage:l,selectedNodeId:c=null,onSelectNode:g,onJumpToPaired:m,centerRequest:j,fitSignal:k=0,filterMode:N="basic",onFilterModeChange:I=()=>{},hiddenCount:M=0,durationMode:_="exclusive",onDurationModeChange:B=()=>{}}){const{flowNodes:A,flowEdges:R}=p.useMemo(()=>{const h=t.nodes.reduce((d,w)=>d+(w.exclusiveDurationShare??w.durationShare??0),0),v=d=>`segment-${d.segmentIndex}`,P=t.scope==="full",C=d=>{const w=r?.get(d.segmentIndex);return w!=null?`stage-${w}`:null},D=o?me(t.nodes.filter(d=>o.has(d.id)),i??t.edges,{groupOf:v}):me(t.nodes,t.edges,{groupOf:v}),V=new Set(D.map(v)),$=P?new Set(D.map(C).filter(d=>d!=null)):null,J=t.nodes.some(d=>!V.has(v(d)))||$!=null&&t.nodes.some(d=>{const w=C(d);return w!=null&&!$.has(w)})?me(t.nodes,t.edges,{groupOf:v}):D,S=D.map(d=>{const w=d.durationShare!=null&&h>0?Math.round(d.durationShare/h*100):null,W=d.splitRole==="read"?`${d.label}, paired: see write half`:[d.label,d.operatorDetail,d.primaryMetric,w!=null?`${w}% of the plan's total stage duration`:null].filter(Boolean).join(", ");return{id:d.id,type:"planNode",position:d.position,draggable:!1,zIndex:Hn,measured:{width:se,height:ae},ariaLabel:W,ariaRole:"button",data:{...d,durationSharePct:w}}}),te=xe(v,[D,J]).map(d=>{const w=Number(d.id.replace("segment-","")),W=t.nodes.filter(q=>v(q)===d.id),E=W.reduce((q,b)=>q+(b.exclusiveDurationShare??b.durationShare??0),0),X=W.some(q=>q.durationShare!=null),ne=r?.get(w)??null,ie=ne!=null?ye(n,ne):[];return{id:d.id,type:"segmentGroup",position:d.position,draggable:!1,selectable:!1,focusable:!1,zIndex:Ln,style:{width:d.width,height:d.height},measured:{width:d.width,height:d.height},data:{width:d.width,height:d.height,stageId:ne,durationLabel:X?St(E):null,findings:ie}}}),ge=new Set(te.map(d=>d.data.stageId).filter(d=>d!=null)),he=P?(()=>{const d={paddingX:cn,paddingY:Ye,headerHeight:un},w=xe(C,[D,J],d),W=`stage-${a}`;if(ye(n,a).length>0&&!w.some(E=>E.id===W)){const[E]=xe(()=>W,[D,J],d);E&&w.push(E)}return w.map(E=>{const X=Number(E.id.replace("stage-",""));return{id:E.id,type:"stageGroup",position:E.position,draggable:!1,selectable:!1,focusable:!1,zIndex:Fn,style:{width:E.width,height:E.height},measured:{width:E.width,height:E.height},data:{width:E.width,height:E.height,stageId:X,findings:ye(n,X),showOwnFindings:!ge.has(X),onSelect:()=>l?.(X)}}})})():[],re=i??t.edges,pe=re.reduce((d,w)=>Math.max(d,w.shuffleBytes??0),0),fe=re.map(d=>d.shuffleBytes?{id:d.id,source:d.source,target:d.target,type:"exchange",data:{shuffleBytes:d.shuffleBytes,maxShuffleBytes:pe}}:{id:d.id,source:d.source,target:d.target});return{flowNodes:[...he,...te,...S],flowEdges:fe}},[t,n,a,r,o,i,l]),{ref:F,tick:T}=Wn(),[x,O]=p.useState(!0),[L,z]=p.useState(!0),u=c?A.find(h=>h.id===c&&h.type==="planNode"):void 0,f=A.filter(h=>h.type==="planNode"),y=A.filter(h=>h.type==="stageGroup"&&(h.data.findings?.length??0)>0).sort(Ht(h=>h.data.findings??[])),ee=o!=null&&o.size===0&&t.nodes.length>0,H=h=>{if(h.key!=="Enter"&&h.key!==" ")return;const P=h.target.closest(".react-flow__node-planNode")?.getAttribute("data-id");P&&(h.preventDefault(),g?.(P))};return e.jsx(zt,{children:e.jsx(We,{children:e.jsxs("div",{ref:F,className:"flex min-h-0 flex-1",children:[e.jsx(Mn,{planNodes:f,problemNodes:y,filterMode:N,onFilterModeChange:I,hiddenCount:M,durationMode:_,onDurationModeChange:B,legendOpen:x,onToggleLegend:()=>O(h=>!h),miniMapOpen:s&&L,onToggleMiniMap:()=>z(h=>!h)}),e.jsx("div",{className:"relative min-w-0 flex-1",onKeyDown:H,children:e.jsxs($t,{nodes:A,edges:R,nodeTypes:zn,edgeTypes:$n,"aria-label":"Plan graph. Operators and the data flowing between them. Tab to move between operators, Enter to open an operator's details.",fitView:!0,fitViewOptions:ue,minZoom:.05,edgesFocusable:!1,onNodeClick:(h,v)=>{v.type==="planNode"&&g?.(v.id)},onPaneClick:()=>g?.(null),children:[e.jsx(Ft,{}),e.jsx(Yn,{resizeTick:T,fitSignal:k,centerRequest:j}),ee?e.jsx(Ge,{position:"top-center",children:e.jsxs("p",{role:"status",className:"rounded-md border border-border bg-card px-3 py-2 text-xs text-muted-foreground shadow-sm",children:["All ",t.nodes.length," operators are hidden by the node filter. Change it in Settings to show them."]})}):null,x?e.jsx(Ge,{position:"bottom-left",children:e.jsx(wn,{})}):null,s&&L?e.jsx(Lt,{nodeColor:Tn,pannable:!0,zoomable:!0,ariaLabel:"Plan overview. Drag to pan and scroll to zoom the graph."}):null]})}),u?e.jsx(jn,{node:Xn(u),onClose:()=>g?.(null),onJumpToPaired:m}):null]})})})}function Vn({open:t,nodeCount:s,onConfirm:n,onCancel:a}){return e.jsx(Pt,{open:t,onOpenChange:r=>{r||a()},children:e.jsxs(Ct,{children:[e.jsx(Mt,{children:e.jsx(Tt,{children:"Expand to full plan?"})}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This plan has ",s," nodes. Rendering the full graph may take several seconds."]}),e.jsxs(Dt,{children:[e.jsx(Q,{type:"button",variant:"outline",size:"sm",onClick:a,children:"Cancel"}),e.jsx(Q,{type:"button",size:"sm",onClick:n,children:"Expand anyway"})]})]})})}const Zn={io:["scan","exchange"],basic:["scan","exchange","join","aggregate","sort","filter"],advanced:null},we=300;function Un(t,s){const n=new Map;for(const l of t){const c=n.get(l.source);c?c.push(l.target):n.set(l.source,[l.target])}const a=new Map;function r(l){const c=a.get(l);if(c)return c;const g=new Set;a.set(l,g);for(const m of n.get(l)??[])if(s.has(m))g.add(m);else for(const j of r(m))g.add(j);return g}const o=new Map;for(const l of t)l.shuffleBytes&&o.set(`${l.source}->${l.target}`,l.shuffleBytes);const i=[];for(const l of s)for(const c of r(l)){const g={id:`${l}=>${c}`,source:l,target:c},m=o.get(`${l}->${c}`);m&&(g.shuffleBytes=m),i.push(g)}return i}function Jn(t,s){try{return ln(t,s)}catch{return null}}const ve=new Map;function Kn(t,s,n,a){return`${t??"none"}::${s}::${n}::${a}`}function Qn(){ve.clear()}let Oe=Le.getState().modelResetCount;Le.subscribe(t=>{t.modelResetCount!==Oe&&(Oe=t.modelResetCount,Qn())});function Ne(t,s,n){const a=Kn(n,s.stageId,s.scope,s.durationMode),r=ve.get(a);if(r)return r;const o=Jn(t,s);return o&&ve.set(a,o),o}function is({stageId:t,appModel:s,findings:n,activeFileId:a,onClose:r,initialScope:o}){const{resetToDropZone:i}=kt(),{recentEntries:l,onPickRecent:c,onRemoveRecent:g}=Gt(a),[m,j]=p.useState("basic"),[k,N]=p.useState("exclusive"),[I,M]=p.useState(o??"segment"),[_,B]=p.useState(!1),[A,R]=p.useState(o!=="full"),[F,T]=p.useState(!1),[x,O]=p.useState(t),[L,z]=p.useState(null),[u,f]=p.useState(0),[y,ee]=p.useState({nodeId:null,token:0}),[H,h]=p.useState(null),v=b=>ee(G=>({nodeId:b,token:G.token+1}));p.useEffect(()=>{z(null)},[x,I,m]);const P=_t(x,s),C=P?Ne(P,{scope:"segment",stageId:x,appModel:s,findings:n,durationMode:k},a):null,D=C!=null&&C.scope==="full"&&I==="segment"&&C.nodes.length>we,V=D&&!F;p.useEffect(()=>{V&&B(!0)},[V]);const $=P&&(I==="full"||_)?Ne(P,{scope:"full",stageId:x,appModel:s,findings:n,durationMode:k},a):null,Z=!A&&I==="full"&&$!=null&&$.nodes.length>we,J=_||Z;p.useEffect(()=>{const b=G=>{G.key!=="Escape"||J||(L?z(null):r())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[r,J,L]);const S=D||Z?null:I==="full"?$:C;p.useEffect(()=>{!H||I!=="full"||S?.nodes.some(b=>b.id===H)&&(z(H),v(H),h(null))},[H,I,S]);function te(){const b=P?Ne(P,{scope:"full",stageId:x,appModel:s,findings:n,durationMode:k},a):null;b&&b.nodes.length>we?B(!0):(M("full"),f(G=>G+1))}function ge(){M("segment"),f(b=>b+1)}function he(b){if(S?.nodes.some(G=>G.id===b)){z(b),v(b);return}h(b),te()}const re=p.useCallback(b=>{O(b),M("segment"),R(!0),T(!1),h(null),f(G=>G+1)},[]);function pe(){R(!0),M("full"),B(!1),f(b=>b+1)}function fe(){B(!1),h(null),Z&&(R(!0),M("segment"),C?.scope==="full"&&T(!0)),V&&T(!0)}function d(b){return r(),c(b)}const{visibleNodeIds:w,filteredEdges:W,hiddenNodes:E}=p.useMemo(()=>{const b=Zn[m],G=new Set;if(S)for(const le of S.nodes)(!b||b.includes(le.category))&&G.add(le.id);const Ue=S?Un(S.edges,G):[],Je=S?S.nodes.filter(le=>!G.has(le.id)):[];return{visibleNodeIds:G,filteredEdges:Ue,hiddenNodes:Je}},[S,m]),X=S?.scope==="full",ne=I==="full",ie=p.useId(),q=X&&!ne;return e.jsxs("div",{"data-testid":"dashboard",className:"flex h-screen flex-col",style:{paddingRight:"var(--docs-inset, 0px)"},children:[e.jsx(Rt,{onLoadNew:i,recentEntries:l,activeFileId:a,onPickRecent:d,onRemoveRecent:g,leadingContent:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"truncate font-heading text-sm font-semibold",children:["Plan graph: Stage ",x]}),S&&S.scope==="segment"?e.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Segment ",S.segmentIndex+1," of ",S.segmentCount]}):null,e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:e.jsx(Et,{anchor:"#bottleneck-duplicate-plan-subtree",children:"Plan Advisor docs"})})]}),sectionControls:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-end gap-0.5",children:[e.jsx(Q,{type:"button",variant:"outline",size:"sm",disabled:q,"aria-describedby":q?ie:void 0,onClick:X?ge:te,children:X?"Back to segment view":"Expand to full plan"}),q?e.jsx("p",{id:ie,className:"text-xs text-muted-foreground",children:"This stage's plan couldn't be scoped to a single segment"}):null]}),e.jsx(Q,{variant:"ghost",size:"sm",onClick:r,children:"Close"})]})}),e.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:Z?null:!P||!S?e.jsx("p",{role:"alert",className:"p-6 text-sm text-destructive",children:D?'This plan has more nodes than the graph view can safely render without expanding. Click "Expand to full plan" to confirm.':"Couldn't build the plan graph for this stage."}):e.jsx(qn,{model:S,visibleNodeIds:w,visibleEdges:W,showMiniMap:!0,findings:n,stageId:x,segmentStageIds:S.segmentStageIds,onSelectStage:re,selectedNodeId:L,onSelectNode:z,onJumpToPaired:he,centerRequest:y,fitSignal:u,filterMode:m,onFilterModeChange:j,hiddenCount:E.length,durationMode:k,onDurationModeChange:N})}),e.jsx(Vn,{open:J,nodeCount:$?.nodes.length??0,onConfirm:pe,onCancel:fe})]})}export{is as PlanGraphRoute,Qn as clearPlanGraphModelCache,Un as collapseHiddenEdges};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as t}from"./react-vendor-DA6opS-q.js";import{at as N,L as p,W as P,q as g,as as h,T,n as f,I as w,A as C}from"./index-CHjV2-jB.js";import{S as E}from"./StagePill-CYCMdlIx.js";import{W as O}from"./WidgetLeadSummary-DRNRVvn7.js";import{u as M}from"./finding-anchor-4TmpXd7j.js";import{I as b}from"./ImpactEstimate-C6GzFOY9.js";import{c as D}from"./impact-sort-Cq6KOLqh.js";import{u as $,S as F}from"./useSortMode-BOPpfLhJ.js";import{R as L}from"./RowPagination-DypWbnic.js";import{u as _}from"./usePagedRows-CFoZrPr4.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./toggle-group-lbIXRG0W.js";import"./useRecentFiles-BPGQ6XII.js";function q(a){return a.stageId!=null}function V(a){return String(a.extended??"").replace(/, wasting \d+s of executor time\./,".")}function k(a){const s=String(a.recommendation??""),n=s.indexOf(": ");return n===-1?s:s.slice(n+2)}function z({finding:a}){const s=M([a]);return t.jsxs("li",{ref:s.ref,tabIndex:s.tabIndex,"data-flashed":s.dataFlashed,className:`flex flex-col gap-1 transition-colors ${s.flashClassName}`,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(E,{stageId:a.stageId}),t.jsx(w,{impactBand:a.impactBand})]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wasted ",t.jsx("strong",{children:g(h(a))})," of executor time.",a.extended?t.jsxs(C,{children:[" ",V(a)]}):null]}),a.recommendation?t.jsx("p",{className:"text-xs text-muted-foreground",children:k(a)}):null,t.jsx(b,{finding:a})]})}function oe({appModel:a,catalog:s,defaultCollapsed:n=!0}){const[j,o]=c.useState(0),{sortMode:y,setSortMode:R,orderBy:v}=$(),[m,I]=c.useState(!n),i=N(),l=c.useRef(!1);c.useEffect(()=>{if(!l.current){l.current=!0;return}o(0)},[a]);const r=s.filter(q).filter(e=>e.type==="retryWaste"),u=[...r].sort((e,d)=>p[e.impactBand]-p[d.impactBand]||(typeof d.value=="number"?d.value:0)-(typeof e.value=="number"?e.value:0)),x=v(u,e=>[e],e=>e.stageId),S=i?x.findIndex(e=>e===i.finding):null,{totalPages:W,effectivePage:B,visible:A}=_(x,j,o,S);return r.length===0?null:t.jsxs(P,{title:"Retry Waste",impactBand:f(r),badges:t.jsxs(t.Fragment,{children:[t.jsx(T,{type:"retryWaste",impactBand:f(r)}),D(r,r.length,m)?t.jsx(F,{mode:y,onChange:e=>{R(e),o(0)}}):null]}),open:m,onOpenChange:I,summary:t.jsx(O,{value:g(h(u[0])),context:`${r.length} item${r.length===1?"":"s"} flagged`}),children:[t.jsx("ul",{className:"space-y-3",children:A.map(e=>t.jsx(z,{finding:e},e.id))}),t.jsx(L,{page:B,totalPages:W,onPrev:()=>o(e=>e-1),onNext:()=>o(e=>e+1)})]})}export{oe as RetryWaste};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./react-vendor-DA6opS-q.js";import{B as r}from"./index-CHjV2-jB.js";function m({page:e,totalPages:s,onPrev:i,onNext:n,renderJumpControl:a}){return s<=1?null:t.jsxs("div",{className:`flex flex-wrap items-center gap-2 text-xs ${a?"justify-between":"justify-end"}`,children:[a?.(),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(r,{type:"button",variant:"ghost",size:"sm",className:"tap-target-comfortable tap-target-comfortable--sm",onClick:i,disabled:e===0,children:"Previous"}),t.jsxs("span",{className:"text-muted-foreground",children:["Page ",e+1," of ",s]}),t.jsx(r,{type:"button",variant:"ghost",size:"sm",className:"tap-target-comfortable tap-target-comfortable--sm",onClick:n,disabled:e===s-1,children:"Next"})]})]})}export{m as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as g,j as e}from"./react-vendor-DA6opS-q.js";import{S as M,a as F,b as L,c as _,d as V}from"./select-D5fK-za0.js";import{at as $,as as T,L as R,W as P,j as d,n as D,av as E,T as J,E as H,aw as q}from"./index-CHjV2-jB.js";import{W as N}from"./WidgetLeadSummary-DRNRVvn7.js";import{a as z}from"./StagePill-CYCMdlIx.js";import{S as G}from"./StageHeader-uDBLHgdg.js";import{u as K,R as Q}from"./finding-anchor-4TmpXd7j.js";import{I as U}from"./ImpactEstimate-C6GzFOY9.js";import{c as X}from"./impact-sort-Cq6KOLqh.js";import{u as Y,S as Z}from"./useSortMode-BOPpfLhJ.js";import{R as ee}from"./RowPagination-DypWbnic.js";import{u as se}from"./usePagedRows-CFoZrPr4.js";import{P as te}from"./PlanExplorer-xYFme_Rx.js";import{r as ae}from"./useRecentFiles-BPGQ6XII.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./toggle-group-lbIXRG0W.js";function re({entry:r,appModel:o}){const c=H(),n=K([r.shuffle]),l=o.stages.get(r.stageId),a=l?q(l):null,i=c==="advanced"&&ae(r.stageId,o);return e.jsxs("div",{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-2 ${Q} transition-colors ${n.flashClassName}`,children:[e.jsx(G,{stageId:r.stageId,appModel:o}),e.jsxs("p",{className:"text-sm",children:["Shuffle read: ",e.jsx("strong",{children:d(T(r.shuffle))})," · ","Write: ",d(l?.shuffleWriteBytes??0)]}),e.jsx(U,{finding:r.shuffle}),a||i?e.jsxs("div",{className:"space-y-2 pt-1",children:[a?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Try ",e.jsxs("code",{children:["spark.sql.shuffle.partitions = ",a.recommended]}),": current"," ",a.current," tasks, target 128 MB per partition"]}):null,i?e.jsx(te,{stageId:r.stageId,appModel:o}):null]}):null]})}const Be=g.memo(function({appModel:o,catalog:c,defaultCollapsed:n=!0}){const[l,a]=g.useState(0),[i,h]=g.useState(!n),{sortMode:x,setSortMode:C,orderBy:O}=Y(),I=$(),{shuffleFindings:p,sorted:m,orderedEntries:f}=g.useMemo(()=>{const s=c.filter(t=>t.type==="shuffle"),v=[...s.filter(t=>t.stageId!=null).map(t=>({stageId:t.stageId,shuffle:t,impactBand:t.impactBand,peak:T(t)}))].sort((t,B)=>R[t.impactBand]-R[B.impactBand]||B.peak-t.peak),A=O(v,t=>[t.shuffle],t=>t.stageId);return{shuffleFindings:s,sorted:v,orderedEntries:A}},[c,x]),k=I?f.findIndex(s=>s.shuffle===I.finding):null,{totalPages:w,effectivePage:S,visible:W}=se(f,l,a,k);if(p.length===0){let s=0;for(const u of o.stages.values())s=Math.max(s,u.shuffleReadBytes??0);return e.jsx(P,{title:"Shuffle I/O",open:i,onOpenChange:h,summary:e.jsx(N,{value:d(s),context:"no issue detected: peak shuffle read"}),children:e.jsx("div",{className:"flex flex-col gap-1",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No shuffle read/write issues detected."})})})}const j=D(p),b=f.map(s=>({id:s.stageId})),y=X(p,m.length,i);return e.jsx(P,{title:"Shuffle I/O",impactBand:j,open:i,onOpenChange:h,summary:e.jsx(N,{value:d(m[0].peak),context:`Peak shuffle read · ${m.length} stage${m.length===1?"":"s"} flagged`}),badges:e.jsxs(e.Fragment,{children:[e.jsx(J,{type:"shuffle",impactBand:j??"info"}),y?e.jsx(Z,{mode:x,onChange:s=>{C(s),a(0)}}):null]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(z,{pills:b}),W.map(s=>e.jsx(re,{entry:s,appModel:o},s.stageId)),e.jsx(ee,{page:S,totalPages:w,onPrev:()=>a(s=>s-1),onNext:()=>a(s=>s+1),renderJumpControl:()=>e.jsxs(M,{value:String(S*E),onValueChange:s=>a(Math.floor(Number(s)/E)),children:[e.jsx(F,{size:"sm","aria-label":"Jump to stage",children:e.jsx(L,{placeholder:"Jump to stage"})}),e.jsx(_,{children:f.map((s,u)=>e.jsxs(V,{value:String(u),children:["Stage ",s.stageId," (",d(s.peak),")"]},s.stageId))})]})})]})})});export{Be as ShuffleIO};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as o}from"./react-vendor-DA6opS-q.js";import{ar as m,as as p}from"./index-CHjV2-jB.js";import{S as e}from"./StageFindingGroup-CoVdEZYs.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./WidgetLeadSummary-DRNRVvn7.js";import"./useRecentFiles-BPGQ6XII.js";import"./StageHeader-uDBLHgdg.js";import"./StagePill-CYCMdlIx.js";import"./DurationHistogram-CviQyPNM.js";import"./finding-anchor-4TmpXd7j.js";import"./ImpactEstimate-C6GzFOY9.js";import"./impact-sort-Cq6KOLqh.js";import"./useSortMode-BOPpfLhJ.js";import"./toggle-group-lbIXRG0W.js";import"./RowPagination-DypWbnic.js";import"./usePagedRows-CFoZrPr4.js";import"./PlanExplorer-xYFme_Rx.js";function a(r){return`${r.metric}: ${m("ratio",p(r))}`}const F=i.memo(function(t){return o.jsx(e,{...t,type:"skew",title:"Task Skew",idPrefix:"skew",findingLabel:a})});export{F as Skew};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,j as s}from"./react-vendor-DA6opS-q.js";import{L as p,at as B,W as M,T as H,I as N,as as P,ar as n}from"./index-CHjV2-jB.js";import{S as T}from"./StageHeader-uDBLHgdg.js";import{W as y}from"./WidgetLeadSummary-DRNRVvn7.js";import{u as k}from"./finding-anchor-4TmpXd7j.js";import{I as C}from"./ImpactEstimate-C6GzFOY9.js";import{c as D}from"./impact-sort-Cq6KOLqh.js";import{u as E,S as A}from"./useSortMode-BOPpfLhJ.js";import{R as O}from"./RowPagination-DypWbnic.js";import{u as b}from"./usePagedRows-CFoZrPr4.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./StagePill-CYCMdlIx.js";import"./toggle-group-lbIXRG0W.js";import"./useRecentFiles-BPGQ6XII.js";function x(t){const o=P(t);if(t.metric==="execMaxMedianRatio")return`Executor ${t.executorId}: ${n("ratio",o)} median on ${t.dimension??"this metric"}`;const a=Math.round((t.hostTaskShare??0)*100);return t.metric==="hostDurationShare"?`${t.host}: ${n("pctFraction",o)} of this stage's task time (${n("pct",a)} of tasks)`:`${t.host}: ${n("ratio",o)} median task time (${n("pct",a)} of tasks)`}function W(t){if(t.metric!=="hostDurationShare"&&t.metric!=="execMaxMedianRatio")return null;const o=t.recommendation??"",a=o.indexOf(": ");return a===-1?null:o.slice(a)}function F({finding:t,appModel:o}){const a=k([t]),i=W(t);return s.jsxs("li",{ref:a.ref,tabIndex:a.tabIndex,"data-flashed":a.dataFlashed,className:`space-y-1 text-sm transition-colors ${a.flashClassName}`,children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(N,{impactBand:t.impactBand}),t.stageId!=null?s.jsx(T,{stageId:t.stageId,appModel:o}):null]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x(t),i]}),s.jsx(C,{finding:t}),i==null?s.jsx("p",{className:"text-muted-foreground pt-1",children:t.recommendation}):null]})}const st=m.memo(function({appModel:o,catalog:a,defaultCollapsed:i=!0}){const{sortMode:g,setSortMode:h,orderBy:f}=E(),[l,S]=m.useState(!i),[j,c]=m.useState(0),r=a.filter(e=>e.type==="slowHost").slice().sort((e,v)=>p[e.impactBand]-p[v.impactBand]),d=f(r,e=>[e],e=>e.stageId??null),u=B(),I=u?d.findIndex(e=>e===u.finding):null,{totalPages:w,effectivePage:R,visible:$}=b(d,j,c,I);return r.length===0?null:s.jsxs(M,{title:"Slow Executor Host",impactBand:r[0].impactBand,badges:s.jsxs(s.Fragment,{children:[s.jsx(H,{type:"slowHost",impactBand:r[0].impactBand}),D(r,r.length,l)?s.jsx(A,{mode:g,onChange:h}):null]}),open:l,onOpenChange:S,summary:s.jsx(y,{value:x(r[0]),context:`${r.length} issue${r.length===1?"":"s"} flagged`}),children:[s.jsx("ul",{className:"space-y-2",children:$.map(e=>s.jsx(F,{finding:e,appModel:o},e.id))}),s.jsx(O,{page:R,totalPages:w,onPrev:()=>c(e=>e-1),onNext:()=>c(e=>e+1)})]})});export{st as SlowHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as e}from"./react-vendor-DA6opS-q.js";import{L as u,at as B,W as C,A as F,T,a8 as O,n as f}from"./index-CHjV2-jB.js";import{R as w}from"./useRecentFiles-BPGQ6XII.js";import{I as M}from"./ImpactEstimate-C6GzFOY9.js";import{u as N,R as E}from"./finding-anchor-4TmpXd7j.js";import{a as _}from"./StagePill-CYCMdlIx.js";import{W as $}from"./WidgetLeadSummary-DRNRVvn7.js";import{s as L,c as W}from"./impact-sort-Cq6KOLqh.js";import{u as b,S as q}from"./useSortMode-BOPpfLhJ.js";import{u as D}from"./usePagedRows-CFoZrPr4.js";import{R as G}from"./RowPagination-DypWbnic.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./toggle-group-lbIXRG0W.js";function K({finding:a}){const o=N([a]);return e.jsxs("li",{ref:o.ref,tabIndex:o.tabIndex,"data-flashed":o.dataFlashed,className:`space-y-2 ${E} transition-colors ${o.flashClassName}`,children:[a.stageIds&&a.stageIds.length>0?e.jsx(_,{pills:a.stageIds.map(l=>({id:l}))}):null,e.jsxs("p",{children:[a.recommendation," ",e.jsx(M,{finding:a})]})]})}const oe=r.memo(function({catalog:o,defaultCollapsed:l=!0}){const{sortMode:d,setSortMode:x,orderBy:h}=b(),[m,S]=r.useState(!l),[R,i]=r.useState(0),{findings:t,pills:c}=r.useMemo(()=>{const s=o.filter(n=>n.type==="smallFiles").sort((n,y)=>u[n.impactBand]-u[y.impactBand]),P=[...new Set(s.flatMap(n=>n.stageIds??[]))].map(n=>({id:n}));return{findings:s,pills:P}},[o,d]),p=h(t,s=>[s],L),g=B(),j=g?p.findIndex(s=>s===g.finding):null,{totalPages:I,effectivePage:A,visible:v}=D(p,R,i,j);return t.length===0?null:e.jsxs(C,{title:"Excessive Small Files",impactBand:f(t),open:m,onOpenChange:S,badges:e.jsxs(e.Fragment,{children:[e.jsx(T,{type:"smallFiles",impactBand:f(t)??"info",className:O}),W(t,t.length,m)?e.jsx(q,{mode:d,onChange:x}):null]}),statusBadge:e.jsx(F,{children:e.jsx(w,{confidence:t[0].confidence,validationRequired:t[0].validationRequired,evidenceKey:"sqlPlan"})}),summary:e.jsx($,{value:`${c.length} stage${c.length===1?"":"s"}`,context:`${t.length} finding${t.length===1?"":"s"} flagged`}),children:[e.jsx("ul",{className:"space-y-3 text-sm",children:v.map(s=>e.jsx(K,{finding:s},s.id))}),e.jsx(G,{page:A,totalPages:I,onPrev:()=>i(s=>s-1),onNext:()=>i(s=>s+1)})]})});export{oe as SmallFiles};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,j as t}from"./react-vendor-DA6opS-q.js";import{L as d,at as v,W as y,T as N,I as P,q as T,as as C}from"./index-CHjV2-jB.js";import{S as b}from"./StageHeader-uDBLHgdg.js";import{W as w}from"./WidgetLeadSummary-DRNRVvn7.js";import{u as M}from"./finding-anchor-4TmpXd7j.js";import{c as A}from"./impact-sort-Cq6KOLqh.js";import{I as D}from"./ImpactEstimate-C6GzFOY9.js";import{u as E,S as O}from"./useSortMode-BOPpfLhJ.js";import{R as L}from"./RowPagination-DypWbnic.js";import{u as $}from"./usePagedRows-CFoZrPr4.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./StagePill-CYCMdlIx.js";import"./toggle-group-lbIXRG0W.js";import"./useRecentFiles-BPGQ6XII.js";function p(a){return T(C(a))}function F({finding:a,appModel:r}){const o=M([a]);return t.jsxs("li",{ref:o.ref,tabIndex:o.tabIndex,"data-flashed":o.dataFlashed,className:`space-y-1 text-sm transition-colors ${o.flashClassName}`,children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(P,{impactBand:a.impactBand}),a.stageId!=null?t.jsx(b,{stageId:a.stageId,appModel:r}):null,t.jsx("strong",{children:p(a)})]}),t.jsx(D,{finding:a}),t.jsx("p",{className:"text-muted-foreground pt-1",children:a.recommendation})]})}const te=m.memo(function({appModel:r,catalog:o,defaultCollapsed:u=!0}){const{sortMode:g,setSortMode:x,orderBy:f}=E(),[i,h]=m.useState(!u),[j,n]=m.useState(0),s=o.filter(e=>e.type==="speculationWaste").slice().sort((e,W)=>d[e.impactBand]-d[W.impactBand]),c=f(s,e=>[e],e=>e.stageId??null),l=v(),I=l?c.findIndex(e=>e===l.finding):null,{totalPages:S,effectivePage:B,visible:R}=$(c,j,n,I);return s.length===0?null:t.jsxs(y,{title:"Speculation Waste",impactBand:s[0].impactBand,badges:t.jsxs(t.Fragment,{children:[t.jsx(N,{type:"speculationWaste",impactBand:s[0].impactBand}),A(s,s.length,i)?t.jsx(O,{mode:g,onChange:x}):null]}),open:i,onOpenChange:h,summary:t.jsx(w,{value:p(s[0]),context:`${s.length} issue${s.length===1?"":"s"} flagged`}),children:[t.jsx("ul",{className:"space-y-2",children:R.map(e=>t.jsx(F,{finding:e,appModel:r},e.id))}),t.jsx(L,{page:B,totalPages:S,onPrev:()=>n(e=>e-1),onNext:()=>n(e=>e+1)})]})});export{te as SpeculationWaste};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as h}from"./react-vendor-DA6opS-q.js";import{K as L,D as W,I as x,j as c,L as I,at as H,W as b,T as z,E as q,aw as Y,C as V,$ as X,a0 as J,A as U,as as Q}from"./index-CHjV2-jB.js";import{E as G}from"./EmptyState-v2ehFncc.js";import{S as Z}from"./StagePill-CYCMdlIx.js";import{W as ee}from"./WidgetLeadSummary-DRNRVvn7.js";import{G as se,H as te,J as P,K as T,j as w,C as p,r as ae,R as re}from"./useRecentFiles-BPGQ6XII.js";import{u as ie,R as ne}from"./finding-anchor-4TmpXd7j.js";import{I as oe}from"./ImpactEstimate-C6GzFOY9.js";import{c as le}from"./impact-sort-Cq6KOLqh.js";import{u as ce,S as de}from"./useSortMode-BOPpfLhJ.js";import{u as me}from"./usePagedRows-CFoZrPr4.js";import{R as pe}from"./RowPagination-DypWbnic.js";import{d as xe}from"./downsample-D8XmJk6i.js";import{j as ue,C as A,X as N,Y as y,T as R,S as ge,e as he,k as fe,a as je,d as ye}from"./charts-vendor-Cf1-wzeH.js";import{P as Se}from"./PlanExplorer-xYFme_Rx.js";import"./plan-graph-vendor-B96a-e4N.js";import"./toggle-group-lbIXRG0W.js";const k=240,Ce=500*1024*1024,ve=10;function M(t){const r=t.spillBytes>Ce,a=t.gcPct>ve;return r&&a?"critical":r||a?"warning":"info"}function Be(t){return p[M(t)]}function Ie({active:t,payload:r}){if(!t||!r?.length)return null;const a=r[0]?.payload;if(!a)return null;const l=M(a);return e.jsxs("div",{className:"rounded-md border border-border bg-popover px-2 py-1.5 text-xs text-popover-foreground shadow-md",children:[e.jsxs("p",{children:[c(a.spillBytes)," spilled"]}),e.jsxs("p",{children:[a.gcPct.toFixed(1),"% GC"]}),e.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-medium",children:[e.jsx(x,{impactBand:l}),l.toUpperCase()]})]})}function be({appModel:t}){const r=[];for(const s of t.stages.values()){const n=s.memoryBytesSpilled??0;n<=0||r.push({stageId:s.id,spillBytes:n,gcPct:s.gcPct??0,submittedAt:s.submittedAt??0})}if(r.length===0)return e.jsx(G,{tone:"clean",icon:L,title:"No stages spilled memory in this run."});const a=xe(r),l=[...a].sort((s,n)=>s.submittedAt-n.submittedAt).map(s=>({stage:`S${s.stageId}`,spillMB:s.spillBytes/(1024*1024),gcPct:s.gcPct}));return e.jsxs(se,{defaultValue:"scatter",children:[e.jsxs(te,{"aria-label":"Memory pressure view",children:[e.jsx(P,{value:"scatter",children:"Scatter"}),e.jsx(P,{value:"twin",children:"Twin bars"})]}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:["Spill and GC pressure both stem from tight executor memory, see"," ",e.jsx(W,{anchor:"#memory-model",children:"how Spark’s memory model works"}),"."]}),e.jsxs(T,{value:"scatter",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(x,{impactBand:"critical"}),"CRITICAL"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(x,{impactBand:"warning"}),"WARNING"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(x,{impactBand:"info"}),"INFO"]})]}),e.jsx(w,{ariaLabel:"Memory pressure scatter: spilled memory versus GC percent, one point per stage that spilled.",height:k,table:{caption:"Memory spilled and GC percent by stage",columns:["Stage","Memory spilled","GC %"],rows:a.map(s=>[`S${s.stageId}`,c(s.spillBytes),`${s.gcPct.toFixed(1)}%`]),align:["left","right","right"]},children:e.jsxs(ue,{children:[e.jsx(A,{stroke:p.muted,strokeOpacity:.2}),e.jsx(N,{type:"number",dataKey:"spillBytes",name:"Memory spilled",tickFormatter:s=>c(s),tick:{fontSize:10}}),e.jsx(y,{type:"number",dataKey:"gcPct",name:"GC %",tick:{fontSize:10},width:32}),e.jsx(R,{cursor:{strokeDasharray:"3 3"},content:Ie}),e.jsx(ge,{data:a,name:"Spill vs. GC",children:a.map(s=>e.jsx(he,{fill:Be(s)},s.stageId))})]})})]}),e.jsx(T,{value:"twin",children:e.jsx(w,{ariaLabel:"Memory pressure by stage: spilled memory and GC percent across stages in submission order.",height:k,table:{caption:"Spilled memory and GC percent by stage, submission order",columns:["Stage","Spill (MB)","GC %"],rows:l.map(s=>[s.stage,s.spillMB.toFixed(1),`${s.gcPct.toFixed(1)}%`]),align:["left","right","right"]},children:e.jsxs(fe,{data:l,children:[e.jsx(A,{stroke:p.muted,strokeOpacity:.2}),e.jsx(N,{dataKey:"stage",tick:{fontSize:10}}),e.jsx(y,{yAxisId:"left",tick:{fontSize:10},width:36}),e.jsx(y,{yAxisId:"right",orientation:"right",tick:{fontSize:10},width:36}),e.jsx(R,{}),e.jsx(je,{yAxisId:"left",dataKey:"spillMB",name:"Spill (MB)",fill:p.critical}),e.jsx(ye,{yAxisId:"right",dataKey:"gcPct",name:"GC %",stroke:p.info,dot:!1})]})})})]})}function Pe(t,r){return t.stages.get(r)?.spillClassification??"unclassified"}function Te({finding:t,appModel:r}){const a=ie([t]),l=q(),s=r.stages.get(t.stageId),n=Pe(r,t.stageId),m=n==="volume"&&s?Y(s):null,u=l==="advanced"&&ae(t.stageId,r);return e.jsxs("div",{ref:a.ref,tabIndex:a.tabIndex,"data-flashed":a.dataFlashed,className:`space-y-2 ${ne} transition-colors ${a.flashClassName}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(x,{impactBand:t.impactBand}),e.jsx(V,{label:J[n],impactBand:t.impactBand,title:X[n]}),e.jsx(Z,{stageId:t.stageId})]}),e.jsx(U,{children:e.jsx(re,{confidence:t.confidence,validationRequired:t.validationRequired})})]}),e.jsxs("p",{className:"text-sm",children:["Memory spilled: ",e.jsx("strong",{children:c(Q(t))})," · ","Disk: ",c(s?.diskBytesSpilled??0)]}),e.jsx(oe,{finding:t}),m?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Try: ",e.jsxs("code",{children:["spark.sql.shuffle.partitions = ",m.recommended]}),` (current ${m.current} tasks, target 128 MB per partition)`]}):null,t.recommendation?e.jsx("p",{className:"text-xs text-muted-foreground",children:t.recommendation}):null,u?e.jsx("div",{className:"pt-1",children:e.jsx(Se,{stageId:t.stageId,appModel:r})}):null]})}const ze=h.memo(function({appModel:r,catalog:a,defaultCollapsed:l=!0}){const{sortMode:s,setSortMode:n,orderBy:m}=ce(),[u,O]=h.useState(!l),[E,f]=h.useState(0),{findings:S,sorted:d,orderedFindings:C}=h.useMemo(()=>{const i=a.filter(o=>o.type==="spill"&&o.stageId!=null),g=[...i].sort((o,j)=>(I[o.impactBand]??9)-(I[j.impactBand]??9)||(typeof j.value=="number"?j.value:0)-(typeof o.value=="number"?o.value:0)),K=m(g,o=>[o],o=>o.stageId);return{findings:i,sorted:g,orderedFindings:K}},[a,s]),v=H(),_=v?C.findIndex(i=>i===v.finding):null,{totalPages:F,effectivePage:D,visible:$}=me(C,E,f,_);if(S.length===0){let i=0;for(const g of r.stages.values())i=Math.max(i,g.memoryBytesSpilled??0);return e.jsx(b,{title:`Spill: no issue detected (max ${c(i)} spilled)`,children:e.jsx(G,{tone:"clean",icon:L,title:"No stages spilled memory in this run."})})}const B=d[0].impactBand;return e.jsx(b,{title:"Spill",impactBand:B,badges:e.jsxs(e.Fragment,{children:[e.jsx(z,{type:"spill",impactBand:B}),le(S,d.length,u)?e.jsx(de,{mode:s,onChange:n}):null]}),open:u,onOpenChange:O,summary:e.jsx(ee,{value:c(typeof d[0].value=="number"?d[0].value:0),context:`peak · ${d.length} stage${d.length===1?"":"s"}`}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(be,{appModel:r}),$.map(i=>e.jsx(Te,{finding:i,appModel:r},i.stageId)),e.jsx(pe,{page:D,totalPages:F,onPrev:()=>f(i=>i-1),onNext:()=>f(i=>i+1)})]})})});export{ze as Spill};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as t}from"./react-vendor-DA6opS-q.js";import{at as P,L as g,W as F,T,n as u,I as y}from"./index-CHjV2-jB.js";import{S as C}from"./StagePill-CYCMdlIx.js";import{W as w}from"./WidgetLeadSummary-DRNRVvn7.js";import{u as E}from"./finding-anchor-4TmpXd7j.js";import{I as M}from"./ImpactEstimate-C6GzFOY9.js";import{c as A}from"./impact-sort-Cq6KOLqh.js";import{u as O,S as W}from"./useSortMode-BOPpfLhJ.js";import{R as b}from"./RowPagination-DypWbnic.js";import{u as D}from"./usePagedRows-CFoZrPr4.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./toggle-group-lbIXRG0W.js";import"./useRecentFiles-BPGQ6XII.js";function L(a){return a.stageId!=null}function _({finding:a}){const r=E([a]);return t.jsxs("li",{ref:r.ref,tabIndex:r.tabIndex,"data-flashed":r.dataFlashed,className:`flex flex-col gap-1 transition-colors ${r.flashClassName}`,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(C,{stageId:a.stageId}),t.jsx(y,{impactBand:a.impactBand})]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Stage attempt failed outright. Reason: ",t.jsx("strong",{children:String(a.value)})]}),t.jsx(M,{finding:a}),a.recommendation?t.jsx("p",{className:"text-xs text-muted-foreground",children:a.recommendation}):null]})}function ee({appModel:a,catalog:r,defaultCollapsed:p=!0}){const[x,o]=n.useState(0),{sortMode:f,setSortMode:h,orderBy:j}=O(),[d,I]=n.useState(!p),i=P(),l=n.useRef(!1);n.useEffect(()=>{if(!l.current){l.current=!0;return}o(0)},[a]);const s=r.filter(L).filter(e=>e.type==="stageFailed"),S=[...s].sort((e,c)=>g[e.impactBand]-g[c.impactBand]||e.stageId-c.stageId),m=j(S,e=>[e],e=>e.stageId),R=i?m.findIndex(e=>e===i.finding):null,{totalPages:B,effectivePage:v,visible:N}=D(m,x,o,R);return s.length===0?null:t.jsxs(F,{title:"Failed Stages",impactBand:u(s),badges:t.jsxs(t.Fragment,{children:[t.jsx(T,{type:"stageFailed",impactBand:u(s)}),A(s,s.length,d)?t.jsx(W,{mode:f,onChange:e=>{h(e),o(0)}}):null]}),open:d,onOpenChange:I,summary:t.jsx(w,{value:s.length,context:`stage${s.length===1?"":"s"} failed outright`}),children:[t.jsx("ul",{className:"space-y-3",children:N.map(e=>t.jsx(_,{finding:e},e.id))}),t.jsx(b,{page:v,totalPages:B,onPrev:()=>o(e=>e-1),onNext:()=>o(e=>e+1)})]})}export{ee as StageFailed};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as l}from"./react-vendor-DA6opS-q.js";import{G as M,v as W,n as y,L as C,at as L,W as O,T as F,E as _,I as D,A as q,q as P}from"./index-CHjV2-jB.js";import{W as z}from"./WidgetLeadSummary-DRNRVvn7.js";import{r as U,R as J}from"./useRecentFiles-BPGQ6XII.js";import{S as K}from"./StageHeader-uDBLHgdg.js";import{u as Q,D as V}from"./DurationHistogram-CviQyPNM.js";import{u as X,R as Y}from"./finding-anchor-4TmpXd7j.js";import{I as Z}from"./ImpactEstimate-C6GzFOY9.js";import{c as ee}from"./impact-sort-Cq6KOLqh.js";import{u as se,S as te}from"./useSortMode-BOPpfLhJ.js";import{R as ae}from"./RowPagination-DypWbnic.js";import{u as ne}from"./usePagedRows-CFoZrPr4.js";import{P as re}from"./PlanExplorer-xYFme_Rx.js";function oe({expanded:s,onClick:a,label:n,location:c,controlsId:m}){const d=c?` for ${c}`:"";return e.jsxs("button",{type:"button","aria-expanded":s,"aria-controls":m,"aria-label":`${s?"Hide":"Show"} ${n.toLowerCase()}${d}`,onClick:a,className:"tap-target-comfortable tap-target-comfortable--sm flex w-fit cursor-pointer items-center gap-1 text-xs font-medium text-primary underline underline-offset-2",children:[n,s?e.jsx(M,{"aria-hidden":"true",className:"size-3.5 shrink-0"}):e.jsx(W,{"aria-hidden":"true",className:"size-3.5 shrink-0"})]})}function ie(s){const[a,n]=l.useState(!1),[c,m]=l.useState(null),[d,x]=l.useState(!1),[p,u]=l.useState(!1),[j,f]=l.useState(!1);return{expanded:a,data:c,loading:d,error:p,toggle:()=>{const r=!a;n(r),r&&s&&!j&&!d&&(x(!0),s().then(k=>m(k)).catch(()=>u(!0)).finally(()=>{f(!0),x(!1)}))}}}function de({group:s,appModel:a,getTaskData:n,idPrefix:c,findingLabel:m}){const{exportMode:d,getTaskData:x}=Q(n),{expanded:p,data:u,error:j,toggle:f}=ie(x?()=>x(s.stageId):void 0),g=X(s.findings),r=a.stages.get(s.stageId),w=_()==="advanced"&&U(s.stageId,a),N=`${c}-stage-${s.stageId}-detail`;return e.jsxs("div",{ref:g.ref,tabIndex:g.tabIndex,"data-flashed":g.dataFlashed,className:`space-y-2 ${Y} transition-colors ${g.flashClassName}`,children:[e.jsx(K,{stageId:s.stageId,appModel:a}),e.jsx("ul",{className:"flex flex-col gap-1.5",children:s.findings.map((o,v)=>e.jsxs("li",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(D,{impactBand:o.impactBand}),e.jsx("span",{children:m(o)}),e.jsx(Z,{finding:o}),e.jsx(q,{children:e.jsx(J,{confidence:o.confidence,validationRequired:o.validationRequired})})]},v))}),r?.taskDurationP50!=null?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["P50 ",P(r.taskDurationP50)," · P95 ",P(r.taskDurationP95)," · Max"," ",P(r.taskDurationMax)]}):null,s.slowHost?e.jsxs("p",{className:"flex items-start gap-2 text-xs",children:[e.jsx(D,{impactBand:s.slowHost.impactBand,className:"mt-1"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Slow host:"})," ",s.slowHost.host," (",s.slowHost.value,"× median,"," ",Math.round((s.slowHost.hostTaskShare??0)*100),"% of tasks)"]})]}):null,s.straggler?e.jsxs("p",{className:"flex items-start gap-2 text-xs",children:[e.jsx(D,{impactBand:s.straggler.impactBand,className:"mt-1"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Stragglers:"})," ",(s.straggler.speculativeTasks??0)>0?`${s.straggler.speculativeTasks} speculative task${s.straggler.speculativeTasks===1?"":"s"}`:`${s.straggler.value}% of tasks > 4× P50`]})]}):null,e.jsx(oe,{expanded:p,onClick:f,label:"Task detail",location:`Stage ${s.stageId}`,controlsId:N}),p?e.jsxs("div",{id:N,className:"space-y-3 pt-1",children:[u?e.jsx(V,{metrics:u.metrics,fieldNames:u.fieldNames,markers:{p50:r?.taskDurationP50,p95:r?.taskDurationP95}}):d?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Task data isn’t included in exported reports."}):j?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Task data unavailable for this stage."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading task data…"}),w?e.jsx(re,{stageId:s.stageId,appModel:a}):null]}):null]})}const ke=l.memo(function({appModel:a,catalog:n,getTaskData:c,defaultCollapsed:m=!0,type:d,title:x,idPrefix:p,findingLabel:u}){const[j,f]=l.useState(0),{sortMode:g,setSortMode:r,orderBy:k}=se(),[w,N]=l.useState(!m),{relevant:o,stageGroups:v,orderedGroups:T}=l.useMemo(()=>{const i=n.filter(t=>t.type===d),h=new Map;for(const t of i)t.stageId!=null&&(h.has(t.stageId)||h.set(t.stageId,[]),h.get(t.stageId).push(t));const $=[...h.entries()].map(([t,I])=>({stageId:t,findings:I,impactBand:y(I)??"info",slowHost:n.find(S=>S.type==="slowHost"&&S.stageId===t),straggler:n.find(S=>S.type==="straggler"&&S.stageId===t)})).sort((t,I)=>C[t.impactBand]-C[I.impactBand]||t.stageId-I.stageId),A=k($,t=>t.findings,t=>t.stageId);return{relevant:i,stageGroups:$,orderedGroups:A}},[n,g,d]),R=L(),E=R?T.findIndex(i=>i.findings.some(h=>h===R.finding)):null,{totalPages:G,effectivePage:H,visible:b}=ne(T,j,f,E);if(o.length===0)return null;const B=y(o);return e.jsxs(O,{title:x,impactBand:B,badges:e.jsxs(e.Fragment,{children:[e.jsx(F,{type:d,impactBand:B??"info"}),ee(o,v.length,w)?e.jsx(te,{mode:g,onChange:r}):null]}),open:w,onOpenChange:N,summary:e.jsx(z,{value:`${v.length} stage${v.length===1?"":"s"}`,context:`${o.length} finding${o.length===1?"":"s"} flagged`}),children:[e.jsx("div",{className:"space-y-3",children:b.map(i=>e.jsx(de,{group:i,appModel:a,getTaskData:c,idPrefix:p,findingLabel:u},i.stageId))}),e.jsx(ae,{page:H,totalPages:G,onPrev:()=>f(i=>i-1),onNext:()=>f(i=>i+1)})]})});export{ke as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./react-vendor-DA6opS-q.js";import{S as r}from"./StagePill-CYCMdlIx.js";function i({stageId:e,appModel:t}){const a=t.stages.get(e);return s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(r,{stageId:e}),s.jsx("span",{className:"text-sm font-medium",children:a?.name??`Stage ${e}`})]})}export{i as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as c,r as x}from"./react-vendor-DA6opS-q.js";import{e as m,av as f,U as S}from"./index-CHjV2-jB.js";const p="inline-flex h-7 shrink-0 cursor-pointer items-center gap-1 rounded-full border border-border bg-background px-2.5 text-xs font-medium whitespace-nowrap outline-none transition-colors hover:bg-muted focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50";function j({stageId:n,className:r}){const{openStage:s}=S();return c.jsxs("button",{type:"button",className:m(p,r),title:`Open details for Stage ${n}`,"aria-label":`Open details for Stage ${n}`,onClick:()=>s(n),children:["S",c.jsx("b",{children:n})]})}const w=30;function M(n,{limit:r=f,chunk:s=w,dataset:t=n}={}){const[a,i]=x.useState({dataset:t,revealed:0}),l=!Object.is(a.dataset,t);l&&i({dataset:t,revealed:0});const o=l?0:a.revealed,d=r+o,g=n.slice(0,d),e=Math.max(0,n.length-d);return{visible:g,remaining:e,revealMore:()=>i(u=>({dataset:t,revealed:(Object.is(u.dataset,t)?u.revealed:0)+s})),revealThrough:u=>i(v=>{const b=Object.is(v.dataset,t)?v.revealed:0,h=Math.max(b,u-r+1);return h>b?{dataset:t,revealed:h}:v})}}function C({pills:n,visibleLimit:r=f,pillOverrideClassName:s}){const t=new Set,a=n.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0)),i=JSON.stringify(a.map(({id:e})=>e)),{visible:l,remaining:o,revealMore:d}=M(a,{limit:r,dataset:i}),g=a.slice(l.length);return c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.map(e=>c.jsx(j,{stageId:e.id,className:s},e.id)),o>0&&c.jsxs("button",{type:"button",className:m(p,"bg-muted",s),title:`Also flagged: Stage ${g.map(e=>e.id).join(", Stage ")}`,"aria-label":`Show ${o} more stage${o===1?"":"s"}`,onClick:d,children:["+",o]})]})}export{j as S,C as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as r}from"./react-vendor-DA6opS-q.js";import{S as i}from"./StageFindingGroup-CoVdEZYs.js";import"./index-CHjV2-jB.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./WidgetLeadSummary-DRNRVvn7.js";import"./useRecentFiles-BPGQ6XII.js";import"./StageHeader-uDBLHgdg.js";import"./StagePill-CYCMdlIx.js";import"./DurationHistogram-CviQyPNM.js";import"./finding-anchor-4TmpXd7j.js";import"./ImpactEstimate-C6GzFOY9.js";import"./impact-sort-Cq6KOLqh.js";import"./useSortMode-BOPpfLhJ.js";import"./toggle-group-lbIXRG0W.js";import"./RowPagination-DypWbnic.js";import"./usePagedRows-CFoZrPr4.js";import"./PlanExplorer-xYFme_Rx.js";const a={lowParallelism:"Low parallelism",dataExplosion:"Data explosion",taskStageSkew:"Task/stage skew"};function p(t){const e=typeof t.rule=="string"?t.rule:void 0;return`${(e&&a[e])??t.metric??"stage shape"}: ${t.value}`}const P=o.memo(function(e){return r.jsx(i,{...e,type:"stageShape",title:"Stage Shape",idPrefix:"stage-shape",findingLabel:p})});export{P as StageShape};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,j as t}from"./react-vendor-DA6opS-q.js";import{L as d,at as v,W as y,T as N,I as P}from"./index-CHjV2-jB.js";import{S as T}from"./StageHeader-uDBLHgdg.js";import{W as C}from"./WidgetLeadSummary-DRNRVvn7.js";import{u as b}from"./finding-anchor-4TmpXd7j.js";import{c as M}from"./impact-sort-Cq6KOLqh.js";import{I as A}from"./ImpactEstimate-C6GzFOY9.js";import{u as E,S as O}from"./useSortMode-BOPpfLhJ.js";import{R as W}from"./RowPagination-DypWbnic.js";import{u as $}from"./usePagedRows-CFoZrPr4.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./StagePill-CYCMdlIx.js";import"./toggle-group-lbIXRG0W.js";import"./useRecentFiles-BPGQ6XII.js";function p(s){return`${s.value}m stage duration`}function D({finding:s,appModel:r}){const o=b([s]);return t.jsxs("li",{ref:o.ref,tabIndex:o.tabIndex,"data-flashed":o.dataFlashed,className:`space-y-1 text-sm transition-colors ${o.flashClassName}`,children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(P,{impactBand:s.impactBand}),s.stageId!=null?t.jsx(T,{stageId:s.stageId,appModel:r}):null,t.jsx("strong",{children:p(s)})]}),t.jsx(A,{finding:s}),t.jsx("p",{className:"text-muted-foreground pt-1",children:s.recommendation})]})}const Z=m.memo(function({appModel:r,catalog:o,defaultCollapsed:u=!0}){const{sortMode:g,setSortMode:x,orderBy:f}=E(),[i,h]=m.useState(!u),[S,n]=m.useState(0),a=o.filter(e=>e.type==="stageSlowness").slice().sort((e,R)=>d[e.impactBand]-d[R.impactBand]),l=f(a,e=>[e],e=>e.stageId??null),c=v(),j=c?l.findIndex(e=>e===c.finding):null,{totalPages:I,effectivePage:B,visible:w}=$(l,S,n,j);return a.length===0?null:t.jsxs(y,{title:"Slow Stage",impactBand:a[0].impactBand,badges:t.jsxs(t.Fragment,{children:[t.jsx(N,{type:"stageSlowness",impactBand:a[0].impactBand}),M(a,a.length,i)?t.jsx(O,{mode:g,onChange:x}):null]}),open:i,onOpenChange:h,summary:t.jsx(C,{value:p(a[0]),context:`${a.length} issue${a.length===1?"":"s"} flagged`}),children:[t.jsx("ul",{className:"space-y-2",children:w.map(e=>t.jsx(D,{finding:e,appModel:r},e.id))}),t.jsx(W,{page:B,totalPages:I,onPrev:()=>n(e=>e-1),onNext:()=>n(e=>e+1)})]})});export{Z as StageSlowness};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as e}from"./react-vendor-DA6opS-q.js";import{L as g,at as w,W as C,T as N,I as $,A as x,as as A,ar as P}from"./index-CHjV2-jB.js";import{R as T}from"./useRecentFiles-BPGQ6XII.js";import{S as M}from"./StageHeader-uDBLHgdg.js";import{W as O}from"./WidgetLeadSummary-DRNRVvn7.js";import{u as b}from"./finding-anchor-4TmpXd7j.js";import{I as W}from"./ImpactEstimate-C6GzFOY9.js";import{c as D}from"./impact-sort-Cq6KOLqh.js";import{u as E,S as q}from"./useSortMode-BOPpfLhJ.js";import{R as F}from"./RowPagination-DypWbnic.js";import{u as L}from"./usePagedRows-CFoZrPr4.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./StagePill-CYCMdlIx.js";import"./toggle-group-lbIXRG0W.js";function d(t){const a=A(t);return t.unit==="count"?`${a} speculative attempt${a===1?"":"s"} discarded`:`${P("pct",a)} of tasks straggled`}function V(t){const a=d(t),r=t.recommendation??"",n=r.startsWith(a)?r.slice(a.length):` ${r}`,l=n.indexOf("; ");return l===-1?{primary:n,extended:null}:{primary:n.slice(0,l),extended:n.slice(l+2)}}function _({finding:t,appModel:a}){const r=b([t]),{primary:n,extended:l}=V(t);return e.jsxs("li",{ref:r.ref,tabIndex:r.tabIndex,"data-flashed":r.dataFlashed,className:`space-y-1 text-sm transition-colors ${r.flashClassName}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx($,{impactBand:t.impactBand}),t.stageId!=null?e.jsx(M,{stageId:t.stageId,appModel:a}):null]}),e.jsx(x,{children:e.jsx(T,{confidence:t.confidence,validationRequired:t.validationRequired})})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[d(t),n,l!=null?e.jsx(x,{children:`; ${l}`}):null]}),e.jsx(W,{finding:t})]})}const re=c.memo(function({appModel:a,catalog:r,defaultCollapsed:n=!0}){const{sortMode:l,setSortMode:f,orderBy:h}=E(),[m,j]=c.useState(!n),[S,i]=c.useState(0),o=r.filter(s=>s.type==="straggler").slice().sort((s,B)=>g[s.impactBand]-g[B.impactBand]),u=h(o,s=>[s],s=>s.stageId??null),p=w(),I=p?u.findIndex(s=>s===p.finding):null,{totalPages:R,effectivePage:v,visible:y}=L(u,S,i,I);return o.length===0?null:e.jsxs(C,{title:"Stragglers",impactBand:o[0].impactBand,badges:e.jsxs(e.Fragment,{children:[e.jsx(N,{type:"straggler",impactBand:o[0].impactBand}),D(o,o.length,m)?e.jsx(q,{mode:l,onChange:f}):null]}),open:m,onOpenChange:j,summary:e.jsx(O,{value:d(o[0]),context:`${o.length} issue${o.length===1?"":"s"} flagged`}),children:[e.jsx("ul",{className:"space-y-2",children:y.map(s=>e.jsx(_,{finding:s,appModel:a},s.id))}),e.jsx(F,{page:v,totalPages:R,onPrev:()=>i(s=>s-1),onNext:()=>i(s=>s+1)})]})});export{re as Straggler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as t}from"./react-vendor-DA6opS-q.js";import{at as N,L as p,W as P,ar as y,as as C,T as F,n as g,I as M}from"./index-CHjV2-jB.js";import{S as k}from"./StagePill-CYCMdlIx.js";import{W as w}from"./WidgetLeadSummary-DRNRVvn7.js";import{u as E}from"./finding-anchor-4TmpXd7j.js";import{I as A}from"./ImpactEstimate-C6GzFOY9.js";import{c as D}from"./impact-sort-Cq6KOLqh.js";import{u as O,S as W}from"./useSortMode-BOPpfLhJ.js";import{R as b}from"./RowPagination-DypWbnic.js";import{u as $}from"./usePagedRows-CFoZrPr4.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./toggle-group-lbIXRG0W.js";import"./useRecentFiles-BPGQ6XII.js";function L(a){return a.stageId!=null}function V({finding:a}){const r=E([a]);return t.jsxs("li",{ref:r.ref,tabIndex:r.tabIndex,"data-flashed":r.dataFlashed,className:`flex flex-col gap-1 transition-colors ${r.flashClassName}`,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(k,{stageId:a.stageId}),t.jsx(M,{impactBand:a.impactBand})]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Failure rate: ",t.jsxs("strong",{children:[a.value,"%"]})," (",String(a.failedTasks)," tasks) · Dominant reason: ",t.jsx("strong",{children:a.dominantReason??"—"})]}),t.jsx(A,{finding:a}),a.recommendation?t.jsx("p",{className:"text-xs text-muted-foreground",children:a.recommendation}):null]})}function ae({appModel:a,catalog:r,defaultCollapsed:x=!0}){const[f,o]=n.useState(0),{sortMode:h,setSortMode:j,orderBy:I}=O(),[i,R]=n.useState(!x),l=N(),m=n.useRef(!1);n.useEffect(()=>{if(!m.current){m.current=!0;return}o(0)},[a]);const s=r.filter(L).filter(e=>e.type==="failures"),c=[...s].sort((e,u)=>p[e.impactBand]-p[u.impactBand]||e.stageId-u.stageId),d=I(c,e=>[e],e=>e.stageId),S=l?d.findIndex(e=>e===l.finding):null,{totalPages:T,effectivePage:B,visible:v}=$(d,f,o,S);return s.length===0?null:t.jsxs(P,{title:"Failed Tasks",impactBand:g(s),badges:t.jsxs(t.Fragment,{children:[t.jsx(F,{type:"failures",impactBand:g(s)}),D(s,s.length,i)?t.jsx(W,{mode:h,onChange:e=>{j(e),o(0)}}):null]}),open:i,onOpenChange:R,summary:t.jsx(w,{value:y("pct",C(c[0])),context:`${s.length} item${s.length===1?"":"s"} flagged`}),children:[t.jsx("ul",{className:"space-y-3",children:v.map(e=>t.jsx(V,{finding:e},e.id))}),t.jsx(b,{page:B,totalPages:T,onPrev:()=>o(e=>e-1),onNext:()=>o(e=>e+1)})]})}export{ae as TaskFailures};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as o}from"./react-vendor-DA6opS-q.js";import{S as m}from"./StageFindingGroup-CoVdEZYs.js";import"./index-CHjV2-jB.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./WidgetLeadSummary-DRNRVvn7.js";import"./useRecentFiles-BPGQ6XII.js";import"./StageHeader-uDBLHgdg.js";import"./StagePill-CYCMdlIx.js";import"./DurationHistogram-CviQyPNM.js";import"./finding-anchor-4TmpXd7j.js";import"./ImpactEstimate-C6GzFOY9.js";import"./impact-sort-Cq6KOLqh.js";import"./useSortMode-BOPpfLhJ.js";import"./toggle-group-lbIXRG0W.js";import"./RowPagination-DypWbnic.js";import"./usePagedRows-CFoZrPr4.js";import"./PlanExplorer-xYFme_Rx.js";function p(t){return`P50 ${t.value}ms across many small tasks`}const b=r.memo(function(i){return o.jsx(m,{...i,type:"tinyTask",title:"Tiny Tasks",idPrefix:"tiny-task",findingLabel:p})});export{b as TinyTask};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as e}from"./react-vendor-DA6opS-q.js";import{L as g,at as y,W as C,A as T,T as M,a8 as O,n as u}from"./index-CHjV2-jB.js";import{R as w}from"./useRecentFiles-BPGQ6XII.js";import{I as N}from"./ImpactEstimate-C6GzFOY9.js";import{u as _,R as $}from"./finding-anchor-4TmpXd7j.js";import{a as E}from"./StagePill-CYCMdlIx.js";import{W as L}from"./WidgetLeadSummary-DRNRVvn7.js";import{s as W,c as b}from"./impact-sort-Cq6KOLqh.js";import{u as q,S as F}from"./useSortMode-BOPpfLhJ.js";import{u as U}from"./usePagedRows-CFoZrPr4.js";import{R as D}from"./RowPagination-DypWbnic.js";import"./charts-vendor-Cf1-wzeH.js";import"./plan-graph-vendor-B96a-e4N.js";import"./toggle-group-lbIXRG0W.js";function G({finding:a}){const o=_([a]);return e.jsxs("li",{ref:o.ref,tabIndex:o.tabIndex,"data-flashed":o.dataFlashed,className:`space-y-2 ${$} transition-colors ${o.flashClassName}`,children:[a.stageIds&&a.stageIds.length>0?e.jsx(E,{pills:a.stageIds.map(d=>({id:d}))}):null,e.jsxs("p",{children:[a.recommendation," ",e.jsx(N,{finding:a})]})]})}const oe=r.memo(function({catalog:o,defaultCollapsed:d=!0}){const{sortMode:f,setSortMode:x,orderBy:h}=q(),[l,R]=r.useState(!d),[j,i]=r.useState(0),{findings:t,pills:c}=r.useMemo(()=>{const s=o.filter(n=>n.type==="underBroadcast").sort((n,v)=>g[n.impactBand]-g[v.impactBand]),P=[...new Set(s.flatMap(n=>n.stageIds??[]))].map(n=>({id:n}));return{findings:s,pills:P}},[o]),m=h(t,s=>[s],W),p=y(),S=p?m.findIndex(s=>s===p.finding):null,{totalPages:B,effectivePage:I,visible:A}=U(m,j,i,S);return t.length===0?null:e.jsxs(C,{title:"Missed Broadcast Join",impactBand:u(t),open:l,onOpenChange:R,badges:e.jsxs(e.Fragment,{children:[e.jsx(M,{type:"underBroadcast",impactBand:u(t)??"info",className:O}),b(t,t.length,l)?e.jsx(F,{mode:f,onChange:x}):null]}),statusBadge:e.jsx(T,{children:e.jsx(w,{confidence:t[0].confidence,validationRequired:t[0].validationRequired,evidenceKey:"sqlPlan"})}),summary:e.jsx(L,{value:`${c.length} stage${c.length===1?"":"s"}`,context:`${t.length} finding${t.length===1?"":"s"} flagged`}),children:[e.jsx("ul",{className:"space-y-3 text-sm",children:A.map(s=>e.jsx(G,{finding:s},s.id))}),e.jsx(D,{page:I,totalPages:B,onPrev:()=>i(s=>s-1),onNext:()=>i(s=>s+1)})]})});export{oe as UnderBroadcast};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./react-vendor-DA6opS-q.js";function a({value:s,context:t}){return e.jsx("div",{className:"space-y-2",children:e.jsxs("p",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"line-clamp-2 min-h-[4rem] text-2xl font-semibold tracking-tight",title:typeof s=="string"?s:void 0,children:s}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t})]})})}export{a as W};
|