sparkforensics-server 0.5.0 → 0.5.1
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/package.json +3 -3
- package/public/assets/{AutoscalingChurn-9Zo6IMGS.js → AutoscalingChurn-5hDGIXi4.js} +1 -1
- package/public/assets/{CacheUtilization-MBDfMsKC.js → CacheUtilization-CT2SCnJJ.js} +1 -1
- package/public/assets/{CachingOpportunity-Cfw3wAFa.js → CachingOpportunity-D_O_WkbH.js} +1 -1
- package/public/assets/{ColdStart-BtS12b6_.js → ColdStart-B38OiAOp.js} +1 -1
- package/public/assets/{ConfigAudit-DNPV6EQg.js → ConfigAudit-BoplryCH.js} +1 -1
- package/public/assets/{CoreUsageArea-BObEeenE.js → CoreUsageArea-csgwNxkl.js} +1 -1
- package/public/assets/{Dashboard-CC_BXrNy.js → Dashboard-BgKodJl2.js} +2 -2
- package/public/assets/{DisclosureContext-Ds0hcZFn.js → DisclosureContext-B0siMVdg.js} +1 -1
- package/public/assets/{DuplicatePlanSubtree-vN3zqRsi.js → DuplicatePlanSubtree-BqS2A2j4.js} +1 -1
- package/public/assets/{ExecutorUtilization-CZObSLIj.js → ExecutorUtilization-Dp52QGWo.js} +1 -1
- package/public/assets/{GcPressure-ByJlLOua.js → GcPressure-CT1yzR_s.js} +1 -1
- package/public/assets/{IncompleteRun-MzqV4W8y.js → IncompleteRun-C7Qkjtjn.js} +1 -1
- package/public/assets/{JobFailures-LbMvAwAb.js → JobFailures-WHl3ELfh.js} +1 -1
- package/public/assets/{MemoryUtilization-DH4jYvJK.js → MemoryUtilization-D8IUDHJI.js} +1 -1
- package/public/assets/{OverBroadcast-euk6HKg4.js → OverBroadcast-6oSSAQ_R.js} +1 -1
- package/public/assets/{PartitionHint-DThaMMRT.js → PartitionHint-CUvbnnxy.js} +1 -1
- package/public/assets/{PartitionSizing-yIN-iZzx.js → PartitionSizing-BwdFL-mw.js} +1 -1
- package/public/assets/{PlanExplorer-Dd9WPK4S.js → PlanExplorer-DcxmiQWL.js} +1 -1
- package/public/assets/{PlanGraphRoute-NV5mCXRm.js → PlanGraphRoute-pqnHTt4i.js} +1 -1
- package/public/assets/{RetryWaste-CXH4D-xH.js → RetryWaste-BTbeHkJc.js} +1 -1
- package/public/assets/{ShuffleIO-CW7U68ph.js → ShuffleIO-CRhrYNE0.js} +1 -1
- package/public/assets/{Skew-PL79TppX.js → Skew-DSNXRG9V.js} +1 -1
- package/public/assets/{SlowHost-GBO73hCi.js → SlowHost-B7Lwu2EU.js} +1 -1
- package/public/assets/{SmallFiles-B5cUjEav.js → SmallFiles-C082c2rd.js} +1 -1
- package/public/assets/{SpeculationWaste-mxi3jgb0.js → SpeculationWaste-BS2vpadr.js} +1 -1
- package/public/assets/{Spill-CH1bNpxL.js → Spill-B4DVKHXx.js} +1 -1
- package/public/assets/{StageFailed-YvxC11ii.js → StageFailed-D3ac9Sou.js} +1 -1
- package/public/assets/{StageFindingGroup-B1A0nf-e.js → StageFindingGroup-D9naK109.js} +1 -1
- package/public/assets/{StageHeader-BMNmUy-s.js → StageHeader-pI1nTwVf.js} +1 -1
- package/public/assets/{StageShape-DO3mQ6NS.js → StageShape-eO5le8iG.js} +1 -1
- package/public/assets/{StageSlowness-SwRxfAEx.js → StageSlowness-BaNyfNvL.js} +1 -1
- package/public/assets/{Straggler-DHLTiBY-.js → Straggler-D5Fnok_y.js} +1 -1
- package/public/assets/{TaskFailures-Bj0QxiOc.js → TaskFailures-BWnC-K_G.js} +1 -1
- package/public/assets/{TinyTask-COUQQ5bQ.js → TinyTask-8_5lpq_2.js} +1 -1
- package/public/assets/{UnderBroadcast-RAUbQ6vw.js → UnderBroadcast-DJ0XSwth.js} +1 -1
- package/public/assets/{finding-anchor-Dl8mIHiU.js → finding-anchor-Cys8Z6Yn.js} +1 -1
- package/public/assets/{impact-sort-Eihua9dY.js → impact-sort-BTQndbof.js} +1 -1
- package/public/assets/index-DCeWge12.js +13 -0
- package/public/assets/parser-worker-DmeCnLWU.js +122 -0
- package/public/assets/{plan-graph-vendor-B0sEms9Z.js → plan-graph-vendor-BYl-AzN5.js} +1 -1
- package/public/assets/{react-vendor-BAKt3vny.js → react-vendor-DEdfrRTJ.js} +1 -1
- package/public/assets/{select-DkjFHlXR.js → select-DIYN6D3y.js} +1 -1
- package/public/assets/{usePagedRows-Bo-aSztx.js → usePagedRows-BxvdFnPk.js} +1 -1
- package/public/assets/{useRecentFiles-Bb4-ukVz.js → useRecentFiles-C3Ov47U7.js} +4 -4
- package/public/assets/{useSortMode-lDedD5a3.js → useSortMode-B8SRfAoG.js} +1 -1
- package/public/docs/404.html +2 -2
- package/public/docs/assets/{app.yjczoibf.js → app.D2GqAkhy.js} +1 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.D4OdkQjy.js +1 -0
- package/public/docs/assets/chunks/{VPLocalSearchBox.DOBbPfix.js → VPLocalSearchBox.BS4cSmtW.js} +1 -1
- package/public/docs/assets/chunks/{theme.DFcAl8Ws.js → theme.BuxVpb0H.js} +2 -2
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.YQcj5EI4.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_board-widgets.md.D0Kkk_r5.lean.js → contributor-guide_architecture_board-widgets.md.YQcj5EI4.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_board-widgets_caching-and-memory.md.8bH1HnZp.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets_caching-and-memory.md.8bH1HnZp.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets_plan-advisor.md.RlzvUmNm.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets_plan-advisor.md.RlzvUmNm.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets_visual-system-and-templating.md.DYgUpIJB.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets_visual-system-and-templating.md.DYgUpIJB.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.wj6Et6UD.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.wj6Et6UD.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract_plan-attribution.md.yNex4bys.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract_plan-attribution.md.yNex4bys.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract_threshold-tables.md.fkPBXsU2.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract_threshold-tables.md.fkPBXsU2.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_drill-down.md.CqZPrdo9.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_drill-down.md.CqZPrdo9.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_drill-down_plan-graph.md.DwOozIEs.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_drill-down_plan-graph.md.DwOozIEs.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.CZv_ZGOp.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.CZv_ZGOp.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation_caveats-tuning-and-coverage.md.BUucRc0A.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation_caveats-tuning-and-coverage.md.BUucRc0A.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation_stage-union-rollup.md.DdCGtAGu.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation_stage-union-rollup.md.DdCGtAGu.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_index.md.tymxf1Fh.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_index.md.B9yZieYL.lean.js → contributor-guide_architecture_index.md.tymxf1Fh.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.C1sSvm9i.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.DyCBdjuM.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_state-and-history.md.w4lwybdh.lean.js → contributor-guide_architecture_state-and-history.md.DyCBdjuM.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history_history-server-intake.md.C298hrHZ.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history_history-server-intake.md.C298hrHZ.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history_run-comparison-internals.md.uuAKpY0Y.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history_run-comparison-internals.md.uuAKpY0Y.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.BOZ1azXG.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.BOZ1azXG.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_findings-tab.md.BQXycK6G.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_findings-tab.md.BQXycK6G.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_investigation-routing.md.BGdiyElu.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_investigation-routing.md.BGdiyElu.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_list-sort-mode.md.BuHKgH0C.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_list-sort-mode.md.BuHKgH0C.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_reference-section.md.DWqC80bN.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_reference-section.md.DWqC80bN.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_row-expand-contract.md.ZT89u9f1.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering_row-expand-contract.md.ZT89u9f1.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.BAnhi2-d.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.BAnhi2-d.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol_cli-and-mcp.md.Dk08VS7n.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol_cli-and-mcp.md.Dk08VS7n.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol_core-and-event-validation.md.DSVFPpWb.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol_core-and-event-validation.md.DSVFPpWb.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol_evidence-availability.md.CjimIDBY.js +6 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol_evidence-availability.md.CjimIDBY.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol_evidence-report.md.DVGZOWvW.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol_evidence-report.md.DVGZOWvW.lean.js +1 -0
- package/public/docs/assets/user-guide_alternative-log-retrieval.md.CJpYvHGo.js +4 -0
- package/public/docs/assets/user-guide_alternative-log-retrieval.md.CJpYvHGo.lean.js +1 -0
- package/public/docs/assets/user-guide_alternative-log-retrieval_managed-platforms.md.DvDwHNtC.js +4 -0
- package/public/docs/assets/user-guide_alternative-log-retrieval_managed-platforms.md.DvDwHNtC.lean.js +1 -0
- package/public/docs/assets/user-guide_alternative-log-retrieval_ssh-bastion.md.Gszzlplv.js +1 -0
- package/public/docs/assets/user-guide_alternative-log-retrieval_ssh-bastion.md.Gszzlplv.lean.js +1 -0
- package/public/docs/assets/user-guide_getting-started.md.DYHHHkQR.js +1 -0
- package/public/docs/assets/user-guide_getting-started.md.DYHHHkQR.lean.js +1 -0
- package/public/docs/assets/user-guide_getting-started_ci-and-automation.md.DpnfKz3x.js +22 -0
- package/public/docs/assets/user-guide_getting-started_ci-and-automation.md.DpnfKz3x.lean.js +1 -0
- package/public/docs/assets/user-guide_getting-started_reading-the-dashboard.md.Obf3W3__.js +1 -0
- package/public/docs/assets/user-guide_getting-started_reading-the-dashboard.md.Obf3W3__.lean.js +1 -0
- package/public/docs/assets/user-guide_getting-started_regression-metric-keys.md.B_gzr2Mw.js +1 -0
- package/public/docs/assets/user-guide_getting-started_regression-metric-keys.md.B_gzr2Mw.lean.js +1 -0
- package/public/docs/assets/user-guide_getting-started_tuning-thresholds.md.B_MyjyZm.js +4 -0
- package/public/docs/assets/user-guide_getting-started_tuning-thresholds.md.B_MyjyZm.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools.md.C65SjWUL.js +16 -0
- package/public/docs/assets/user-guide_mcp-tools.md.C65SjWUL.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools_compare-runs.md.CPowlb2q.js +55 -0
- package/public/docs/assets/user-guide_mcp-tools_compare-runs.md.CPowlb2q.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools_diagnose-run.md.BP1vnHA5.js +23 -0
- package/public/docs/assets/user-guide_mcp-tools_diagnose-run.md.BP1vnHA5.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools_evaluate-budgets.md.Dq5Azk8G.js +26 -0
- package/public/docs/assets/user-guide_mcp-tools_evaluate-budgets.md.Dq5Azk8G.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools_get-finding-documentation.md.BtTTHNV6.js +14 -0
- package/public/docs/assets/user-guide_mcp-tools_get-finding-documentation.md.BtTTHNV6.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools_get-finding-evidence.md.rKyu4wts.js +20 -0
- package/public/docs/assets/user-guide_mcp-tools_get-finding-evidence.md.rKyu4wts.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools_get-reference-doc.md.Yac4tH3u.js +5 -0
- package/public/docs/assets/user-guide_mcp-tools_get-reference-doc.md.Yac4tH3u.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools_get-run-summary.md.DpxZ4ZNp.js +15 -0
- package/public/docs/assets/user-guide_mcp-tools_get-run-summary.md.DpxZ4ZNp.lean.js +1 -0
- package/public/docs/assets/user-guide_mcp-tools_list-runs.md.DpQPeCM3.js +12 -0
- package/public/docs/assets/user-guide_mcp-tools_list-runs.md.DpQPeCM3.lean.js +1 -0
- package/public/docs/assets/{user-guide_run-comparison.md.qin0a4IX.js → user-guide_run-comparison.md.B6aNtDYF.js} +1 -1
- package/public/docs/assets/user-guide_run-comparison.md.B6aNtDYF.lean.js +1 -0
- package/public/docs/assets/user-guide_run-comparison_how-stages-are-matched.md.XBzQ1oEU.js +1 -0
- package/public/docs/assets/user-guide_run-comparison_how-stages-are-matched.md.XBzQ1oEU.lean.js +1 -0
- package/public/docs/assets/user-guide_understanding-findings.md.Dqt2H_C1.js +1 -0
- package/public/docs/contributor-guide/architecture/board-widgets/caching-and-memory.html +30 -0
- package/public/docs/contributor-guide/architecture/board-widgets/plan-advisor.html +30 -0
- package/public/docs/contributor-guide/architecture/board-widgets/visual-system-and-templating.html +30 -0
- package/public/docs/contributor-guide/architecture/board-widgets.html +5 -5
- package/public/docs/contributor-guide/architecture/detector-contract/plan-attribution.html +30 -0
- package/public/docs/contributor-guide/architecture/detector-contract/threshold-tables.html +30 -0
- package/public/docs/contributor-guide/architecture/detector-contract.html +5 -5
- package/public/docs/contributor-guide/architecture/drill-down/plan-graph.html +30 -0
- package/public/docs/contributor-guide/architecture/drill-down.html +5 -5
- package/public/docs/contributor-guide/architecture/impact-estimation/caveats-tuning-and-coverage.html +30 -0
- package/public/docs/contributor-guide/architecture/impact-estimation/stage-union-rollup.html +30 -0
- package/public/docs/contributor-guide/architecture/impact-estimation.html +5 -5
- package/public/docs/contributor-guide/architecture/index.html +5 -5
- package/public/docs/contributor-guide/architecture/overview.html +5 -5
- package/public/docs/contributor-guide/architecture/state-and-history/history-server-intake.html +30 -0
- package/public/docs/contributor-guide/architecture/state-and-history/run-comparison-internals.html +30 -0
- package/public/docs/contributor-guide/architecture/state-and-history.html +5 -5
- package/public/docs/contributor-guide/architecture/widget-rendering/findings-tab.html +30 -0
- package/public/docs/contributor-guide/architecture/widget-rendering/investigation-routing.html +30 -0
- package/public/docs/contributor-guide/architecture/widget-rendering/list-sort-mode.html +30 -0
- package/public/docs/contributor-guide/architecture/widget-rendering/reference-section.html +30 -0
- package/public/docs/contributor-guide/architecture/widget-rendering/row-expand-contract.html +30 -0
- package/public/docs/contributor-guide/architecture/widget-rendering.html +5 -5
- package/public/docs/contributor-guide/architecture/worker-protocol/cli-and-mcp.html +30 -0
- package/public/docs/contributor-guide/architecture/worker-protocol/core-and-event-validation.html +30 -0
- package/public/docs/contributor-guide/architecture/worker-protocol/evidence-availability.html +35 -0
- package/public/docs/contributor-guide/architecture/worker-protocol/evidence-report.html +30 -0
- package/public/docs/contributor-guide/architecture/worker-protocol.html +5 -10
- 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 +3 -3
- package/public/docs/tuning-reference/anti-patterns.html +3 -3
- package/public/docs/tuning-reference/aqe.html +3 -3
- package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +3 -3
- package/public/docs/tuning-reference/bottleneck-cold-start.html +3 -3
- package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +3 -3
- package/public/docs/tuning-reference/bottleneck-failures.html +3 -3
- package/public/docs/tuning-reference/bottleneck-gc.html +3 -3
- package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +3 -3
- package/public/docs/tuning-reference/bottleneck-memory-utilization.html +3 -3
- package/public/docs/tuning-reference/bottleneck-retry-waste.html +3 -3
- package/public/docs/tuning-reference/bottleneck-shuffle.html +3 -3
- package/public/docs/tuning-reference/bottleneck-skew.html +3 -3
- package/public/docs/tuning-reference/bottleneck-slow-host.html +3 -3
- package/public/docs/tuning-reference/bottleneck-small-files.html +3 -3
- package/public/docs/tuning-reference/bottleneck-spill.html +3 -3
- package/public/docs/tuning-reference/bottleneck-straggler.html +3 -3
- package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +3 -3
- package/public/docs/tuning-reference/bottleneck-utilization.html +3 -3
- package/public/docs/tuning-reference/caching.html +3 -3
- package/public/docs/tuning-reference/cluster-config.html +3 -3
- package/public/docs/tuning-reference/config.html +3 -3
- package/public/docs/tuning-reference/data-formats.html +3 -3
- package/public/docs/tuning-reference/index.html +3 -3
- package/public/docs/tuning-reference/intro.html +3 -3
- package/public/docs/tuning-reference/joins.html +3 -3
- package/public/docs/tuning-reference/memory-model.html +3 -3
- package/public/docs/tuning-reference/metrics.html +3 -3
- package/public/docs/tuning-reference/partitioning.html +3 -3
- package/public/docs/tuning-reference/pyspark.html +3 -3
- package/public/docs/tuning-reference/shuffle.html +3 -3
- package/public/docs/tuning-reference/spark-architecture.html +3 -3
- package/public/docs/tuning-reference/table-formats.html +3 -3
- package/public/docs/user-guide/alternative-log-retrieval/managed-platforms.html +33 -0
- package/public/docs/user-guide/alternative-log-retrieval/ssh-bastion.html +30 -0
- package/public/docs/user-guide/alternative-log-retrieval.html +6 -9
- package/public/docs/user-guide/getting-started/ci-and-automation.html +51 -0
- package/public/docs/user-guide/getting-started/reading-the-dashboard.html +30 -0
- package/public/docs/user-guide/getting-started/regression-metric-keys.html +30 -0
- package/public/docs/user-guide/getting-started/tuning-thresholds.html +33 -0
- package/public/docs/user-guide/getting-started.html +5 -28
- package/public/docs/user-guide/mcp-tools/compare-runs.html +84 -0
- package/public/docs/user-guide/mcp-tools/diagnose-run.html +52 -0
- package/public/docs/user-guide/mcp-tools/evaluate-budgets.html +55 -0
- package/public/docs/user-guide/mcp-tools/get-finding-documentation.html +43 -0
- package/public/docs/user-guide/mcp-tools/get-finding-evidence.html +49 -0
- package/public/docs/user-guide/mcp-tools/get-reference-doc.html +34 -0
- package/public/docs/user-guide/mcp-tools/get-run-summary.html +44 -0
- package/public/docs/user-guide/mcp-tools/list-runs.html +41 -0
- package/public/docs/user-guide/mcp-tools.html +8 -140
- package/public/docs/user-guide/run-comparison/how-stages-are-matched.html +30 -0
- package/public/docs/user-guide/run-comparison.html +5 -5
- package/public/docs/user-guide/understanding-findings.html +5 -5
- package/public/export-template.html +44 -44
- package/public/index.html +4 -4
- package/vendor-core/analyzer.js +1 -1
- package/vendor-core/api-merge-writes.js +80 -0
- package/vendor-core/comparison-output.js +49 -0
- package/vendor-core/core-source-hash.txt +1 -1
- package/vendor-core/delta-commands.js +13 -0
- package/vendor-core/delta-log-paths.js +42 -0
- package/vendor-core/delta-targets.js +127 -0
- package/vendor-core/event-handlers.js +95 -9
- package/vendor-core/event-schemas.js +3 -1
- package/vendor-core/evidence-report.js +13 -4
- package/vendor-core/mcp-server-factory.js +13 -6
- package/vendor-core/mcp-tools.js +44 -35
- package/vendor-core/plan-graph-model.js +1 -1
- package/vendor-core/plan-summary.js +13 -10
- package/vendor-core/run-comparison.js +79 -120
- package/vendor-core/run-output.js +26 -0
- package/vendor-core/stage-alignment.js +262 -0
- package/vendor-core/stage-identity.js +112 -0
- package/vendor-core/types.js +5 -0
- package/vendor-core/write-target-args.js +48 -0
- package/vendor-core/write-targets.js +35 -52
- package/public/assets/index-DaC8A2FS.js +0 -13
- package/public/assets/parser-worker-CfDvPkwF.js +0 -122
- package/public/docs/assets/chunks/@localSearchIndexroot.r9imX8Aq.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.D0Kkk_r5.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.caA46z-u.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.caA46z-u.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_drill-down.md.CdtlKHl-.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_drill-down.md.CdtlKHl-.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.BNp14LtL.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.BNp14LtL.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_index.md.B9yZieYL.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.DBGo-bwn.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.w4lwybdh.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.CcvqxnZI.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.CcvqxnZI.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.CKeFttKj.js +0 -6
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.CKeFttKj.lean.js +0 -1
- package/public/docs/assets/user-guide_alternative-log-retrieval.md.z-8npxNk.js +0 -7
- package/public/docs/assets/user-guide_alternative-log-retrieval.md.z-8npxNk.lean.js +0 -1
- package/public/docs/assets/user-guide_getting-started.md.BJW5oVhe.js +0 -24
- package/public/docs/assets/user-guide_getting-started.md.BJW5oVhe.lean.js +0 -1
- package/public/docs/assets/user-guide_mcp-tools.md.DcLiOa9t.js +0 -148
- package/public/docs/assets/user-guide_mcp-tools.md.DcLiOa9t.lean.js +0 -1
- package/public/docs/assets/user-guide_run-comparison.md.qin0a4IX.lean.js +0 -1
- package/public/docs/assets/user-guide_understanding-findings.md.DzReyCXb.js +0 -1
- /package/public/docs/assets/{contributor-guide_architecture_overview.md.DBGo-bwn.lean.js → contributor-guide_architecture_overview.md.C1sSvm9i.lean.js} +0 -0
- /package/public/docs/assets/{user-guide_understanding-findings.md.DzReyCXb.lean.js → user-guide_understanding-findings.md.Dqt2H_C1.lean.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{C as n,S as r,T as i,_ as a,b as o,g as s,h as c,m as l,v as u,w as d,x as f,y as p}from"./react-vendor-BAKt3vny.js";import{Q as m,S as h,Tt as g,Y as _,Z as v,_t as y,d as b,l as x,lt as S,o as C,s as w,u as T,ut as E,vt as D}from"./DisclosureContext-Ds0hcZFn.js";import{a as O,c as ee,d as k,f as A,i as j,l as M,n as N,o as P,p as F,r as I,s as L,t as R,u as z}from"./plan-graph-vendor-B0sEms9Z.js";import{_ as B,d as V,i as te,l as ne,n as re,o as ie,p as ae,s as oe,t as se,u as ce}from"./useRecentFiles-Bb4-ukVz.js";import{Et as le,Tt as H,U as ue,ct as de,dt as fe,ft as pe,ht as U,lt as me,mt as W,ot as G,pt as he,s as ge,st as _e,ut as ve,yt as ye}from"./index-DaC8A2FS.js";import{t as be}from"./impact-sort-Eihua9dY.js";var xe={name:`arrow-left-right`,size:24,node:[[`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`}]]};xe.node;var Se=y(xe),Ce={name:`flag`,size:24,node:[[`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`}]]};Ce.node;var we=y(Ce),Te={name:`map`,size:24,node:[[`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`}]]};Te.node;var Ee=y(Te),De={name:`maximize-2`,size:24,node:[[`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`}]]};De.node;var Oe=y(De),ke={name:`settings`,size:24,node:[[`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`}]]};ke.node;var Ae=y(ke),je={name:`timer`,size:24,node:[[`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`}]]};je.node;var Me=y(je),Ne={name:`zoom-out`,size:24,node:[[`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`}]]};Ne.node;var Pe=y(Ne),Fe={name:`zoom-in`,size:24,node:[[`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`}]]};Fe.node;var Ie=y(Fe),K=e(t(),1);function Le({id:e,sourceNodeId:t,planNode:n,category:r,segmentIndex:i,splitRole:a,durationShare:o,exclusiveDurationShare:s,findings:c}){return{id:e,sourceNodeId:t,label:n.name,category:r,operatorDetail:ve(n.name,n.detail??``),primaryMetric:me(n.metrics),segmentIndex:i,splitRole:a,durationShare:o??null,exclusiveDurationShare:s??null,findings:c,metrics:(n.metrics??[]).map(e=>({name:e.name,value:de(e)})),detailText:n.detail&&n.detail!==n.name?n.detail:``}}function Re(e,t){let{scope:n,stageId:r,appModel:i,findings:a=[],durationMode:o=`exclusive`}=t;if(!e)return{nodes:[],edges:[],segmentIndex:null,segmentCount:0,scope:`full`,segmentStageIds:new Map};let s=i.stages.get(r)?.sqlExecutionId??null,c=s==null?null:i.sql.get(s),{segments:l,segOf:u,segmentTopology:d}=pe(e),f=l.filter(Boolean).length,p=c&&s!=null?G(e,i,c,s,o):null,m=o===`exclusive`?p:c&&s!=null?G(e,i,c,s,`exclusive`):null,h=new Map,g=c&&s!=null?fe(s,i.stages):[];if(g.length){let e=new Map;for(let t of g){let n=i.stages.get(t);n&&e.set(t,{submittedAt:n.submittedAt,completedAt:n.completedAt})}for(let[t,n]of he(l,e,g,d))h.set(t,n)}let _=new Map;if(s!=null){for(let e of a)if(`executionId`in e&&e.executionId===s)for(let t of e.planNodeIds??[]){let n=_.get(t);n?n.push(e):_.set(t,[e])}}let v=[],y=[],b=new Map;W(e,(e,t)=>{let n=e.id,r=_e(e.name),a=u.get(e),o=t?t.id:null,s=e.exchangeRole===`write`&&t?t.id:n,c=Le({id:n,sourceNodeId:s,planNode:e,category:r,segmentIndex:a,splitRole:e.exchangeRole??null,durationShare:p?.get(e),exclusiveDurationShare:m?.get(e),findings:_.get(n)??[]});if(v.push(c),e.exchangeRole){let t=b.get(s)??{};t[e.exchangeRole]=c,b.set(s,t)}if(o){let t={id:`${o}->${n}`,source:o,target:n};if(e.exchangeRole===`write`){let e=h.get(a),n=e==null?void 0:i.stages.get(e),r=n?.shuffleWriteBytes||n?.shuffleReadBytes;if(r){t.shuffleBytes=r;let e=b.get(s)??{};e.shuffleBytes=r,b.set(s,e)}}y.push(t)}},{dedupe:!0});for(let{read:e,write:t,shuffleBytes:n}of b.values())e&&t&&(e.pairedNodeId=t.id,t.pairedNodeId=e.id),n!=null&&(e&&(e.exchangeShuffleBytes=n),t&&(t.exchangeShuffleBytes=n));if(n===`full`)return{nodes:v,edges:y,segmentIndex:null,segmentCount:f,scope:`full`,segmentStageIds:h};let x=null;for(let[e,t]of h)if(t===r){x=e;break}if(x===null)return{nodes:v,edges:y,segmentIndex:null,segmentCount:f,scope:`full`,segmentStageIds:h};let S=new Set;return{nodes:v.filter(e=>e.segmentIndex===x&&(S.add(e.id),!0)),edges:y.filter(e=>S.has(e.source)&&S.has(e.target)),segmentIndex:x,segmentCount:f,scope:`segment`,segmentStageIds:h}}var ze=24,Be=32;function Ve(e,t,n={}){let r=new R.graphlib.Graph({compound:!!n.groupOf});r.setGraph({rankdir:`RL`,nodesep:128,ranksep:60,ranker:`tight-tree`}),r.setDefaultEdgeLabel(()=>({}));let i=new Set;if(n.groupOf){for(let t of e){let e=n.groupOf(t);e&&i.add(e)}for(let e of i)r.setNode(e,{})}for(let t of e){r.setNode(t.id,{width:220,height:90});let e=n.groupOf?.(t);e&&r.setParent(t.id,e)}for(let e of t)r.setEdge(e.source,e.target);return R.layout(r),e.map(e=>{let t=r.node(e.id);return{...e,position:{x:t.x-110,y:t.y-45}}})}function He(e,t,n={}){let r=n.paddingX??ze,i=n.paddingY??ze,a=n.headerHeight??Be,o=new Map;for(let n of e){let e=t(n);if(!e)continue;let r=n.position.x,i=n.position.y,a=r+220,s=i+90,c=o.get(e);c?(c.minX=Math.min(c.minX,r),c.minY=Math.min(c.minY,i),c.maxX=Math.max(c.maxX,a),c.maxY=Math.max(c.maxY,s)):o.set(e,{minX:r,minY:i,maxX:a,maxY:s})}return[...o.entries()].map(([e,t])=>({id:e,position:{x:t.minX-r,y:t.minY-i-a},width:t.maxX-t.minX+r*2,height:t.maxY-t.minY+i*2+a}))}function Ue(e,t,n={}){let r=new Set,i=[];for(let a of t){let t=t=>{let n=e(t);return n&&!r.has(n)?n:null};for(let e of He(a,t,n))r.add(e.id),i.push(e)}return i}var q=F();function We({delay:e=0,...t}){return(0,q.jsx)(p,{"data-slot":`tooltip-provider`,delay:e,...t})}function Ge({...e}){return(0,q.jsx)(i,{"data-slot":`tooltip`,...e})}function Ke({...e}){return(0,q.jsx)(d,{"data-slot":`tooltip-trigger`,...e})}function qe({className:e,side:t=`top`,sideOffset:i=4,align:a=`center`,alignOffset:s=0,children:c,...l}){return(0,q.jsx)(n,{children:(0,q.jsx)(r,{align:a,alignOffset:s,side:t,sideOffset:i,className:`isolate z-50`,children:(0,q.jsxs)(f,{"data-slot":`tooltip-content`,className:g(`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`,e),...l,children:[c,(0,q.jsx)(o,{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`})]})})})}function Je(e){return e==null?null:e>=40?`critical`:e>=15?`warning`:`info`}var J={scan:`⇩`,exchange:`⇄`,join:`⋈`,aggregate:`Σ`,sort:`↕`,filter:`∇`,aqe:`⚙`,boilerplate:`·`,transform:`→`};function Ye(e){return e.find(e=>e.impactBand===`critical`)??e.find(e=>e.impactBand===`warning`)??e[0]}function Xe({data:e}){let{label:t,operatorDetail:n,primaryMetric:r,category:i,splitRole:a,durationSharePct:o,findings:s}=e,c=J[i]??J.transform,l=Je(o);return(0,q.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:220,height:90},"data-category":i,children:[(0,q.jsx)(O,{type:`target`,position:k.Right,className:`opacity-0!`}),(0,q.jsx)(O,{type:`source`,position:k.Left,className:`opacity-0!`}),s&&s.length>0?(()=>{let e=Ye(s);return(0,q.jsxs)(Ge,{children:[(0,q.jsxs)(Ke,{"data-testid":`node-finding-badge`,className:g(`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`,x[e.impactBand]),children:[(0,q.jsx)(T,{impactBand:e.impactBand}),S(e.type),s.length>1?(0,q.jsx)(`span`,{children:s.length}):null]}),(0,q.jsx)(qe,{className:`max-w-xs`,children:(0,q.jsx)(`ul`,{className:`flex flex-col gap-1 text-left`,children:s.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(T,{impactBand:e.impactBand}),(0,q.jsx)(`span`,{children:ge(e)})]},e.id??`${e.type}-${t}`))})})]})})():null,a===`read`?(0,q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:`paired: see write half`}):null,o!=null&&l?(0,q.jsxs)(`div`,{className:`mb-1 flex shrink-0 items-center gap-1.5`,title:`Share of the plan's total stage wall time`,children:[(0,q.jsxs)(`span`,{className:g(`shrink-0 text-[10px] font-medium tabular-nums`,x[l]),children:[o,`%`]}),(0,q.jsx)(`div`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,q.jsx)(`div`,{"data-testid":`duration-heat-bar-fill`,className:g(`h-full rounded-full`,w[l]),style:{width:`${o>0?Math.max(o,4):0}%`}})}),(0,q.jsxs)(`span`,{className:`sr-only`,children:[`Duration share `,o,`%, `,l===`critical`?`high`:l===`warning`?`medium`:`low`]})]}):null,(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:c}),(0,q.jsx)(`span`,{className:`min-w-0 truncate font-medium`,title:t,children:t})]}),n?(0,q.jsx)(`p`,{className:`truncate text-muted-foreground`,title:n,children:n}):null,r?(0,q.jsx)(`p`,{className:`truncate text-muted-foreground`,title:r,children:r}):null]})}var Ze={read:`Read half. Consumes the shuffle written by its paired write half.`,write:`Write half. Produces the shuffle its paired read half consumes.`};function Qe({node:e,onClose:t,onJumpToPaired:n}){let r=J[e.category]??J.transform,i=e.findings??[],a=e.metrics??[],o=e.category.charAt(0).toUpperCase()+e.category.slice(1);return(0,q.jsxs)(`div`,{"data-testid":`plan-node-detail`,role:`dialog`,"aria-label":`Plan node detail: ${e.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:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:r}),(0,q.jsx)(`span`,{className:`break-words font-medium`,children:e.label})]}),(0,q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,"aria-label":`Close node detail`,onClick:t,children:(0,q.jsx)(U,{className:`size-4`})})]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[o,` · Segment `,e.segmentIndex+1,e.durationSharePct==null?null:(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsxs)(`span`,{className:`text-foreground`,children:[e.durationSharePct,`%`]}),` of plan stage time`]})]}),e.splitRole?(0,q.jsxs)(Y,{title:`Exchange`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:Ze[e.splitRole]}),e.exchangeShuffleBytes==null?e.label.startsWith(`Broadcast`)?(0,q.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Broadcast, no shuffle`}):null:(0,q.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`Shuffle written`,` `,(0,q.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:_(e.exchangeShuffleBytes)})]}),e.pairedNodeId&&n?(0,q.jsxs)(H,{type:`button`,variant:`outline`,size:`sm`,className:`mt-2 h-7 w-full justify-start gap-1.5`,onClick:()=>n(e.pairedNodeId),children:[(0,q.jsx)(Se,{className:`size-3.5`,"aria-hidden":`true`}),`Jump to `,e.splitRole===`read`?`write`:`read`,` half`]}):null]}):null,i.length>0?(0,q.jsx)(Y,{title:`Findings`,children:(0,q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:i.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex items-start gap-1.5`,children:[(0,q.jsx)(b,{type:e.type,impactBand:e.impactBand,docAnchor:e.docAnchor,className:`shrink-0`}),(0,q.jsx)(`span`,{className:`break-words`,children:ge(e)})]},e.id??`${e.type}-${t}`))})}):null,a.length>0?(0,q.jsx)(Y,{title:`Metrics`,children:(0,q.jsx)(`dl`,{className:`grid grid-cols-[1fr_auto] gap-x-3 gap-y-1`,children:a.map((e,t)=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`min-w-0 break-words text-muted-foreground`,children:e.name}),(0,q.jsx)(`dd`,{className:`text-right font-medium tabular-nums`,children:e.value})]},`${e.name}-${t}`))})}):null,e.detailText?(0,q.jsx)(Y,{title:`Plan detail`,children:(0,q.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:e.detailText})}):null]})}function Y({title:e,children:t}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:e}),t]})}var $e=[{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 et(){return(0,q.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:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:`Operators`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:$e.map(({category:e,label:t})=>(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:J[e]}),t]},e))})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:`Duration share`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:g(`h-1.5 w-6 rounded-full`,w.info)}),` low`]}),(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:g(`h-1.5 w-6 rounded-full`,w.warning)}),` medium`]}),(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:g(`h-1.5 w-6 rounded-full`,w.critical)}),` high`]})]})]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[(0,q.jsx)(`span`,{className:`text-foreground`,children:`Edge thickness`}),` = shuffle bytes moved across an exchange.`]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`A `,(0,q.jsx)(`span`,{className:`text-foreground`,children:`segment`}),` box groups one Exchange-bounded stage of the plan; a`,` `,(0,q.jsx)(`span`,{className:`text-foreground`,children:`stage`}),` box (full-plan view) wraps every segment of one Spark stage.`]})]})}function tt({...e}){return(0,q.jsx)(u,{"data-slot":`popover`,...e})}function nt({...e}){return(0,q.jsx)(a,{"data-slot":`popover-trigger`,...e})}function rt({align:e=`center`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=8,className:i,...a}){return(0,q.jsx)(s,{children:(0,q.jsx)(c,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,q.jsx)(l,{"data-slot":`popover-content`,className:g(`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`,i),...a})})})}function it({ariaLabel:e,name:t,options:n,value:r,onChange:i,trailingContent:a}){return(0,q.jsx)(We,{children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,role:`radiogroup`,"aria-label":e,children:[n.map(e=>(0,q.jsxs)(Ge,{children:[(0,q.jsxs)(Ke,{render:(0,q.jsx)(`label`,{className:`tap-target-comfortable flex min-h-8 items-center gap-1.5 px-1 text-sm`}),children:[(0,q.jsx)(`input`,{type:`radio`,name:t,value:e.value,checked:r===e.value,onChange:()=>i(e.value)}),e.label]}),(0,q.jsx)(qe,{children:e.description})]},e.value)),a]})})}var at=[{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 ot({mode:e,onChange:t,hiddenCount:n}){return(0,q.jsx)(it,{ariaLabel:`Node filter`,name:`plan-graph-filter`,options:at,value:e,onChange:t,trailingContent:n>0?(0,q.jsx)(C,{label:`${n} nodes hidden`,impactBand:`info`}):null})}var st=[{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 ct({mode:e,onChange:t}){return(0,q.jsx)(it,{ariaLabel:`Duration heat bar scope`,name:`plan-graph-duration-mode`,options:st,value:e,onChange:t})}function lt({filterMode:e,onFilterModeChange:t,hiddenCount:n,durationMode:r,onDurationModeChange:i,iconOnly:a=!1}){return(0,q.jsxs)(tt,{children:[(0,q.jsxs)(nt,{"aria-label":a?`Settings`:void 0,title:a?`Settings`:void 0,className:g(le({variant:`ghost`,size:a?`icon`:`sm`}),`tap-target-comfortable`,a?void 0:`gap-1.5`),children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),a?null:`Settings`]}),(0,q.jsxs)(rt,{align:a?`start`:`end`,side:a?`right`:`bottom`,"aria-label":`Plan graph settings`,className:`space-y-3`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Node filter`}),(0,q.jsx)(ot,{mode:e,onChange:t,hiddenCount:n})]}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-px bg-border`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Duration attribution`}),(0,q.jsx)(ct,{mode:r,onChange:i})]})]})]})}var X=e=>e.data;function ut({planNodes:e,problemNodes:t,filterMode:n,onFilterModeChange:r,hiddenCount:i,durationMode:a,onDurationModeChange:o,legendOpen:s,onToggleLegend:c,miniMapOpen:l,onToggleMiniMap:u}){let{zoomIn:d,zoomOut:f,fitView:p,setCenter:m}=z(),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(null),y=[...e].filter(e=>X(e).durationSharePct!=null).sort((e,t)=>(X(t).durationSharePct??0)-(X(e).durationSharePct??0)),b=e=>{e&&m(e.position.x,e.position.y,{zoom:1,duration:300})},x=(e,t,n)=>{if(e.length===0)return;let r=e[((t?e.findIndex(e=>e.id===t):-1)+1)%e.length];b(r),n(r.id)};return(0,q.jsxs)(`div`,{className:`flex w-12 shrink-0 flex-col items-center gap-1 border-r border-border bg-card/60 py-2`,children:[(0,q.jsxs)(dt,{children:[(0,q.jsx)(Z,{label:`Zoom in`,onClick:()=>d({duration:200}),children:(0,q.jsx)(Ie,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:`Zoom out`,onClick:()=>f({duration:200}),children:(0,q.jsx)(Pe,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:`Fit to view`,onClick:()=>p({duration:200}),children:(0,q.jsx)(Oe,{"aria-hidden":`true`})})]}),(0,q.jsx)(ft,{}),(0,q.jsxs)(dt,{children:[(0,q.jsx)(Z,{label:`Next worst duration`,disabled:y.length===0,onClick:()=>x(y,h,g),children:(0,q.jsx)(Me,{"aria-hidden":`true`})}),t.length>0?(0,q.jsx)(Z,{label:`Next problem`,onClick:()=>x(t,_,v),children:(0,q.jsx)(we,{"aria-hidden":`true`})}):null]}),(0,q.jsx)(ft,{}),(0,q.jsxs)(dt,{children:[(0,q.jsx)(lt,{iconOnly:!0,filterMode:n,onFilterModeChange:r,hiddenCount:i,durationMode:a,onDurationModeChange:o}),(0,q.jsx)(Z,{label:s?`Hide legend`:`Legend`,pressed:s,onClick:c,children:(0,q.jsx)(ye,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:l?`Hide minimap`:`Show minimap`,pressed:l,onClick:u,children:(0,q.jsx)(Ee,{"aria-hidden":`true`})})]})]})}function dt({children:e}){return(0,q.jsx)(`div`,{className:`flex flex-col items-center gap-1`,children:e})}function ft(){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`my-0.5 h-px w-6 bg-border`})}function Z({label:e,onClick:t,disabled:n,pressed:r,children:i}){return(0,q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,className:g(`tap-target-comfortable`,r&&`bg-primary/15 text-primary hover:bg-primary/20 hover:text-primary`),"aria-label":e,title:e,"aria-pressed":r,disabled:n,onClick:t,children:i})}function pt(e){if(e.type!==`planNode`)return`var(--muted)`;let t=e.data.findings??[],n=E(t);return n?B[n]:`var(--plan-aggregate)`}function mt({finding:e,className:t}){let n=m(e);return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,q.jsx)(b,{type:e.type,impactBand:e.impactBand,docAnchor:e.docAnchor,className:t}),n?(0,q.jsx)(`span`,{className:`font-mono text-[10px] leading-none whitespace-nowrap text-muted-foreground`,children:n}):null]})}function ht({data:e}){let{width:t,height:n,stageId:r,durationLabel:i,findings:a}=e;return(0,q.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-dashed border-border/70 bg-muted/10 nopan nodrag`,style:{width:t,height:n,pointerEvents:`all`},children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1 text-xs text-muted-foreground`,children:[(0,q.jsx)(`span`,{title:r==null?`This plan segment couldn't be matched to a specific Spark stage`:void 0,children:r==null?`Stage —`:`Stage ${r}`}),(0,q.jsx)(C,{label:i??`—`,impactBand:`info`,title:`Approximate share of this stage's wall time`}),a.length>0?(0,q.jsx)(`div`,{className:`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1`,children:a.map((e,t)=>(0,q.jsx)(mt,{finding:e,className:`h-4 gap-1 px-1.5 text-xs`},e.id??`${e.type}-${t}`))}):null]})})}function gt({data:e}){let{width:t,height:n,stageId:r,findings:i,showOwnFindings:a=!0,onSelect:o}=e;return(0,q.jsxs)(`div`,{className:`relative rounded-xl border border-primary/25 bg-primary/5 nopan nodrag`,style:{width:t,height:n,pointerEvents:`all`},children:[(0,q.jsx)(`button`,{type:`button`,"aria-label":`Focus stage ${r}`,onClick:o,style:{pointerEvents:`auto`},className:`absolute inset-0 size-full cursor-pointer rounded-xl transition-colors hover:border-primary/50 hover:bg-primary/10`}),a&&i.length>0?(0,q.jsx)(`div`,{className:`absolute left-2 right-2 top-1 flex flex-wrap gap-1`,children:i.map((e,t)=>(0,q.jsx)(mt,{finding:e,className:`h-4 gap-1 px-1.5 text-xs`},e.id??`${e.type}-${t}`))}):null,(0,q.jsxs)(`span`,{className:`absolute right-2 bottom-1 text-xs font-medium text-primary`,children:[`Stage `,r]})]})}var _t=1.5,vt=.55;function yt(e,t){return!(e>0)||!(t>0)?0:Math.min(1,Math.log(e+1)/Math.log(t+1))}function bt(e,t){return _t+7.5*yt(e,t)}function xt(e,t){return vt+.44999999999999996*yt(e,t)}function St({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a,markerEnd:o,data:s}){let[c,l,u]=A({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a}),{shuffleBytes:d=0,maxShuffleBytes:f=0}=s??{},p=bt(d,f),m=xt(d,f),h=d>0&&d<1e3?`<1 KB`:_(d);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(I,{path:c,markerEnd:o,style:{stroke:`var(--text-muted)`,strokeWidth:p,strokeOpacity:m}}),(0,q.jsx)(j,{children:(0,q.jsxs)(Ge,{children:[(0,q.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(${l}px, ${u}px)`},children:h}),(0,q.jsx)(qe,{className:`max-w-xs`,children:(0,q.jsxs)(`p`,{children:[h,` of shuffle written across this exchange. Edge thickness scales with the volume moved.`]})})]})})]})}var Ct={planNode:Xe,segmentGroup:ht,stageGroup:gt},wt={exchange:St},Tt=1,Et=2,Dt=3,Ot=e=>e.data,Q={padding:.06,maxZoom:1.75};function kt({resizeTick:e,fitSignal:t,centerRequest:n}){let{fitView:r,setCenter:i,getNode:a}=z();return(0,K.useEffect)(()=>{if(!n||n.token===0||!n.nodeId)return;let e=a(n.nodeId);e?i(e.position.x,e.position.y,{zoom:1,duration:300}):r({nodes:[{id:n.nodeId}],duration:300,maxZoom:1})},[n,i,a,r]),(0,K.useEffect)(()=>{let e=()=>r({duration:200,...Q});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[r]),(0,K.useEffect)(()=>{e!==0&&r({duration:200,...Q})},[e,r]),(0,K.useEffect)(()=>{t!==0&&r({duration:300,...Q})},[t,r]),null}function At(){let e=(0,K.useRef)(null),[t,n]=(0,K.useState)(0);return(0,K.useEffect)(()=>{let t=e.current;if(!t)return;let r=!0,i=new ResizeObserver(()=>{if(r){r=!1;return}n(e=>e+1)});return i.observe(t),()=>i.disconnect()},[]),{ref:e,tick:t}}function jt(e,t){return e.filter(e=>e.stageId===t||ae(e)?.includes(t))}function Mt({model:e,showMiniMap:t,findings:n=[],stageId:r,segmentStageIds:i,visibleNodeIds:a,visibleEdges:o,onSelectStage:s,selectedNodeId:c=null,onSelectNode:l,onJumpToPaired:u,centerRequest:d,fitSignal:f=0,filterMode:p=`basic`,onFilterModeChange:m=()=>{},hiddenCount:h=0,durationMode:g=`exclusive`,onDurationModeChange:_=()=>{}}){let{flowNodes:y,flowEdges:b}=(0,K.useMemo)(()=>{let t=e.nodes.reduce((e,t)=>e+(t.exclusiveDurationShare??t.durationShare??0),0),c=e=>`segment-${e.segmentIndex}`,l=e.scope===`full`,u=e=>{let t=i?.get(e.segmentIndex);return t==null?null:`stage-${t}`},d=a?Ve(e.nodes.filter(e=>a.has(e.id)),o??e.edges,{groupOf:c}):Ve(e.nodes,e.edges,{groupOf:c}),f=new Set(d.map(c)),p=l?new Set(d.map(u).filter(e=>e!=null)):null,m=e.nodes.some(e=>!f.has(c(e)))||p!=null&&e.nodes.some(e=>{let t=u(e);return t!=null&&!p.has(t)})?Ve(e.nodes,e.edges,{groupOf:c}):d,h=d.map(e=>{let n=e.durationShare!=null&&t>0?Math.round(e.durationShare/t*100):null,r=e.splitRole===`read`?`${e.label}, paired: see write half`:[e.label,e.operatorDetail,e.primaryMetric,n==null?null:`${n}% of the plan's total stage duration`].filter(Boolean).join(`, `);return{id:e.id,type:`planNode`,position:e.position,draggable:!1,zIndex:Dt,measured:{width:220,height:90},ariaLabel:r,ariaRole:`button`,data:{...e,durationSharePct:n}}}),g=Ue(c,[d,m]).map(t=>{let r=Number(t.id.replace(`segment-`,``)),a=e.nodes.filter(e=>c(e)===t.id),o=a.reduce((e,t)=>e+(t.exclusiveDurationShare??t.durationShare??0),0),s=a.some(e=>e.durationShare!=null),l=i?.get(r)??null,u=l==null?[]:jt(n,l);return{id:t.id,type:`segmentGroup`,position:t.position,draggable:!1,selectable:!1,focusable:!1,zIndex:Et,style:{width:t.width,height:t.height},measured:{width:t.width,height:t.height},data:{width:t.width,height:t.height,stageId:l,durationLabel:s?v(o):null,findings:u}}}),_=new Set(g.map(e=>e.data.stageId).filter(e=>e!=null)),y=l?(()=>{let e={paddingX:32,paddingY:64,headerHeight:0},t=Ue(u,[d,m],e),i=`stage-${r}`;if(jt(n,r).length>0&&!t.some(e=>e.id===i)){let[n]=Ue(()=>i,[d,m],e);n&&t.push(n)}return t.map(e=>{let t=Number(e.id.replace(`stage-`,``));return{id:e.id,type:`stageGroup`,position:e.position,draggable:!1,selectable:!1,focusable:!1,zIndex:Tt,style:{width:e.width,height:e.height},measured:{width:e.width,height:e.height},data:{width:e.width,height:e.height,stageId:t,findings:jt(n,t),showOwnFindings:!_.has(t),onSelect:()=>s?.(t)}}})})():[],b=o??e.edges,x=b.reduce((e,t)=>Math.max(e,t.shuffleBytes??0),0),S=b.map(e=>e.shuffleBytes?{id:e.id,source:e.source,target:e.target,type:`exchange`,data:{shuffleBytes:e.shuffleBytes,maxShuffleBytes:x}}:{id:e.id,source:e.source,target:e.target});return{flowNodes:[...y,...g,...h],flowEdges:S}},[e,n,r,i,a,o,s]),{ref:x,tick:S}=At(),[C,w]=(0,K.useState)(!0),[T,E]=(0,K.useState)(!0),D=c?y.find(e=>e.id===c&&e.type===`planNode`):void 0,O=y.filter(e=>e.type===`planNode`),k=y.filter(e=>e.type===`stageGroup`&&(e.data.findings?.length??0)>0).sort(be(e=>e.data.findings??[])),A=a!=null&&a.size===0&&e.nodes.length>0;return(0,q.jsx)(ee,{children:(0,q.jsx)(We,{children:(0,q.jsxs)(`div`,{ref:x,className:`flex min-h-0 flex-1`,children:[(0,q.jsx)(ut,{planNodes:O,problemNodes:k,filterMode:p,onFilterModeChange:m,hiddenCount:h,durationMode:g,onDurationModeChange:_,legendOpen:C,onToggleLegend:()=>w(e=>!e),miniMapOpen:t&&T,onToggleMiniMap:()=>E(e=>!e)}),(0,q.jsx)(`div`,{className:`relative min-w-0 flex-1`,onKeyDown:e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target.closest(`.react-flow__node-planNode`)?.getAttribute(`data-id`);t&&(e.preventDefault(),l?.(t))},children:(0,q.jsxs)(M,{nodes:y,edges:b,nodeTypes:Ct,edgeTypes:wt,"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:Q,minZoom:.05,edgesFocusable:!1,onNodeClick:(e,t)=>{t.type===`planNode`&&l?.(t.id)},onPaneClick:()=>l?.(null),children:[(0,q.jsx)(N,{}),(0,q.jsx)(kt,{resizeTick:S,fitSignal:f,centerRequest:d}),A?(0,q.jsx)(L,{position:`top-center`,children:(0,q.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 `,e.nodes.length,` operators are hidden by the node filter. Change it in Settings to show them.`]})}):null,C?(0,q.jsx)(L,{position:`bottom-left`,children:(0,q.jsx)(et,{})}):null,t&&T?(0,q.jsx)(P,{nodeColor:pt,pannable:!0,zoomable:!0,ariaLabel:`Plan overview. Drag to pan and scroll to zoom the graph.`}):null]})}),D?(0,q.jsx)(Qe,{node:Ot(D),onClose:()=>l?.(null),onJumpToPaired:u}):null]})})})}function Nt({open:e,nodeCount:t,onConfirm:n,onCancel:r}){return(0,q.jsx)(ie,{open:e,onOpenChange:e=>{e||r()},children:(0,q.jsxs)(oe,{children:[(0,q.jsx)(ce,{children:(0,q.jsx)(V,{children:`Expand to full plan?`})}),(0,q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This plan has `,t,` nodes. Rendering the full graph may take several seconds.`]}),(0,q.jsxs)(ne,{children:[(0,q.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Cancel`}),(0,q.jsx)(H,{type:`button`,size:`sm`,onClick:n,children:`Expand anyway`})]})]})})}var Pt={io:[`scan`,`exchange`],basic:[`scan`,`exchange`,`join`,`aggregate`,`sort`,`filter`],advanced:null},Ft=300;function It(e,t){let n=new Map;for(let t of e){let e=n.get(t.source);e?e.push(t.target):n.set(t.source,[t.target])}let r=new Map;function i(e){let a=r.get(e);if(a)return a;let o=new Set;r.set(e,o);for(let r of n.get(e)??[])if(t.has(r))o.add(r);else for(let e of i(r))o.add(e);return o}let a=new Map;for(let t of e)t.shuffleBytes&&a.set(`${t.source}->${t.target}`,t.shuffleBytes);let o=[];for(let e of t)for(let t of i(e)){let n={id:`${e}=>${t}`,source:e,target:t},r=a.get(`${e}->${t}`);r&&(n.shuffleBytes=r),o.push(n)}return o}function Lt(e,t){try{return Re(e,t)}catch{return null}}var Rt=new Map;function zt(e,t,n,r){return`${e??`none`}::${t}::${n}::${r}`}function Bt(){Rt.clear()}var Vt=D.getState().modelResetCount;D.subscribe(e=>{e.modelResetCount!==Vt&&(Vt=e.modelResetCount,Bt())});function $(e,t,n){let r=zt(n,t.stageId,t.scope,t.durationMode),i=Rt.get(r);if(i)return i;let a=Lt(e,t);return a&&Rt.set(r,a),a}function Ht({stageId:e,appModel:t,findings:n,activeFileId:r,onClose:i,initialScope:a}){let{resetToDropZone:o}=ue(),{recentEntries:s,onPickRecent:c,onRemoveRecent:l}=se(r),[u,d]=(0,K.useState)(`basic`),[f,p]=(0,K.useState)(`exclusive`),[m,g]=(0,K.useState)(a??`segment`),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(a!==`full`),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(e),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(0),[ee,k]=(0,K.useState)({nodeId:null,token:0}),[A,j]=(0,K.useState)(null),M=e=>k(t=>({nodeId:e,token:t.token+1}));(0,K.useEffect)(()=>{E(null)},[C,m,u]);let N=te(C,t),P=N?$(N,{scope:`segment`,stageId:C,appModel:t,findings:n,durationMode:f},r):null,F=P!=null&&P.scope===`full`&&m===`segment`&&P.nodes.length>Ft,I=F&&!x;(0,K.useEffect)(()=>{I&&v(!0)},[I]);let L=N&&(m===`full`||_)?$(N,{scope:`full`,stageId:C,appModel:t,findings:n,durationMode:f},r):null,R=!y&&m===`full`&&L!=null&&L.nodes.length>Ft,z=_||R;(0,K.useEffect)(()=>{let e=e=>{e.key!==`Escape`||z||(T?E(null):i())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,z,T]);let B=F||R?null:m===`full`?L:P;(0,K.useEffect)(()=>{A&&m===`full`&&B?.nodes.some(e=>e.id===A)&&(E(A),M(A),j(null))},[A,m,B]);function V(){let e=N?$(N,{scope:`full`,stageId:C,appModel:t,findings:n,durationMode:f},r):null;e&&e.nodes.length>Ft?v(!0):(g(`full`),O(e=>e+1))}function ne(){g(`segment`),O(e=>e+1)}function ie(e){if(B?.nodes.some(t=>t.id===e)){E(e),M(e);return}j(e),V()}let ae=(0,K.useCallback)(e=>{w(e),g(`segment`),b(!0),S(!1),j(null),O(e=>e+1)},[]);function oe(){b(!0),g(`full`),v(!1),O(e=>e+1)}function ce(){v(!1),j(null),R&&(b(!0),g(`segment`),P?.scope===`full`&&S(!0)),I&&S(!0)}function le(e){return i(),c(e)}let{visibleNodeIds:de,filteredEdges:fe,hiddenNodes:pe}=(0,K.useMemo)(()=>{let e=Pt[u],t=new Set;if(B)for(let n of B.nodes)(!e||e.includes(n.category))&&t.add(n.id);return{visibleNodeIds:t,filteredEdges:B?It(B.edges,t):[],hiddenNodes:B?B.nodes.filter(e=>!t.has(e.id)):[]}},[B,u]),U=B?.scope===`full`,me=m===`full`,W=(0,K.useId)(),G=U&&!me;return(0,q.jsxs)(`div`,{"data-testid":`dashboard`,className:`flex h-screen flex-col`,style:{paddingRight:`var(--docs-inset, 0px)`},children:[(0,q.jsx)(re,{onLoadNew:o,recentEntries:s,activeFileId:r,onPickRecent:le,onRemoveRecent:l,leadingContent:(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsxs)(`h1`,{className:`truncate font-heading text-sm font-semibold`,children:[`Plan graph: Stage `,C]}),B&&B.scope===`segment`?(0,q.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`Segment `,B.segmentIndex+1,` of `,B.segmentCount]}):null,(0,q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:(0,q.jsx)(h,{anchor:`#bottleneck-duplicate-plan-subtree`,children:`Plan Advisor docs`})})]}),sectionControls:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex flex-col items-end gap-0.5`,children:[(0,q.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,disabled:G,"aria-describedby":G?W:void 0,onClick:U?ne:V,children:U?`Back to segment view`:`Expand to full plan`}),G?(0,q.jsx)(`p`,{id:W,className:`text-xs text-muted-foreground`,children:`This stage's plan couldn't be scoped to a single segment`}):null]}),(0,q.jsx)(H,{variant:`ghost`,size:`sm`,onClick:i,children:`Close`})]})}),(0,q.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:R?null:!N||!B?(0,q.jsx)(`p`,{role:`alert`,className:`p-6 text-sm text-destructive`,children:F?`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.`}):(0,q.jsx)(Mt,{model:B,visibleNodeIds:de,visibleEdges:fe,showMiniMap:!0,findings:n,stageId:C,segmentStageIds:B.segmentStageIds,onSelectStage:ae,selectedNodeId:T,onSelectNode:E,onJumpToPaired:ie,centerRequest:ee,fitSignal:D,filterMode:u,onFilterModeChange:d,hiddenCount:pe.length,durationMode:f,onDurationModeChange:p})}),(0,q.jsx)(Nt,{open:z,nodeCount:L?.nodes.length??0,onConfirm:oe,onCancel:ce})]})}export{Ht as PlanGraphRoute};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{C as n,S as r,T as i,_ as a,b as o,g as s,h as c,m as l,v as u,w as d,x as f,y as p}from"./react-vendor-DEdfrRTJ.js";import{Q as m,S as h,Tt as g,Y as _,Z as v,_t as y,d as b,l as x,lt as S,o as C,s as w,u as T,ut as E,vt as D}from"./DisclosureContext-B0siMVdg.js";import{a as O,c as ee,d as k,f as A,i as j,l as M,n as N,o as P,p as F,r as I,s as L,t as R,u as z}from"./plan-graph-vendor-BYl-AzN5.js";import{_ as B,d as V,i as te,l as ne,n as re,o as ie,p as ae,s as oe,t as se,u as ce}from"./useRecentFiles-C3Ov47U7.js";import{Et as le,Tt as H,U as ue,ct as de,dt as fe,ft as pe,ht as U,lt as me,mt as W,ot as G,pt as he,s as ge,st as _e,ut as ve,yt as ye}from"./index-DCeWge12.js";import{t as be}from"./impact-sort-BTQndbof.js";var xe={name:`arrow-left-right`,size:24,node:[[`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`}]]};xe.node;var Se=y(xe),Ce={name:`flag`,size:24,node:[[`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`}]]};Ce.node;var we=y(Ce),Te={name:`map`,size:24,node:[[`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`}]]};Te.node;var Ee=y(Te),De={name:`maximize-2`,size:24,node:[[`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`}]]};De.node;var Oe=y(De),ke={name:`settings`,size:24,node:[[`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`}]]};ke.node;var Ae=y(ke),je={name:`timer`,size:24,node:[[`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`}]]};je.node;var Me=y(je),Ne={name:`zoom-in`,size:24,node:[[`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`}]]};Ne.node;var Pe=y(Ne),Fe={name:`zoom-out`,size:24,node:[[`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`}]]};Fe.node;var Ie=y(Fe),K=e(t(),1);function Le({id:e,sourceNodeId:t,planNode:n,category:r,segmentIndex:i,splitRole:a,durationShare:o,exclusiveDurationShare:s,findings:c}){return{id:e,sourceNodeId:t,label:n.name,category:r,operatorDetail:ve(n.name,n.detail??``),primaryMetric:me(n.metrics),segmentIndex:i,splitRole:a,durationShare:o??null,exclusiveDurationShare:s??null,findings:c,metrics:(n.metrics??[]).map(e=>({name:e.name,value:de(e)})),detailText:n.detail&&n.detail!==n.name?n.detail:``}}function Re(e,t){let{scope:n,stageId:r,appModel:i,findings:a=[],durationMode:o=`exclusive`}=t;if(!e)return{nodes:[],edges:[],segmentIndex:null,segmentCount:0,scope:`full`,segmentStageIds:new Map};let s=i.stages.get(r)?.sqlExecutionId??null,c=s==null?null:i.sql.get(s),{segments:l,segOf:u,segmentTopology:d}=pe(e),f=l.filter(Boolean).length,p=c&&s!=null?G(e,i,c,s,o):null,m=o===`exclusive`?p:c&&s!=null?G(e,i,c,s,`exclusive`):null,h=new Map,g=c&&s!=null?fe(s,i.stages):[];if(g.length){let e=new Map;for(let t of g){let n=i.stages.get(t);n&&e.set(t,{submittedAt:n.submittedAt,completedAt:n.completedAt})}for(let[t,n]of he(l,e,g,d))h.set(t,n)}let _=new Map;if(s!=null){for(let e of a)if(`executionId`in e&&e.executionId===s)for(let t of e.planNodeIds??[]){let n=_.get(t);n?n.push(e):_.set(t,[e])}}let v=[],y=[],b=new Map;W(e,(e,t)=>{let n=e.id,r=_e(e.name),a=u.get(e),o=t?t.id:null,s=e.exchangeRole===`write`&&t?t.id:n,c=Le({id:n,sourceNodeId:s,planNode:e,category:r,segmentIndex:a,splitRole:e.exchangeRole??null,durationShare:p?.get(e),exclusiveDurationShare:m?.get(e),findings:_.get(n)??[]});if(v.push(c),e.exchangeRole){let t=b.get(s)??{};t[e.exchangeRole]=c,b.set(s,t)}if(o){let t={id:`${o}->${n}`,source:o,target:n};if(e.exchangeRole===`write`){let e=h.get(a),n=e==null?void 0:i.stages.get(e),r=n?.shuffleWriteBytes||n?.shuffleReadBytes;if(r){t.shuffleBytes=r;let e=b.get(s)??{};e.shuffleBytes=r,b.set(s,e)}}y.push(t)}},{dedupe:!0});for(let{read:e,write:t,shuffleBytes:n}of b.values())e&&t&&(e.pairedNodeId=t.id,t.pairedNodeId=e.id),n!=null&&(e&&(e.exchangeShuffleBytes=n),t&&(t.exchangeShuffleBytes=n));if(n===`full`)return{nodes:v,edges:y,segmentIndex:null,segmentCount:f,scope:`full`,segmentStageIds:h};let x=null;for(let[e,t]of h)if(t===r){x=e;break}if(x===null)return{nodes:v,edges:y,segmentIndex:null,segmentCount:f,scope:`full`,segmentStageIds:h};let S=new Set;return{nodes:v.filter(e=>e.segmentIndex===x&&(S.add(e.id),!0)),edges:y.filter(e=>S.has(e.source)&&S.has(e.target)),segmentIndex:x,segmentCount:f,scope:`segment`,segmentStageIds:h}}var ze=24,Be=32;function Ve(e,t,n={}){let r=new R.graphlib.Graph({compound:!!n.groupOf});r.setGraph({rankdir:`RL`,nodesep:128,ranksep:60,ranker:`tight-tree`}),r.setDefaultEdgeLabel(()=>({}));let i=new Set;if(n.groupOf){for(let t of e){let e=n.groupOf(t);e&&i.add(e)}for(let e of i)r.setNode(e,{})}for(let t of e){r.setNode(t.id,{width:220,height:90});let e=n.groupOf?.(t);e&&r.setParent(t.id,e)}for(let e of t)r.setEdge(e.source,e.target);return R.layout(r),e.map(e=>{let t=r.node(e.id);return{...e,position:{x:t.x-110,y:t.y-45}}})}function He(e,t,n={}){let r=n.paddingX??ze,i=n.paddingY??ze,a=n.headerHeight??Be,o=new Map;for(let n of e){let e=t(n);if(!e)continue;let r=n.position.x,i=n.position.y,a=r+220,s=i+90,c=o.get(e);c?(c.minX=Math.min(c.minX,r),c.minY=Math.min(c.minY,i),c.maxX=Math.max(c.maxX,a),c.maxY=Math.max(c.maxY,s)):o.set(e,{minX:r,minY:i,maxX:a,maxY:s})}return[...o.entries()].map(([e,t])=>({id:e,position:{x:t.minX-r,y:t.minY-i-a},width:t.maxX-t.minX+r*2,height:t.maxY-t.minY+i*2+a}))}function Ue(e,t,n={}){let r=new Set,i=[];for(let a of t){let t=t=>{let n=e(t);return n&&!r.has(n)?n:null};for(let e of He(a,t,n))r.add(e.id),i.push(e)}return i}var q=F();function We({delay:e=0,...t}){return(0,q.jsx)(p,{"data-slot":`tooltip-provider`,delay:e,...t})}function Ge({...e}){return(0,q.jsx)(i,{"data-slot":`tooltip`,...e})}function Ke({...e}){return(0,q.jsx)(d,{"data-slot":`tooltip-trigger`,...e})}function qe({className:e,side:t=`top`,sideOffset:i=4,align:a=`center`,alignOffset:s=0,children:c,...l}){return(0,q.jsx)(n,{children:(0,q.jsx)(r,{align:a,alignOffset:s,side:t,sideOffset:i,className:`isolate z-50`,children:(0,q.jsxs)(f,{"data-slot":`tooltip-content`,className:g(`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`,e),...l,children:[c,(0,q.jsx)(o,{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`})]})})})}function Je(e){return e==null?null:e>=40?`critical`:e>=15?`warning`:`info`}var J={scan:`⇩`,exchange:`⇄`,join:`⋈`,aggregate:`Σ`,sort:`↕`,filter:`∇`,aqe:`⚙`,boilerplate:`·`,transform:`→`};function Ye(e){return e.find(e=>e.impactBand===`critical`)??e.find(e=>e.impactBand===`warning`)??e[0]}function Xe({data:e}){let{label:t,operatorDetail:n,primaryMetric:r,category:i,splitRole:a,durationSharePct:o,findings:s}=e,c=J[i]??J.transform,l=Je(o);return(0,q.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:220,height:90},"data-category":i,children:[(0,q.jsx)(O,{type:`target`,position:k.Right,className:`opacity-0!`}),(0,q.jsx)(O,{type:`source`,position:k.Left,className:`opacity-0!`}),s&&s.length>0?(()=>{let e=Ye(s);return(0,q.jsxs)(Ge,{children:[(0,q.jsxs)(Ke,{"data-testid":`node-finding-badge`,className:g(`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`,x[e.impactBand]),children:[(0,q.jsx)(T,{impactBand:e.impactBand}),S(e.type),s.length>1?(0,q.jsx)(`span`,{children:s.length}):null]}),(0,q.jsx)(qe,{className:`max-w-xs`,children:(0,q.jsx)(`ul`,{className:`flex flex-col gap-1 text-left`,children:s.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(T,{impactBand:e.impactBand}),(0,q.jsx)(`span`,{children:ge(e)})]},e.id??`${e.type}-${t}`))})})]})})():null,a===`read`?(0,q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:`paired: see write half`}):null,o!=null&&l?(0,q.jsxs)(`div`,{className:`mb-1 flex shrink-0 items-center gap-1.5`,title:`Share of the plan's total stage wall time`,children:[(0,q.jsxs)(`span`,{className:g(`shrink-0 text-[10px] font-medium tabular-nums`,x[l]),children:[o,`%`]}),(0,q.jsx)(`div`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,q.jsx)(`div`,{"data-testid":`duration-heat-bar-fill`,className:g(`h-full rounded-full`,w[l]),style:{width:`${o>0?Math.max(o,4):0}%`}})}),(0,q.jsxs)(`span`,{className:`sr-only`,children:[`Duration share `,o,`%, `,l===`critical`?`high`:l===`warning`?`medium`:`low`]})]}):null,(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:c}),(0,q.jsx)(`span`,{className:`min-w-0 truncate font-medium`,title:t,children:t})]}),n?(0,q.jsx)(`p`,{className:`truncate text-muted-foreground`,title:n,children:n}):null,r?(0,q.jsx)(`p`,{className:`truncate text-muted-foreground`,title:r,children:r}):null]})}var Ze={read:`Read half. Consumes the shuffle written by its paired write half.`,write:`Write half. Produces the shuffle its paired read half consumes.`};function Qe({node:e,onClose:t,onJumpToPaired:n}){let r=J[e.category]??J.transform,i=e.findings??[],a=e.metrics??[],o=e.category.charAt(0).toUpperCase()+e.category.slice(1);return(0,q.jsxs)(`div`,{"data-testid":`plan-node-detail`,role:`dialog`,"aria-label":`Plan node detail: ${e.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:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:r}),(0,q.jsx)(`span`,{className:`break-words font-medium`,children:e.label})]}),(0,q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,"aria-label":`Close node detail`,onClick:t,children:(0,q.jsx)(U,{className:`size-4`})})]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[o,` · Segment `,e.segmentIndex+1,e.durationSharePct==null?null:(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsxs)(`span`,{className:`text-foreground`,children:[e.durationSharePct,`%`]}),` of plan stage time`]})]}),e.splitRole?(0,q.jsxs)(Y,{title:`Exchange`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:Ze[e.splitRole]}),e.exchangeShuffleBytes==null?e.label.startsWith(`Broadcast`)?(0,q.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Broadcast, no shuffle`}):null:(0,q.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`Shuffle written`,` `,(0,q.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:_(e.exchangeShuffleBytes)})]}),e.pairedNodeId&&n?(0,q.jsxs)(H,{type:`button`,variant:`outline`,size:`sm`,className:`mt-2 h-7 w-full justify-start gap-1.5`,onClick:()=>n(e.pairedNodeId),children:[(0,q.jsx)(Se,{className:`size-3.5`,"aria-hidden":`true`}),`Jump to `,e.splitRole===`read`?`write`:`read`,` half`]}):null]}):null,i.length>0?(0,q.jsx)(Y,{title:`Findings`,children:(0,q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:i.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex items-start gap-1.5`,children:[(0,q.jsx)(b,{type:e.type,impactBand:e.impactBand,docAnchor:e.docAnchor,className:`shrink-0`}),(0,q.jsx)(`span`,{className:`break-words`,children:ge(e)})]},e.id??`${e.type}-${t}`))})}):null,a.length>0?(0,q.jsx)(Y,{title:`Metrics`,children:(0,q.jsx)(`dl`,{className:`grid grid-cols-[1fr_auto] gap-x-3 gap-y-1`,children:a.map((e,t)=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`min-w-0 break-words text-muted-foreground`,children:e.name}),(0,q.jsx)(`dd`,{className:`text-right font-medium tabular-nums`,children:e.value})]},`${e.name}-${t}`))})}):null,e.detailText?(0,q.jsx)(Y,{title:`Plan detail`,children:(0,q.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:e.detailText})}):null]})}function Y({title:e,children:t}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:e}),t]})}var $e=[{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 et(){return(0,q.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:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:`Operators`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:$e.map(({category:e,label:t})=>(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:J[e]}),t]},e))})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:`Duration share`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:g(`h-1.5 w-6 rounded-full`,w.info)}),` low`]}),(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:g(`h-1.5 w-6 rounded-full`,w.warning)}),` medium`]}),(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:g(`h-1.5 w-6 rounded-full`,w.critical)}),` high`]})]})]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[(0,q.jsx)(`span`,{className:`text-foreground`,children:`Edge thickness`}),` = shuffle bytes moved across an exchange.`]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`A `,(0,q.jsx)(`span`,{className:`text-foreground`,children:`segment`}),` box groups one Exchange-bounded stage of the plan; a`,` `,(0,q.jsx)(`span`,{className:`text-foreground`,children:`stage`}),` box (full-plan view) wraps every segment of one Spark stage.`]})]})}function tt({...e}){return(0,q.jsx)(u,{"data-slot":`popover`,...e})}function nt({...e}){return(0,q.jsx)(a,{"data-slot":`popover-trigger`,...e})}function rt({align:e=`center`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=8,className:i,...a}){return(0,q.jsx)(s,{children:(0,q.jsx)(c,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,q.jsx)(l,{"data-slot":`popover-content`,className:g(`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`,i),...a})})})}function it({ariaLabel:e,name:t,options:n,value:r,onChange:i,trailingContent:a}){return(0,q.jsx)(We,{children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,role:`radiogroup`,"aria-label":e,children:[n.map(e=>(0,q.jsxs)(Ge,{children:[(0,q.jsxs)(Ke,{render:(0,q.jsx)(`label`,{className:`tap-target-comfortable flex min-h-8 items-center gap-1.5 px-1 text-sm`}),children:[(0,q.jsx)(`input`,{type:`radio`,name:t,value:e.value,checked:r===e.value,onChange:()=>i(e.value)}),e.label]}),(0,q.jsx)(qe,{children:e.description})]},e.value)),a]})})}var at=[{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 ot({mode:e,onChange:t,hiddenCount:n}){return(0,q.jsx)(it,{ariaLabel:`Node filter`,name:`plan-graph-filter`,options:at,value:e,onChange:t,trailingContent:n>0?(0,q.jsx)(C,{label:`${n} nodes hidden`,impactBand:`info`}):null})}var st=[{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 ct({mode:e,onChange:t}){return(0,q.jsx)(it,{ariaLabel:`Duration heat bar scope`,name:`plan-graph-duration-mode`,options:st,value:e,onChange:t})}function lt({filterMode:e,onFilterModeChange:t,hiddenCount:n,durationMode:r,onDurationModeChange:i,iconOnly:a=!1}){return(0,q.jsxs)(tt,{children:[(0,q.jsxs)(nt,{"aria-label":a?`Settings`:void 0,title:a?`Settings`:void 0,className:g(le({variant:`ghost`,size:a?`icon`:`sm`}),`tap-target-comfortable`,a?void 0:`gap-1.5`),children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),a?null:`Settings`]}),(0,q.jsxs)(rt,{align:a?`start`:`end`,side:a?`right`:`bottom`,"aria-label":`Plan graph settings`,className:`space-y-3`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Node filter`}),(0,q.jsx)(ot,{mode:e,onChange:t,hiddenCount:n})]}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-px bg-border`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Duration attribution`}),(0,q.jsx)(ct,{mode:r,onChange:i})]})]})]})}var X=e=>e.data;function ut({planNodes:e,problemNodes:t,filterMode:n,onFilterModeChange:r,hiddenCount:i,durationMode:a,onDurationModeChange:o,legendOpen:s,onToggleLegend:c,miniMapOpen:l,onToggleMiniMap:u}){let{zoomIn:d,zoomOut:f,fitView:p,setCenter:m}=z(),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(null),y=[...e].filter(e=>X(e).durationSharePct!=null).sort((e,t)=>(X(t).durationSharePct??0)-(X(e).durationSharePct??0)),b=e=>{e&&m(e.position.x,e.position.y,{zoom:1,duration:300})},x=(e,t,n)=>{if(e.length===0)return;let r=e[((t?e.findIndex(e=>e.id===t):-1)+1)%e.length];b(r),n(r.id)};return(0,q.jsxs)(`div`,{className:`flex w-12 shrink-0 flex-col items-center gap-1 border-r border-border bg-card/60 py-2`,children:[(0,q.jsxs)(dt,{children:[(0,q.jsx)(Z,{label:`Zoom in`,onClick:()=>d({duration:200}),children:(0,q.jsx)(Pe,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:`Zoom out`,onClick:()=>f({duration:200}),children:(0,q.jsx)(Ie,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:`Fit to view`,onClick:()=>p({duration:200}),children:(0,q.jsx)(Oe,{"aria-hidden":`true`})})]}),(0,q.jsx)(ft,{}),(0,q.jsxs)(dt,{children:[(0,q.jsx)(Z,{label:`Next worst duration`,disabled:y.length===0,onClick:()=>x(y,h,g),children:(0,q.jsx)(Me,{"aria-hidden":`true`})}),t.length>0?(0,q.jsx)(Z,{label:`Next problem`,onClick:()=>x(t,_,v),children:(0,q.jsx)(we,{"aria-hidden":`true`})}):null]}),(0,q.jsx)(ft,{}),(0,q.jsxs)(dt,{children:[(0,q.jsx)(lt,{iconOnly:!0,filterMode:n,onFilterModeChange:r,hiddenCount:i,durationMode:a,onDurationModeChange:o}),(0,q.jsx)(Z,{label:s?`Hide legend`:`Legend`,pressed:s,onClick:c,children:(0,q.jsx)(ye,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:l?`Hide minimap`:`Show minimap`,pressed:l,onClick:u,children:(0,q.jsx)(Ee,{"aria-hidden":`true`})})]})]})}function dt({children:e}){return(0,q.jsx)(`div`,{className:`flex flex-col items-center gap-1`,children:e})}function ft(){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`my-0.5 h-px w-6 bg-border`})}function Z({label:e,onClick:t,disabled:n,pressed:r,children:i}){return(0,q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,className:g(`tap-target-comfortable`,r&&`bg-primary/15 text-primary hover:bg-primary/20 hover:text-primary`),"aria-label":e,title:e,"aria-pressed":r,disabled:n,onClick:t,children:i})}function pt(e){if(e.type!==`planNode`)return`var(--muted)`;let t=e.data.findings??[],n=E(t);return n?B[n]:`var(--plan-aggregate)`}function mt({finding:e,className:t}){let n=m(e);return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,q.jsx)(b,{type:e.type,impactBand:e.impactBand,docAnchor:e.docAnchor,className:t}),n?(0,q.jsx)(`span`,{className:`font-mono text-[10px] leading-none whitespace-nowrap text-muted-foreground`,children:n}):null]})}function ht({data:e}){let{width:t,height:n,stageId:r,durationLabel:i,findings:a}=e;return(0,q.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-dashed border-border/70 bg-muted/10 nopan nodrag`,style:{width:t,height:n,pointerEvents:`all`},children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1 text-xs text-muted-foreground`,children:[(0,q.jsx)(`span`,{title:r==null?`This plan segment couldn't be matched to a specific Spark stage`:void 0,children:r==null?`Stage —`:`Stage ${r}`}),(0,q.jsx)(C,{label:i??`—`,impactBand:`info`,title:`Approximate share of this stage's wall time`}),a.length>0?(0,q.jsx)(`div`,{className:`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1`,children:a.map((e,t)=>(0,q.jsx)(mt,{finding:e,className:`h-4 gap-1 px-1.5 text-xs`},e.id??`${e.type}-${t}`))}):null]})})}function gt({data:e}){let{width:t,height:n,stageId:r,findings:i,showOwnFindings:a=!0,onSelect:o}=e;return(0,q.jsxs)(`div`,{className:`relative rounded-xl border border-primary/25 bg-primary/5 nopan nodrag`,style:{width:t,height:n,pointerEvents:`all`},children:[(0,q.jsx)(`button`,{type:`button`,"aria-label":`Focus stage ${r}`,onClick:o,style:{pointerEvents:`auto`},className:`absolute inset-0 size-full cursor-pointer rounded-xl transition-colors hover:border-primary/50 hover:bg-primary/10`}),a&&i.length>0?(0,q.jsx)(`div`,{className:`absolute left-2 right-2 top-1 flex flex-wrap gap-1`,children:i.map((e,t)=>(0,q.jsx)(mt,{finding:e,className:`h-4 gap-1 px-1.5 text-xs`},e.id??`${e.type}-${t}`))}):null,(0,q.jsxs)(`span`,{className:`absolute right-2 bottom-1 text-xs font-medium text-primary`,children:[`Stage `,r]})]})}var _t=1.5,vt=.55;function yt(e,t){return!(e>0)||!(t>0)?0:Math.min(1,Math.log(e+1)/Math.log(t+1))}function bt(e,t){return _t+7.5*yt(e,t)}function xt(e,t){return vt+.44999999999999996*yt(e,t)}function St({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a,markerEnd:o,data:s}){let[c,l,u]=A({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a}),{shuffleBytes:d=0,maxShuffleBytes:f=0}=s??{},p=bt(d,f),m=xt(d,f),h=d>0&&d<1e3?`<1 KB`:_(d);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(I,{path:c,markerEnd:o,style:{stroke:`var(--text-muted)`,strokeWidth:p,strokeOpacity:m}}),(0,q.jsx)(j,{children:(0,q.jsxs)(Ge,{children:[(0,q.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(${l}px, ${u}px)`},children:h}),(0,q.jsx)(qe,{className:`max-w-xs`,children:(0,q.jsxs)(`p`,{children:[h,` of shuffle written across this exchange. Edge thickness scales with the volume moved.`]})})]})})]})}var Ct={planNode:Xe,segmentGroup:ht,stageGroup:gt},wt={exchange:St},Tt=1,Et=2,Dt=3,Ot=e=>e.data,Q={padding:.06,maxZoom:1.75};function kt({resizeTick:e,fitSignal:t,centerRequest:n}){let{fitView:r,setCenter:i,getNode:a}=z();return(0,K.useEffect)(()=>{if(!n||n.token===0||!n.nodeId)return;let e=a(n.nodeId);e?i(e.position.x,e.position.y,{zoom:1,duration:300}):r({nodes:[{id:n.nodeId}],duration:300,maxZoom:1})},[n,i,a,r]),(0,K.useEffect)(()=>{let e=()=>r({duration:200,...Q});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[r]),(0,K.useEffect)(()=>{e!==0&&r({duration:200,...Q})},[e,r]),(0,K.useEffect)(()=>{t!==0&&r({duration:300,...Q})},[t,r]),null}function At(){let e=(0,K.useRef)(null),[t,n]=(0,K.useState)(0);return(0,K.useEffect)(()=>{let t=e.current;if(!t)return;let r=!0,i=new ResizeObserver(()=>{if(r){r=!1;return}n(e=>e+1)});return i.observe(t),()=>i.disconnect()},[]),{ref:e,tick:t}}function jt(e,t){return e.filter(e=>e.stageId===t||ae(e)?.includes(t))}function Mt({model:e,showMiniMap:t,findings:n=[],stageId:r,segmentStageIds:i,visibleNodeIds:a,visibleEdges:o,onSelectStage:s,selectedNodeId:c=null,onSelectNode:l,onJumpToPaired:u,centerRequest:d,fitSignal:f=0,filterMode:p=`basic`,onFilterModeChange:m=()=>{},hiddenCount:h=0,durationMode:g=`exclusive`,onDurationModeChange:_=()=>{}}){let{flowNodes:y,flowEdges:b}=(0,K.useMemo)(()=>{let t=e.nodes.reduce((e,t)=>e+(t.exclusiveDurationShare??t.durationShare??0),0),c=e=>`segment-${e.segmentIndex}`,l=e.scope===`full`,u=e=>{let t=i?.get(e.segmentIndex);return t==null?null:`stage-${t}`},d=a?Ve(e.nodes.filter(e=>a.has(e.id)),o??e.edges,{groupOf:c}):Ve(e.nodes,e.edges,{groupOf:c}),f=new Set(d.map(c)),p=l?new Set(d.map(u).filter(e=>e!=null)):null,m=e.nodes.some(e=>!f.has(c(e)))||p!=null&&e.nodes.some(e=>{let t=u(e);return t!=null&&!p.has(t)})?Ve(e.nodes,e.edges,{groupOf:c}):d,h=d.map(e=>{let n=e.durationShare!=null&&t>0?Math.round(e.durationShare/t*100):null,r=e.splitRole===`read`?`${e.label}, paired: see write half`:[e.label,e.operatorDetail,e.primaryMetric,n==null?null:`${n}% of the plan's total stage duration`].filter(Boolean).join(`, `);return{id:e.id,type:`planNode`,position:e.position,draggable:!1,zIndex:Dt,measured:{width:220,height:90},ariaLabel:r,ariaRole:`button`,data:{...e,durationSharePct:n}}}),g=Ue(c,[d,m]).map(t=>{let r=Number(t.id.replace(`segment-`,``)),a=e.nodes.filter(e=>c(e)===t.id),o=a.reduce((e,t)=>e+(t.exclusiveDurationShare??t.durationShare??0),0),s=a.some(e=>e.durationShare!=null),l=i?.get(r)??null,u=l==null?[]:jt(n,l);return{id:t.id,type:`segmentGroup`,position:t.position,draggable:!1,selectable:!1,focusable:!1,zIndex:Et,style:{width:t.width,height:t.height},measured:{width:t.width,height:t.height},data:{width:t.width,height:t.height,stageId:l,durationLabel:s?v(o):null,findings:u}}}),_=new Set(g.map(e=>e.data.stageId).filter(e=>e!=null)),y=l?(()=>{let e={paddingX:32,paddingY:64,headerHeight:0},t=Ue(u,[d,m],e),i=`stage-${r}`;if(jt(n,r).length>0&&!t.some(e=>e.id===i)){let[n]=Ue(()=>i,[d,m],e);n&&t.push(n)}return t.map(e=>{let t=Number(e.id.replace(`stage-`,``));return{id:e.id,type:`stageGroup`,position:e.position,draggable:!1,selectable:!1,focusable:!1,zIndex:Tt,style:{width:e.width,height:e.height},measured:{width:e.width,height:e.height},data:{width:e.width,height:e.height,stageId:t,findings:jt(n,t),showOwnFindings:!_.has(t),onSelect:()=>s?.(t)}}})})():[],b=o??e.edges,x=b.reduce((e,t)=>Math.max(e,t.shuffleBytes??0),0),S=b.map(e=>e.shuffleBytes?{id:e.id,source:e.source,target:e.target,type:`exchange`,data:{shuffleBytes:e.shuffleBytes,maxShuffleBytes:x}}:{id:e.id,source:e.source,target:e.target});return{flowNodes:[...y,...g,...h],flowEdges:S}},[e,n,r,i,a,o,s]),{ref:x,tick:S}=At(),[C,w]=(0,K.useState)(!0),[T,E]=(0,K.useState)(!0),D=c?y.find(e=>e.id===c&&e.type===`planNode`):void 0,O=y.filter(e=>e.type===`planNode`),k=y.filter(e=>e.type===`stageGroup`&&(e.data.findings?.length??0)>0).sort(be(e=>e.data.findings??[])),A=a!=null&&a.size===0&&e.nodes.length>0;return(0,q.jsx)(ee,{children:(0,q.jsx)(We,{children:(0,q.jsxs)(`div`,{ref:x,className:`flex min-h-0 flex-1`,children:[(0,q.jsx)(ut,{planNodes:O,problemNodes:k,filterMode:p,onFilterModeChange:m,hiddenCount:h,durationMode:g,onDurationModeChange:_,legendOpen:C,onToggleLegend:()=>w(e=>!e),miniMapOpen:t&&T,onToggleMiniMap:()=>E(e=>!e)}),(0,q.jsx)(`div`,{className:`relative min-w-0 flex-1`,onKeyDown:e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target.closest(`.react-flow__node-planNode`)?.getAttribute(`data-id`);t&&(e.preventDefault(),l?.(t))},children:(0,q.jsxs)(M,{nodes:y,edges:b,nodeTypes:Ct,edgeTypes:wt,"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:Q,minZoom:.05,edgesFocusable:!1,onNodeClick:(e,t)=>{t.type===`planNode`&&l?.(t.id)},onPaneClick:()=>l?.(null),children:[(0,q.jsx)(N,{}),(0,q.jsx)(kt,{resizeTick:S,fitSignal:f,centerRequest:d}),A?(0,q.jsx)(L,{position:`top-center`,children:(0,q.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 `,e.nodes.length,` operators are hidden by the node filter. Change it in Settings to show them.`]})}):null,C?(0,q.jsx)(L,{position:`bottom-left`,children:(0,q.jsx)(et,{})}):null,t&&T?(0,q.jsx)(P,{nodeColor:pt,pannable:!0,zoomable:!0,ariaLabel:`Plan overview. Drag to pan and scroll to zoom the graph.`}):null]})}),D?(0,q.jsx)(Qe,{node:Ot(D),onClose:()=>l?.(null),onJumpToPaired:u}):null]})})})}function Nt({open:e,nodeCount:t,onConfirm:n,onCancel:r}){return(0,q.jsx)(ie,{open:e,onOpenChange:e=>{e||r()},children:(0,q.jsxs)(oe,{children:[(0,q.jsx)(ce,{children:(0,q.jsx)(V,{children:`Expand to full plan?`})}),(0,q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This plan has `,t,` nodes. Rendering the full graph may take several seconds.`]}),(0,q.jsxs)(ne,{children:[(0,q.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Cancel`}),(0,q.jsx)(H,{type:`button`,size:`sm`,onClick:n,children:`Expand anyway`})]})]})})}var Pt={io:[`scan`,`exchange`],basic:[`scan`,`exchange`,`join`,`aggregate`,`sort`,`filter`],advanced:null},Ft=300;function It(e,t){let n=new Map;for(let t of e){let e=n.get(t.source);e?e.push(t.target):n.set(t.source,[t.target])}let r=new Map;function i(e){let a=r.get(e);if(a)return a;let o=new Set;r.set(e,o);for(let r of n.get(e)??[])if(t.has(r))o.add(r);else for(let e of i(r))o.add(e);return o}let a=new Map;for(let t of e)t.shuffleBytes&&a.set(`${t.source}->${t.target}`,t.shuffleBytes);let o=[];for(let e of t)for(let t of i(e)){let n={id:`${e}=>${t}`,source:e,target:t},r=a.get(`${e}->${t}`);r&&(n.shuffleBytes=r),o.push(n)}return o}function Lt(e,t){try{return Re(e,t)}catch{return null}}var Rt=new Map;function zt(e,t,n,r){return`${e??`none`}::${t}::${n}::${r}`}function Bt(){Rt.clear()}var Vt=D.getState().modelResetCount;D.subscribe(e=>{e.modelResetCount!==Vt&&(Vt=e.modelResetCount,Bt())});function $(e,t,n){let r=zt(n,t.stageId,t.scope,t.durationMode),i=Rt.get(r);if(i)return i;let a=Lt(e,t);return a&&Rt.set(r,a),a}function Ht({stageId:e,appModel:t,findings:n,activeFileId:r,onClose:i,initialScope:a}){let{resetToDropZone:o}=ue(),{recentEntries:s,onPickRecent:c,onRemoveRecent:l}=se(r),[u,d]=(0,K.useState)(`basic`),[f,p]=(0,K.useState)(`exclusive`),[m,g]=(0,K.useState)(a??`segment`),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(a!==`full`),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(e),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(0),[ee,k]=(0,K.useState)({nodeId:null,token:0}),[A,j]=(0,K.useState)(null),M=e=>k(t=>({nodeId:e,token:t.token+1}));(0,K.useEffect)(()=>{E(null)},[C,m,u]);let N=te(C,t),P=N?$(N,{scope:`segment`,stageId:C,appModel:t,findings:n,durationMode:f},r):null,F=P!=null&&P.scope===`full`&&m===`segment`&&P.nodes.length>Ft,I=F&&!x;(0,K.useEffect)(()=>{I&&v(!0)},[I]);let L=N&&(m===`full`||_)?$(N,{scope:`full`,stageId:C,appModel:t,findings:n,durationMode:f},r):null,R=!y&&m===`full`&&L!=null&&L.nodes.length>Ft,z=_||R;(0,K.useEffect)(()=>{let e=e=>{e.key!==`Escape`||z||(T?E(null):i())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,z,T]);let B=F||R?null:m===`full`?L:P;(0,K.useEffect)(()=>{A&&m===`full`&&B?.nodes.some(e=>e.id===A)&&(E(A),M(A),j(null))},[A,m,B]);function V(){let e=N?$(N,{scope:`full`,stageId:C,appModel:t,findings:n,durationMode:f},r):null;e&&e.nodes.length>Ft?v(!0):(g(`full`),O(e=>e+1))}function ne(){g(`segment`),O(e=>e+1)}function ie(e){if(B?.nodes.some(t=>t.id===e)){E(e),M(e);return}j(e),V()}let ae=(0,K.useCallback)(e=>{w(e),g(`segment`),b(!0),S(!1),j(null),O(e=>e+1)},[]);function oe(){b(!0),g(`full`),v(!1),O(e=>e+1)}function ce(){v(!1),j(null),R&&(b(!0),g(`segment`),P?.scope===`full`&&S(!0)),I&&S(!0)}function le(e){return i(),c(e)}let{visibleNodeIds:de,filteredEdges:fe,hiddenNodes:pe}=(0,K.useMemo)(()=>{let e=Pt[u],t=new Set;if(B)for(let n of B.nodes)(!e||e.includes(n.category))&&t.add(n.id);return{visibleNodeIds:t,filteredEdges:B?It(B.edges,t):[],hiddenNodes:B?B.nodes.filter(e=>!t.has(e.id)):[]}},[B,u]),U=B?.scope===`full`,me=m===`full`,W=(0,K.useId)(),G=U&&!me;return(0,q.jsxs)(`div`,{"data-testid":`dashboard`,className:`flex h-screen flex-col`,style:{paddingRight:`var(--docs-inset, 0px)`},children:[(0,q.jsx)(re,{onLoadNew:o,recentEntries:s,activeFileId:r,onPickRecent:le,onRemoveRecent:l,leadingContent:(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsxs)(`h1`,{className:`truncate font-heading text-sm font-semibold`,children:[`Plan graph: Stage `,C]}),B&&B.scope===`segment`?(0,q.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`Segment `,B.segmentIndex+1,` of `,B.segmentCount]}):null,(0,q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:(0,q.jsx)(h,{anchor:`#bottleneck-duplicate-plan-subtree`,children:`Plan Advisor docs`})})]}),sectionControls:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex flex-col items-end gap-0.5`,children:[(0,q.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,disabled:G,"aria-describedby":G?W:void 0,onClick:U?ne:V,children:U?`Back to segment view`:`Expand to full plan`}),G?(0,q.jsx)(`p`,{id:W,className:`text-xs text-muted-foreground`,children:`This stage's plan couldn't be scoped to a single segment`}):null]}),(0,q.jsx)(H,{variant:`ghost`,size:`sm`,onClick:i,children:`Close`})]})}),(0,q.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:R?null:!N||!B?(0,q.jsx)(`p`,{role:`alert`,className:`p-6 text-sm text-destructive`,children:F?`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.`}):(0,q.jsx)(Mt,{model:B,visibleNodeIds:de,visibleEdges:fe,showMiniMap:!0,findings:n,stageId:C,segmentStageIds:B.segmentStageIds,onSelectStage:ae,selectedNodeId:T,onSelectNode:E,onJumpToPaired:ie,centerRequest:ee,fitSignal:D,filterMode:u,onFilterModeChange:d,hiddenCount:pe.length,durationMode:f,onDurationModeChange:p})}),(0,q.jsx)(Nt,{open:z,nodeCount:L?.nodes.length??0,onConfirm:oe,onCancel:ce})]})}export{Ht as PlanGraphRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,Z as r,d as i,it as a,p as o,u as s,ut as c}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,Z as r,d as i,it as a,p as o,u as s,ut as c}from"./DisclosureContext-B0siMVdg.js";import{p as l}from"./plan-graph-vendor-BYl-AzN5.js";import{m as u}from"./useRecentFiles-C3Ov47U7.js";import{C as d,O as f}from"./index-DCeWge12.js";import{i as p,o as m,r as h,s as g,t as _}from"./Dashboard-BgKodJl2.js";import{r as v}from"./impact-sort-BTQndbof.js";import{n as y}from"./finding-anchor-Cys8Z6Yn.js";import{t as b}from"./usePagedRows-BxvdFnPk.js";import{n as x,t as S}from"./useSortMode-B8SRfAoG.js";var C=e(t(),1),w=l();function T(e){return e.stageId!=null}function E(e){return(e.extended??``).replace(/, wasting \d+s of executor time\./,`.`)}function D({finding:e}){let t=y([e]);return(0,w.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`flex flex-col gap-1 transition-colors ${t.flashClassName}`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(p,{stageId:e.stageId}),(0,w.jsx)(s,{impactBand:e.impactBand})]}),(0,w.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Wasted `,(0,w.jsx)(`strong`,{children:r(a(e))}),` of executor time.`,e.extended?(0,w.jsxs)(o,{children:[` `,E(e)]}):null]}),(0,w.jsx)(_,{finding:e})]})}function O({appModel:e,catalog:t,defaultCollapsed:o=!0}){let[s,l]=(0,C.useState)(0),{sortMode:p,setSortMode:_,orderBy:y}=S(),[E,O]=(0,C.useState)(!o),k=f(),A=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!A.current){A.current=!0;return}l(0)},[e]);let j=u(t,`retryWaste`).filter(T),M=[...j].sort((e,t)=>n[e.impactBand]-n[t.impactBand]||(typeof t.value==`number`?t.value:0)-(typeof e.value==`number`?e.value:0)),N=y(M,e=>[e],e=>e.stageId),P=k?N.findIndex(e=>e===k.finding):null,{totalPages:F,effectivePage:I,visible:L}=b(N,s,l,P);return j.length===0?null:(0,w.jsxs)(d,{title:`Retry Waste`,fixFor:j,impactBand:c(j),badges:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(i,{type:`retryWaste`,impactBand:c(j)}),v(j,j.length,E)?(0,w.jsx)(x,{mode:p,onChange:e=>{_(e),l(0)}}):null]}),open:E,onOpenChange:O,summary:(0,w.jsx)(m,{value:r(a(M[0])),context:g(j.length)}),children:[(0,w.jsx)(`ul`,{className:`space-y-3`,children:L.map(e=>(0,w.jsx)(D,{finding:e},e.id))}),(0,w.jsx)(h,{page:I,totalPages:F,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1)})]})}export{O as RetryWaste};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,Y as r,bt as i,d as a,it as o,st as s,ut as c}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,Y as r,bt as i,d as a,it as o,st as s,ut as c}from"./DisclosureContext-B0siMVdg.js";import{p as l}from"./plan-graph-vendor-BYl-AzN5.js";import{i as u}from"./useRecentFiles-C3Ov47U7.js";import{C as d,O as f}from"./index-DCeWge12.js";import{a as p,o as m,r as h,s as g,t as _}from"./Dashboard-BgKodJl2.js";import{r as v}from"./impact-sort-BTQndbof.js";import{n as y,t as b}from"./finding-anchor-Cys8Z6Yn.js";import{t as x}from"./usePagedRows-BxvdFnPk.js";import{n as S,t as C}from"./useSortMode-B8SRfAoG.js";import{t as w}from"./StageHeader-pI1nTwVf.js";import{a as T,i as E,n as D,r as O,t as k}from"./select-DIYN6D3y.js";import{t as A}from"./PlanExplorer-DcxmiQWL.js";import{t as j}from"./PartitionHint-CUvbnnxy.js";var M=e(t(),1),N=l();function P({entry:e,appModel:t}){let n=i(),a=y([e.shuffle]),c=t.stages.get(e.stageId),l=c?s(c):null,d=n===`advanced`&&u(e.stageId,t);return(0,N.jsxs)(`div`,{ref:a.ref,tabIndex:a.tabIndex,"data-flashed":a.dataFlashed,className:`space-y-2 ${b} transition-colors ${a.flashClassName}`,children:[(0,N.jsx)(w,{stageId:e.stageId,appModel:t}),(0,N.jsxs)(`p`,{className:`text-sm`,children:[`Shuffle read: `,(0,N.jsx)(`strong`,{children:r(o(e.shuffle))}),` · `,`Write: `,r(c?.shuffleWriteBytes??0)]}),(0,N.jsx)(_,{finding:e.shuffle}),l||d?(0,N.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[l?(0,N.jsx)(j,{hint:l}):null,d?(0,N.jsx)(A,{stageId:e.stageId,appModel:t}):null]}):null]})}var F=(0,M.memo)(function({appModel:e,catalog:t,defaultCollapsed:i=!0}){let[s,l]=(0,M.useState)(0),[u,_]=(0,M.useState)(!i),{sortMode:y,setSortMode:b,orderBy:w}=C(),A=f(),{shuffleFindings:j,sorted:F,orderedEntries:I}=(0,M.useMemo)(()=>{let e=t.filter(e=>e.type===`shuffle`),r=[...e.filter(e=>e.stageId!=null).map(e=>({stageId:e.stageId,shuffle:e,impactBand:e.impactBand,peak:o(e)}))].sort((e,t)=>n[e.impactBand]-n[t.impactBand]||t.peak-e.peak);return{shuffleFindings:e,sorted:r,orderedEntries:w(r,e=>[e.shuffle],e=>e.stageId)}},[t,y]),L=A?I.findIndex(e=>e.shuffle===A.finding):null,{totalPages:R,effectivePage:z,visible:B}=x(I,s,l,L);if(j.length===0){let t=0;for(let n of e.stages.values())t=Math.max(t,n.shuffleReadBytes??0);return(0,N.jsx)(d,{title:`Shuffle I/O`,open:u,onOpenChange:_,summary:(0,N.jsx)(m,{value:r(t),context:`no issue detected: peak shuffle read`}),children:(0,N.jsx)(`div`,{className:`flex flex-col gap-1`,children:(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No shuffle read/write issues detected.`})})})}let V=c(j),H=I.map(e=>({id:e.stageId})),U=v(j,F.length,u);return(0,N.jsx)(d,{title:`Shuffle I/O`,impactBand:V,fixFor:j,open:u,onOpenChange:_,summary:(0,N.jsx)(m,{value:r(F[0].peak),context:`Peak shuffle read · ${g(F.length)}`}),badges:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(a,{type:`shuffle`,impactBand:V??`info`}),U?(0,N.jsx)(S,{mode:y,onChange:e=>{b(e),l(0)}}):null]}),children:(0,N.jsxs)(`div`,{className:`space-y-4`,children:[(0,N.jsx)(p,{pills:H}),B.map(t=>(0,N.jsx)(P,{entry:t,appModel:e},t.stageId)),(0,N.jsx)(h,{page:z,totalPages:R,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1),renderJumpControl:()=>(0,N.jsxs)(k,{value:String(z*6),onValueChange:e=>l(Math.floor(Number(e)/6)),children:[(0,N.jsx)(E,{size:`sm`,"aria-label":`Jump to stage`,children:(0,N.jsx)(T,{placeholder:`Jump to stage`})}),(0,N.jsx)(D,{children:I.map((e,t)=>(0,N.jsxs)(O,{value:String(t),children:[`Stage `,e.stageId,` (`,r(e.peak),`)`]},e.stageId))})]})})]})})});export{F as ShuffleIO};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,it as r}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,it as r}from"./DisclosureContext-B0siMVdg.js";import{p as i}from"./plan-graph-vendor-BYl-AzN5.js";import{t as a}from"./StageFindingGroup-D9naK109.js";var o=e(t(),1),s=i();function c(e){return`${e.metric}: ${n(`ratio`,r(e))}`}var l=(0,o.memo)(function(e){return(0,s.jsx)(a,{...e,type:`skew`,title:`Task Skew`,idPrefix:`skew`,findingLabel:c})});export{l as Skew};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,U as r,d as i,it as a,u as o,z as s}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,U as r,d as i,it as a,u as o,z as s}from"./DisclosureContext-B0siMVdg.js";import{p as c}from"./plan-graph-vendor-BYl-AzN5.js";import{m as l}from"./useRecentFiles-C3Ov47U7.js";import{C as u,O as d}from"./index-DCeWge12.js";import{o as f,r as p,s as m,t as h}from"./Dashboard-BgKodJl2.js";import{r as g}from"./impact-sort-BTQndbof.js";import{n as _}from"./finding-anchor-Cys8Z6Yn.js";import{t as v}from"./usePagedRows-BxvdFnPk.js";import{n as y,t as b}from"./useSortMode-B8SRfAoG.js";import{t as x}from"./StageHeader-pI1nTwVf.js";var S=e(t(),1),C=c();function w(e){let t=a(e);if(e.metric===`execMaxMedianRatio`)return`Executor ${e.executorId}: ${n(`ratio`,t)} the median ${e.dimension?s[e.dimension]:`value`}`;let r=Math.round((e.hostTaskShare??0)*100);return e.metric===`hostDurationShare`?`${e.host}: ${n(`pctFraction`,t)} of this stage's task time (${n(`pct`,r)} of tasks)`:`${e.host}: ${n(`ratio`,t)} median task time (${n(`pct`,r)} of tasks)`}function T({finding:e,appModel:t}){let n=_([e]);return(0,C.jsxs)(`li`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-1 text-sm transition-colors ${n.flashClassName}`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,C.jsx)(o,{impactBand:e.impactBand}),e.stageId==null?null:(0,C.jsx)(x,{stageId:e.stageId,appModel:t})]}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:w(e)}),(0,C.jsx)(h,{finding:e})]})}var E=(0,S.memo)(function({appModel:e,catalog:t,defaultCollapsed:n=!0}){let{sortMode:a,setSortMode:o,orderBy:s}=b(),[c,h]=(0,S.useState)(!n),[_,x]=(0,S.useState)(0),E=l(t,`slowHost`).slice().sort((e,t)=>r[e.impactBand]-r[t.impactBand]),D=s(E,e=>[e],e=>e.stageId??null),O=d(),k=O?D.findIndex(e=>e===O.finding):null,{totalPages:A,effectivePage:j,visible:M}=v(D,_,x,k);return E.length===0?null:(0,C.jsxs)(u,{title:`Slow Executor Host`,impactBand:E[0].impactBand,fixFor:E,badges:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(i,{type:`slowHost`,impactBand:E[0].impactBand}),g(E,E.length,c)?(0,C.jsx)(y,{mode:a,onChange:o}):null]}),open:c,onOpenChange:h,summary:(0,C.jsx)(f,{value:w(E[0]),context:m(E.length)}),children:[(0,C.jsx)(`ul`,{className:`space-y-2`,children:M.map(t=>(0,C.jsx)(T,{finding:t,appModel:e},t.id))}),(0,C.jsx)(p,{page:j,totalPages:A,onPrev:()=>x(e=>e-1),onNext:()=>x(e=>e+1)})]})});export{E as SlowHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,p as i,ut as a}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,p as i,ut as a}from"./DisclosureContext-B0siMVdg.js";import{p as o}from"./plan-graph-vendor-BYl-AzN5.js";import{h as s,m as c}from"./useRecentFiles-C3Ov47U7.js";import{C as l,O as u,S as d,l as f}from"./index-DCeWge12.js";import{a as p,o as m,r as h,s as g,t as _}from"./Dashboard-BgKodJl2.js";import{i as v,r as y}from"./impact-sort-BTQndbof.js";import{n as b,t as x}from"./finding-anchor-Cys8Z6Yn.js";import{t as S}from"./usePagedRows-BxvdFnPk.js";import{n as C,t as w}from"./useSortMode-B8SRfAoG.js";var T=e(t(),1),E=o();function D({finding:e}){let t=b([e]);return(0,E.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-2 ${x} transition-colors ${t.flashClassName}`,children:[e.stageIds.length>0?(0,E.jsx)(p,{pills:e.stageIds.map(e=>({id:e}))}):null,(0,E.jsxs)(`p`,{children:[f(e.recommendation??``).measured??e.recommendation,` `,(0,E.jsx)(_,{finding:e})]})]})}var O=(0,T.memo)(function({catalog:e,defaultCollapsed:t=!0}){let{sortMode:o,setSortMode:f,orderBy:p}=w(),[_,b]=(0,T.useState)(!t),[x,O]=(0,T.useState)(0),{findings:k,pills:A}=(0,T.useMemo)(()=>{let t=c(e,`smallFiles`).sort((e,t)=>n[e.impactBand]-n[t.impactBand]);return{findings:t,pills:[...new Set(t.flatMap(e=>e.stageIds))].map(e=>({id:e}))}},[e,o]),j=p(k,e=>[e],v),M=u(),N=M?j.findIndex(e=>e===M.finding):null,{totalPages:P,effectivePage:F,visible:I}=S(j,x,O,N);return k.length===0?null:(0,E.jsxs)(l,{title:`Excessive Small Files`,fixFor:k,impactBand:a(k),open:_,onOpenChange:b,badges:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(r,{type:`smallFiles`,impactBand:a(k)??`info`,className:d}),y(k,k.length,_)?(0,E.jsx)(C,{mode:o,onChange:f}):null]}),statusBadge:(0,E.jsx)(i,{children:(0,E.jsx)(s,{confidence:k[0].confidence,validationRequired:k[0].validationRequired,evidenceKey:`sqlPlan`})}),summary:(0,E.jsx)(m,{value:`${A.length} stage${A.length===1?``:`s`}`,context:g(k.length)}),children:[(0,E.jsx)(`ul`,{className:`space-y-3 text-sm`,children:I.map(e=>(0,E.jsx)(D,{finding:e},e.id))}),(0,E.jsx)(h,{page:F,totalPages:P,onPrev:()=>O(e=>e-1),onNext:()=>O(e=>e+1)})]})});export{O as SmallFiles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,Z as r,d as i,it as a,u as o}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,Z as r,d as i,it as a,u as o}from"./DisclosureContext-B0siMVdg.js";import{p as s}from"./plan-graph-vendor-BYl-AzN5.js";import{C as c,O as l}from"./index-DCeWge12.js";import{o as u,r as d,s as f,t as p}from"./Dashboard-BgKodJl2.js";import{r as m}from"./impact-sort-BTQndbof.js";import{n as h}from"./finding-anchor-Cys8Z6Yn.js";import{t as g}from"./usePagedRows-BxvdFnPk.js";import{n as _,t as v}from"./useSortMode-B8SRfAoG.js";import{t as y}from"./StageHeader-pI1nTwVf.js";var b=e(t(),1),x=s();function S(e){return r(a(e))}function C({finding:e,appModel:t}){let n=h([e]);return(0,x.jsxs)(`li`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-1 text-sm transition-colors ${n.flashClassName}`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(o,{impactBand:e.impactBand}),e.stageId==null?null:(0,x.jsx)(y,{stageId:e.stageId,appModel:t}),(0,x.jsx)(`strong`,{children:S(e)})]}),(0,x.jsx)(p,{finding:e})]})}var w=(0,b.memo)(function({appModel:e,catalog:t,defaultCollapsed:r=!0}){let{sortMode:a,setSortMode:o,orderBy:s}=v(),[p,h]=(0,b.useState)(!r),[y,w]=(0,b.useState)(0),T=t.filter(e=>e.type===`speculationWaste`).slice().sort((e,t)=>n[e.impactBand]-n[t.impactBand]),E=s(T,e=>[e],e=>e.stageId??null),D=l(),O=D?E.findIndex(e=>e===D.finding):null,{totalPages:k,effectivePage:A,visible:j}=g(E,y,w,O);return T.length===0?null:(0,x.jsxs)(c,{title:`Speculation Waste`,fixFor:T,impactBand:T[0].impactBand,badges:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i,{type:`speculationWaste`,impactBand:T[0].impactBand}),m(T,T.length,p)?(0,x.jsx)(_,{mode:a,onChange:o}):null]}),open:p,onOpenChange:h,summary:(0,x.jsx)(u,{value:S(T[0]),context:f(T.length)}),children:[(0,x.jsx)(`ul`,{className:`space-y-2`,children:j.map(t=>(0,x.jsx)(C,{finding:t,appModel:e},t.id))}),(0,x.jsx)(d,{page:A,totalPages:k,onPrev:()=>w(e=>e-1),onNext:()=>w(e=>e+1)})]})});export{w as SpeculationWaste};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,_ as n,c as r,d as i,f as a,l as o,o as s,r as c,s as l,t as u,v as d}from"./charts-vendor-0VMaLVLN.js";import{G as f,K as p,S as m,U as h,Y as g,bt as _,d as v,it as y,o as b,p as x,st as S,u as C}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,_ as n,c as r,d as i,f as a,l as o,o as s,r as c,s as l,t as u,v as d}from"./charts-vendor-0VMaLVLN.js";import{G as f,K as p,S as m,U as h,Y as g,bt as _,d as v,it as y,o as b,p as x,st as S,u as C}from"./DisclosureContext-B0siMVdg.js";import{p as w}from"./plan-graph-vendor-BYl-AzN5.js";import{F as T,M as ee,N as E,P as D,_ as O,b as k,h as A,i as j}from"./useRecentFiles-C3Ov47U7.js";import{C as M,O as N,xt as P}from"./index-DCeWge12.js";import{c as F,f as I,i as L,o as R,r as z,t as B}from"./Dashboard-BgKodJl2.js";import{r as V}from"./impact-sort-BTQndbof.js";import{n as H,t as U}from"./finding-anchor-Cys8Z6Yn.js";import{t as W}from"./usePagedRows-BxvdFnPk.js";import{n as G,t as K}from"./useSortMode-B8SRfAoG.js";import{t as q}from"./PlanExplorer-DcxmiQWL.js";import{t as J}from"./PartitionHint-CUvbnnxy.js";var Y=e(t(),1),X=w(),Z=240,Q=524288e3,te=10;function $(e){let t=e.spillBytes>Q,n=e.gcPct>te;return t&&n?`critical`:t||n?`warning`:`info`}function ne(e){return O[$(e)]}function re({active:e,payload:t}){if(!e||!t?.length)return null;let n=t[0]?.payload;if(!n)return null;let r=$(n);return(0,X.jsxs)(`div`,{className:`rounded-md border border-border bg-popover px-2 py-1.5 text-xs text-popover-foreground shadow-md`,children:[(0,X.jsxs)(`p`,{children:[g(n.spillBytes),` spilled`]}),(0,X.jsxs)(`p`,{children:[n.gcPct.toFixed(1),`% GC`]}),(0,X.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 font-medium`,children:[(0,X.jsx)(C,{impactBand:r}),r.toUpperCase()]})]})}function ie({appModel:e}){let t=[];for(let n of e.stages.values()){let e=n.memoryBytesSpilled??0;e<=0||t.push({stageId:n.id,spillBytes:e,gcPct:n.gcPct??0,submittedAt:n.submittedAt??0})}if(t.length===0)return(0,X.jsx)(I,{tone:`clean`,icon:P,title:`No stages spilled memory in this run.`});let f=F(t),p=[...f].sort((e,t)=>e.submittedAt-t.submittedAt).map(e=>({stage:`S${e.stageId}`,spillMB:e.spillBytes/1048576,gcPct:e.gcPct}));return(0,X.jsxs)(ee,{defaultValue:`scatter`,children:[(0,X.jsxs)(D,{"aria-label":`Memory pressure view`,children:[(0,X.jsx)(T,{value:`scatter`,children:`Scatter`}),(0,X.jsx)(T,{value:`twin`,children:`Twin bars`})]}),(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Spill and GC pressure both stem from tight executor memory, see`,` `,(0,X.jsx)(m,{anchor:`#memory-model`,children:`how Spark’s memory model works`}),`.`]}),(0,X.jsxs)(E,{value:`scatter`,children:[(0,X.jsxs)(`div`,{className:`mb-1 flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(C,{impactBand:`critical`}),`CRITICAL`]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(C,{impactBand:`warning`}),`WARNING`]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(C,{impactBand:`info`}),`INFO`]})]}),(0,X.jsx)(k,{ariaLabel:`Memory pressure scatter: spilled memory versus GC percent, one point per stage that spilled.`,height:Z,table:{caption:`Memory spilled and GC percent by stage`,columns:[`Stage`,`Memory spilled`,`GC %`],rows:f.map(e=>[`S${e.stageId}`,g(e.spillBytes),`${e.gcPct.toFixed(1)}%`]),align:[`left`,`right`,`right`]},children:(0,X.jsxs)(c,{children:[(0,X.jsx)(a,{stroke:O.muted,strokeOpacity:.2}),(0,X.jsx)(l,{type:`number`,dataKey:`spillBytes`,name:`Memory spilled`,tickFormatter:e=>g(e),tick:{fontSize:10}}),(0,X.jsx)(s,{type:`number`,dataKey:`gcPct`,name:`GC %`,tick:{fontSize:10},width:32}),(0,X.jsx)(d,{cursor:{strokeDasharray:`3 3`},content:re}),(0,X.jsx)(r,{data:f,name:`Spill vs. GC`,children:f.map(e=>(0,X.jsx)(n,{fill:ne(e)},e.stageId))})]})})]}),(0,X.jsx)(E,{value:`twin`,children:(0,X.jsx)(k,{ariaLabel:`Memory pressure by stage: spilled memory and GC percent across stages in submission order.`,height:Z,table:{caption:`Spilled memory and GC percent by stage, submission order`,columns:[`Stage`,`Spill (MB)`,`GC %`],rows:p.map(e=>[e.stage,e.spillMB.toFixed(1),`${e.gcPct.toFixed(1)}%`]),align:[`left`,`right`,`right`]},children:(0,X.jsxs)(u,{data:p,children:[(0,X.jsx)(a,{stroke:O.muted,strokeOpacity:.2}),(0,X.jsx)(l,{dataKey:`stage`,tick:{fontSize:10}}),(0,X.jsx)(s,{yAxisId:`left`,tick:{fontSize:10},width:36}),(0,X.jsx)(s,{yAxisId:`right`,orientation:`right`,tick:{fontSize:10},width:36}),(0,X.jsx)(d,{}),(0,X.jsx)(o,{yAxisId:`left`,dataKey:`spillMB`,name:`Spill (MB)`,fill:O.critical}),(0,X.jsx)(i,{yAxisId:`right`,dataKey:`gcPct`,name:`GC %`,stroke:O.info,dot:!1})]})})})]})}function ae(e,t){return e.stages.get(t)?.spillClassification??`unclassified`}function oe({finding:e,appModel:t}){let n=H([e]),r=_(),i=t.stages.get(e.stageId),a=ae(t,e.stageId),o=a===`volume`&&i?S(i):null,s=r===`advanced`&&j(e.stageId,t);return(0,X.jsxs)(`div`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-2 ${U} transition-colors ${n.flashClassName}`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(C,{impactBand:e.impactBand}),(0,X.jsx)(b,{label:f[a],impactBand:e.impactBand,title:p[a]}),(0,X.jsx)(L,{stageId:e.stageId})]}),(0,X.jsx)(x,{children:(0,X.jsx)(A,{confidence:e.confidence,validationRequired:e.validationRequired})})]}),(0,X.jsxs)(`p`,{className:`text-sm`,children:[`Memory spilled: `,(0,X.jsx)(`strong`,{children:g(y(e))}),` · `,`Disk: `,g(i?.diskBytesSpilled??0)]}),(0,X.jsx)(B,{finding:e}),o?(0,X.jsx)(J,{hint:o}):null,s?(0,X.jsx)(`div`,{className:`pt-1`,children:(0,X.jsx)(q,{stageId:e.stageId,appModel:t})}):null]})}var se=(0,Y.memo)(function({appModel:e,catalog:t,defaultCollapsed:n=!0}){let{sortMode:r,setSortMode:i,orderBy:a}=K(),[o,s]=(0,Y.useState)(!n),[c,l]=(0,Y.useState)(0),{findings:u,sorted:d,orderedFindings:f}=(0,Y.useMemo)(()=>{let e=t.filter(e=>e.type===`spill`&&e.stageId!=null),n=[...e].sort((e,t)=>(h[e.impactBand]??9)-(h[t.impactBand]??9)||(typeof t.value==`number`?t.value:0)-(typeof e.value==`number`?e.value:0));return{findings:e,sorted:n,orderedFindings:a(n,e=>[e],e=>e.stageId)}},[t,r]),p=N(),m=p?f.findIndex(e=>e===p.finding):null,{totalPages:_,effectivePage:y,visible:b}=W(f,c,l,m);if(u.length===0){let t=0;for(let n of e.stages.values())t=Math.max(t,n.memoryBytesSpilled??0);return(0,X.jsx)(M,{title:`Spill: no issue detected (max ${g(t)} spilled)`,children:(0,X.jsx)(I,{tone:`clean`,icon:P,title:`No stages spilled memory in this run.`})})}let x=d[0].impactBand;return(0,X.jsx)(M,{title:`Spill`,fixFor:d,impactBand:x,badges:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(v,{type:`spill`,impactBand:x}),V(u,d.length,o)?(0,X.jsx)(G,{mode:r,onChange:i}):null]}),open:o,onOpenChange:s,summary:(0,X.jsx)(R,{value:g(typeof d[0].value==`number`?d[0].value:0),context:`peak · ${d.length} stage${d.length===1?``:`s`}`}),children:(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(ie,{appModel:e}),b.map(t=>(0,X.jsx)(oe,{finding:t,appModel:e},t.stageId)),(0,X.jsx)(z,{page:y,totalPages:_,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1)})]})})});export{se as Spill};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,u as i,ut as a}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,u as i,ut as a}from"./DisclosureContext-B0siMVdg.js";import{p as o}from"./plan-graph-vendor-BYl-AzN5.js";import{m as s}from"./useRecentFiles-C3Ov47U7.js";import{C as c,O as l}from"./index-DCeWge12.js";import{i as u,o as d,r as f,t as p}from"./Dashboard-BgKodJl2.js";import{r as m}from"./impact-sort-BTQndbof.js";import{n as h}from"./finding-anchor-Cys8Z6Yn.js";import{t as g}from"./usePagedRows-BxvdFnPk.js";import{n as _,t as v}from"./useSortMode-B8SRfAoG.js";var y=e(t(),1),b=o();function x(e){return e.stageId!=null}function S({finding:e}){let t=h([e]);return(0,b.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`flex flex-col gap-1 transition-colors ${t.flashClassName}`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(u,{stageId:e.stageId}),(0,b.jsx)(i,{impactBand:e.impactBand})]}),(0,b.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Stage attempt failed outright. Reason: `,(0,b.jsx)(`strong`,{children:e.valueText})]}),(0,b.jsx)(p,{finding:e})]})}function C({appModel:e,catalog:t,defaultCollapsed:i=!0}){let[o,u]=(0,y.useState)(0),{sortMode:p,setSortMode:h,orderBy:C}=v(),[w,T]=(0,y.useState)(!i),E=l(),D=(0,y.useRef)(!1);(0,y.useEffect)(()=>{if(!D.current){D.current=!0;return}u(0)},[e]);let O=s(t,`stageFailed`).filter(x),k=C([...O].sort((e,t)=>n[e.impactBand]-n[t.impactBand]||e.stageId-t.stageId),e=>[e],e=>e.stageId),A=E?k.findIndex(e=>e===E.finding):null,{totalPages:j,effectivePage:M,visible:N}=g(k,o,u,A);return O.length===0?null:(0,b.jsxs)(c,{title:`Failed Stages`,fixFor:O,impactBand:a(O),badges:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r,{type:`stageFailed`,impactBand:a(O)}),m(O,O.length,w)?(0,b.jsx)(_,{mode:p,onChange:e=>{h(e),u(0)}}):null]}),open:w,onOpenChange:T,summary:(0,b.jsx)(d,{value:O.length,context:`stage${O.length===1?``:`s`} failed outright`}),children:[(0,b.jsx)(`ul`,{className:`space-y-3`,children:N.map(e=>(0,b.jsx)(S,{finding:e},e.id))}),(0,b.jsx)(f,{page:M,totalPages:j,onPrev:()=>u(e=>e-1),onNext:()=>u(e=>e+1)})]})}export{C as StageFailed};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,Z as r,bt as i,d as a,gt as o,ht as s,p as c,u as l,ut as u}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,Z as r,bt as i,d as a,gt as o,ht as s,p as c,u as l,ut as u}from"./DisclosureContext-B0siMVdg.js";import{p as d}from"./plan-graph-vendor-BYl-AzN5.js";import{h as f,i as p,m}from"./useRecentFiles-C3Ov47U7.js";import{C as h,O as g}from"./index-DCeWge12.js";import{l as _,n as v,o as y,r as b,s as x,t as S}from"./Dashboard-BgKodJl2.js";import{r as C}from"./impact-sort-BTQndbof.js";import{n as w,t as T}from"./finding-anchor-Cys8Z6Yn.js";import{t as E}from"./usePagedRows-BxvdFnPk.js";import{n as D,t as O}from"./useSortMode-B8SRfAoG.js";import{t as k}from"./StageHeader-pI1nTwVf.js";import{t as A}from"./PlanExplorer-DcxmiQWL.js";var j=e(t(),1),M=d();function N({expanded:e,onClick:t,label:n,location:r,controlsId:i}){let a=r?` for ${r}`:``;return(0,M.jsxs)(`button`,{type:`button`,"aria-expanded":e,"aria-controls":i,"aria-label":`${e?`Hide`:`Show`} ${n.toLowerCase()}${a}`,onClick:t,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,e?(0,M.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}):(0,M.jsx)(o,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]})}function P(e){let[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null),[a,o]=(0,j.useState)(!1),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(!1);return{expanded:t,data:r,loading:a,error:s,toggle:()=>{let r=!t;n(r),r&&e&&!l&&!a&&(o(!0),e().then(e=>i(e)).catch(()=>c(!0)).finally(()=>{u(!0),o(!1)}))}}}function F({group:e,appModel:t,getTaskData:n,idPrefix:a,findingLabel:o}){let{exportMode:s,getTaskData:u}=_(n),{expanded:d,data:m,error:h,toggle:g}=P(u?()=>u(e.stageId):void 0),y=w(e.findings),b=t.stages.get(e.stageId),x=i()===`advanced`&&p(e.stageId,t),C=`${a}-stage-${e.stageId}-detail`;return(0,M.jsxs)(`div`,{ref:y.ref,tabIndex:y.tabIndex,"data-flashed":y.dataFlashed,className:`space-y-2 ${T} transition-colors ${y.flashClassName}`,children:[(0,M.jsx)(k,{stageId:e.stageId,appModel:t}),(0,M.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.findings.map((e,t)=>(0,M.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,M.jsx)(l,{impactBand:e.impactBand}),(0,M.jsx)(`span`,{children:o(e)}),(0,M.jsx)(S,{finding:e}),(0,M.jsx)(c,{children:(0,M.jsx)(f,{confidence:e.confidence,validationRequired:e.validationRequired})})]},t))}),b?.taskDurationP50==null?null:(0,M.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`P50 `,r(b.taskDurationP50),` · P95 `,r(b.taskDurationP95),` · Max`,` `,r(b.taskDurationMax)]}),e.slowHost?(0,M.jsxs)(`p`,{className:`flex items-start gap-2 text-xs`,children:[(0,M.jsx)(l,{impactBand:e.slowHost.impactBand,className:`mt-1`}),(0,M.jsxs)(`span`,{children:[(0,M.jsx)(`strong`,{children:`Slow host:`}),` `,e.slowHost.host,` (`,e.slowHost.value,`× median,`,` `,Math.round((e.slowHost.hostTaskShare??0)*100),`% of tasks)`]})]}):null,e.straggler?(0,M.jsxs)(`p`,{className:`flex items-start gap-2 text-xs`,children:[(0,M.jsx)(l,{impactBand:e.straggler.impactBand,className:`mt-1`}),(0,M.jsxs)(`span`,{children:[(0,M.jsx)(`strong`,{children:`Stragglers:`}),` `,(e.straggler.speculativeTasks??0)>0?`${e.straggler.speculativeTasks} speculative task${e.straggler.speculativeTasks===1?``:`s`}`:`${e.straggler.value}% of tasks > 4× P50`]})]}):null,(0,M.jsx)(N,{expanded:d,onClick:g,label:`Task detail`,location:`Stage ${e.stageId}`,controlsId:C}),d?(0,M.jsxs)(`div`,{id:C,className:`space-y-3 pt-1`,children:[m?(0,M.jsx)(v,{metrics:m.metrics,fieldNames:m.fieldNames,markers:{p50:b?.taskDurationP50,p95:b?.taskDurationP95}}):s?(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Task data isn’t included in exported reports.`}):h?(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Task data unavailable for this stage.`}):(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading task data…`}),x?(0,M.jsx)(A,{stageId:e.stageId,appModel:t}):null]}):null]})}var I=(0,j.memo)(function({appModel:e,catalog:t,getTaskData:r,defaultCollapsed:i=!0,type:o,title:s,idPrefix:c,findingLabel:l}){let[d,f]=(0,j.useState)(0),{sortMode:p,setSortMode:_,orderBy:v}=O(),[S,w]=(0,j.useState)(!i),{relevant:T,stageGroups:k,orderedGroups:A}=(0,j.useMemo)(()=>{let e=t.filter(e=>e.type===o),r=new Map;for(let t of e)t.stageId!=null&&(r.has(t.stageId)||r.set(t.stageId,[]),r.get(t.stageId).push(t));let i=[...r.entries()].map(([e,n])=>({stageId:e,findings:n,impactBand:u(n)??`info`,slowHost:m(t,`slowHost`).find(t=>t.stageId===e),straggler:m(t,`straggler`).find(t=>t.stageId===e)})).sort((e,t)=>n[e.impactBand]-n[t.impactBand]||e.stageId-t.stageId);return{relevant:e,stageGroups:i,orderedGroups:v(i,e=>e.findings,e=>e.stageId)}},[t,p,o]),N=g(),P=N?A.findIndex(e=>e.findings.some(e=>e===N.finding)):null,{totalPages:I,effectivePage:L,visible:R}=E(A,d,f,P);if(T.length===0)return null;let z=u(T);return(0,M.jsxs)(h,{title:s,impactBand:z,fixFor:T,badges:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(a,{type:o,impactBand:z??`info`}),C(T,k.length,S)?(0,M.jsx)(D,{mode:p,onChange:_}):null]}),open:S,onOpenChange:w,summary:(0,M.jsx)(y,{value:`${k.length} stage${k.length===1?``:`s`}`,context:x(T.length)}),children:[(0,M.jsx)(`div`,{className:`space-y-3`,children:R.map(t=>(0,M.jsx)(F,{group:t,appModel:e,getTaskData:r,idPrefix:c,findingLabel:l},t.stageId))}),(0,M.jsx)(b,{page:L,totalPages:I,onPrev:()=>f(e=>e-1),onNext:()=>f(e=>e+1)})]})});export{I as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./plan-graph-vendor-
|
|
1
|
+
import{p as e}from"./plan-graph-vendor-BYl-AzN5.js";import{i as t}from"./Dashboard-BgKodJl2.js";var n=e();function r({stageId:e,appModel:r}){let i=r.stages.get(e);return(0,n.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,n.jsx)(t,{stageId:e}),(0,n.jsx)(`span`,{className:`text-sm font-medium`,children:i?.name??`Stage ${e}`})]})}export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,it as r}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,it as r}from"./DisclosureContext-B0siMVdg.js";import{p as i}from"./plan-graph-vendor-BYl-AzN5.js";import{t as a}from"./StageFindingGroup-D9naK109.js";var o=e(t(),1),s=i(),c={lowParallelism:`Low parallelism`,dataExplosion:`Data explosion`,taskStageSkew:`Task/stage skew`};function l(e){let t=e.type===`stageShape`?c[e.rule]:`stage shape`;return e.type===`stageShape`?e.rule===`lowParallelism`?`${t}: ${e.value} tasks per core`:e.rule===`taskStageSkew`?`${t}: ${n(`pctFraction`,r(e))}`:`${t}: ${e.value}`:`${t}: ${e.value}`}var u=(0,o.memo)(function(e){return(0,s.jsx)(a,{...e,type:`stageShape`,title:`Stage Shape`,idPrefix:`stage-shape`,findingLabel:l})});export{u as StageShape};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,u as i}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,u as i}from"./DisclosureContext-B0siMVdg.js";import{p as a}from"./plan-graph-vendor-BYl-AzN5.js";import{C as o,O as s}from"./index-DCeWge12.js";import{o as c,r as l,s as u,t as d}from"./Dashboard-BgKodJl2.js";import{r as f}from"./impact-sort-BTQndbof.js";import{n as p}from"./finding-anchor-Cys8Z6Yn.js";import{t as m}from"./usePagedRows-BxvdFnPk.js";import{n as h,t as g}from"./useSortMode-B8SRfAoG.js";import{t as _}from"./StageHeader-pI1nTwVf.js";var v=e(t(),1),y=a();function b(e){return`${e.value}m stage duration`}function x({finding:e,appModel:t}){let n=p([e]);return(0,y.jsxs)(`li`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-1 text-sm transition-colors ${n.flashClassName}`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(i,{impactBand:e.impactBand}),e.stageId==null?null:(0,y.jsx)(_,{stageId:e.stageId,appModel:t}),(0,y.jsx)(`strong`,{children:b(e)})]}),(0,y.jsx)(d,{finding:e})]})}var S=(0,v.memo)(function({appModel:e,catalog:t,defaultCollapsed:i=!0}){let{sortMode:a,setSortMode:d,orderBy:p}=g(),[_,S]=(0,v.useState)(!i),[C,w]=(0,v.useState)(0),T=t.filter(e=>e.type===`stageSlowness`).slice().sort((e,t)=>n[e.impactBand]-n[t.impactBand]),E=p(T,e=>[e],e=>e.stageId??null),D=s(),O=D?E.findIndex(e=>e===D.finding):null,{totalPages:k,effectivePage:A,visible:j}=m(E,C,w,O);return T.length===0?null:(0,y.jsxs)(o,{title:`Slow Stage`,fixFor:T,impactBand:T[0].impactBand,badges:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(r,{type:`stageSlowness`,impactBand:T[0].impactBand}),f(T,T.length,_)?(0,y.jsx)(h,{mode:a,onChange:d}):null]}),open:_,onOpenChange:S,summary:(0,y.jsx)(c,{value:b(T[0]),context:u(T.length)}),children:[(0,y.jsx)(`ul`,{className:`space-y-2`,children:j.map(t=>(0,y.jsx)(x,{finding:t,appModel:e},t.id))}),(0,y.jsx)(l,{page:A,totalPages:k,onPrev:()=>w(e=>e-1),onNext:()=>w(e=>e+1)})]})});export{S as StageSlowness};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,U as r,d as i,it as a,p as o,u as s}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,U as r,d as i,it as a,p as o,u as s}from"./DisclosureContext-B0siMVdg.js";import{p as c}from"./plan-graph-vendor-BYl-AzN5.js";import{h as l,m as u}from"./useRecentFiles-C3Ov47U7.js";import{C as d,O as f}from"./index-DCeWge12.js";import{o as p,r as m,s as h,t as g}from"./Dashboard-BgKodJl2.js";import{r as _}from"./impact-sort-BTQndbof.js";import{n as v}from"./finding-anchor-Cys8Z6Yn.js";import{t as y}from"./usePagedRows-BxvdFnPk.js";import{n as b,t as x}from"./useSortMode-B8SRfAoG.js";import{t as S}from"./StageHeader-pI1nTwVf.js";var C=e(t(),1),w=c();function T(e){let t=a(e);return e.unit===`count`?`${t} speculative attempt${t===1?``:`s`} discarded`:`${n(`pct`,t)} of tasks straggled`}function E({finding:e,appModel:t}){let n=v([e]);return(0,w.jsxs)(`li`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-1 text-sm transition-colors ${n.flashClassName}`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(s,{impactBand:e.impactBand}),e.stageId==null?null:(0,w.jsx)(S,{stageId:e.stageId,appModel:t})]}),(0,w.jsx)(o,{children:(0,w.jsx)(l,{confidence:e.confidence,validationRequired:e.validationRequired})})]}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T(e)}),(0,w.jsx)(g,{finding:e})]})}var D=(0,C.memo)(function({appModel:e,catalog:t,defaultCollapsed:n=!0}){let{sortMode:a,setSortMode:o,orderBy:s}=x(),[c,l]=(0,C.useState)(!n),[g,v]=(0,C.useState)(0),S=u(t,`straggler`).slice().sort((e,t)=>r[e.impactBand]-r[t.impactBand]),D=s(S,e=>[e],e=>e.stageId??null),O=f(),k=O?D.findIndex(e=>e===O.finding):null,{totalPages:A,effectivePage:j,visible:M}=y(D,g,v,k);return S.length===0?null:(0,w.jsxs)(d,{title:`Stragglers`,impactBand:S[0].impactBand,fixFor:S,badges:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(i,{type:`straggler`,impactBand:S[0].impactBand}),_(S,S.length,c)?(0,w.jsx)(b,{mode:a,onChange:o}):null]}),open:c,onOpenChange:l,summary:(0,w.jsx)(p,{value:T(S[0]),context:h(S.length)}),children:[(0,w.jsx)(`ul`,{className:`space-y-2`,children:M.map(t=>(0,w.jsx)(E,{finding:t,appModel:e},t.id))}),(0,w.jsx)(m,{page:j,totalPages:A,onPrev:()=>v(e=>e-1),onNext:()=>v(e=>e+1)})]})});export{D as Straggler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,U as r,d as i,it as a,u as o,ut as s}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,U as r,d as i,it as a,u as o,ut as s}from"./DisclosureContext-B0siMVdg.js";import{p as c}from"./plan-graph-vendor-BYl-AzN5.js";import{m as l}from"./useRecentFiles-C3Ov47U7.js";import{C as u,O as d,tt as f}from"./index-DCeWge12.js";import{i as p,o as m,r as h,s as g,t as _}from"./Dashboard-BgKodJl2.js";import{r as v}from"./impact-sort-BTQndbof.js";import{n as y}from"./finding-anchor-Cys8Z6Yn.js";import{t as b}from"./usePagedRows-BxvdFnPk.js";import{n as x,t as S}from"./useSortMode-B8SRfAoG.js";var C=e(t(),1),w=c();function T(e){return e.stageId!=null}function E({groups:e,otherFailedTasks:t}){return e.length===0?null:(0,w.jsxs)(`ul`,{className:`space-y-2`,"aria-label":`Distinct failures`,children:[e.map((e,t)=>(0,w.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,w.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` task`,e.count===1?``:`s`,`: `,(0,w.jsx)(`strong`,{className:`break-words`,children:f(e)})]}),e.stackExcerpt?(0,w.jsx)(`pre`,{className:`max-h-40 overflow-auto rounded-md bg-muted p-2 text-xs whitespace-pre`,children:e.stackExcerpt}):null]},t)),t>0?(0,w.jsxs)(`li`,{className:`text-xs text-muted-foreground`,children:[t,` more failed task`,t===1?``:`s`,` not shown`]}):null]})}function D({finding:e}){let t=y([e]),n=e.dominantError??e.dominantReason;return(0,w.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`flex flex-col gap-1 transition-colors ${t.flashClassName}`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(p,{stageId:e.stageId}),(0,w.jsx)(o,{impactBand:e.impactBand})]}),(0,w.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Failure rate: `,(0,w.jsxs)(`strong`,{children:[e.value,`%`]}),` (`,e.failedTasks,` tasks) · Dominant error: `,(0,w.jsx)(`strong`,{className:`break-words`,children:n??`—`})]}),(0,w.jsx)(E,{groups:e.failureGroups,otherFailedTasks:e.otherFailedTasks}),(0,w.jsx)(_,{finding:e})]})}function O({appModel:e,catalog:t,defaultCollapsed:o=!0}){let[c,f]=(0,C.useState)(0),{sortMode:p,setSortMode:_,orderBy:y}=S(),[E,O]=(0,C.useState)(!o),k=d(),A=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!A.current){A.current=!0;return}f(0)},[e]);let j=l(t,`failures`).filter(T),M=[...j].sort((e,t)=>r[e.impactBand]-r[t.impactBand]||e.stageId-t.stageId),N=y(M,e=>[e],e=>e.stageId),P=k?N.findIndex(e=>e===k.finding):null,{totalPages:F,effectivePage:I,visible:L}=b(N,c,f,P);return j.length===0?null:(0,w.jsxs)(u,{title:`Failed Tasks`,fixFor:j,impactBand:s(j),badges:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(i,{type:`failures`,impactBand:s(j)}),v(j,j.length,E)?(0,w.jsx)(x,{mode:p,onChange:e=>{_(e),f(0)}}):null]}),open:E,onOpenChange:O,summary:(0,w.jsx)(m,{value:n(`pct`,a(M[0])),context:g(j.length)}),children:[(0,w.jsx)(`ul`,{className:`space-y-3`,children:L.map(e=>(0,w.jsx)(D,{finding:e},e.id))}),(0,w.jsx)(h,{page:I,totalPages:F,onPrev:()=>f(e=>e-1),onNext:()=>f(e=>e+1)})]})}export{O as TaskFailures};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{p as n}from"./plan-graph-vendor-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{p as n}from"./plan-graph-vendor-BYl-AzN5.js";import{t as r}from"./StageFindingGroup-D9naK109.js";var i=e(t(),1),a=n();function o(e){return`P50 ${e.value}ms across many small tasks`}var s=(0,i.memo)(function(e){return(0,a.jsx)(r,{...e,type:`tinyTask`,title:`Tiny Tasks`,idPrefix:`tiny-task`,findingLabel:o})});export{s as TinyTask};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,p as i,ut as a}from"./DisclosureContext-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,p as i,ut as a}from"./DisclosureContext-B0siMVdg.js";import{p as o}from"./plan-graph-vendor-BYl-AzN5.js";import{h as s,m as c}from"./useRecentFiles-C3Ov47U7.js";import{C as l,O as u,S as d,l as f}from"./index-DCeWge12.js";import{a as p,o as m,r as h,s as g,t as _}from"./Dashboard-BgKodJl2.js";import{i as v,r as y}from"./impact-sort-BTQndbof.js";import{n as b,t as x}from"./finding-anchor-Cys8Z6Yn.js";import{t as S}from"./usePagedRows-BxvdFnPk.js";import{n as C,t as w}from"./useSortMode-B8SRfAoG.js";var T=e(t(),1),E=o();function D({finding:e}){let t=b([e]);return(0,E.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-2 ${x} transition-colors ${t.flashClassName}`,children:[e.stageIds.length>0?(0,E.jsx)(p,{pills:e.stageIds.map(e=>({id:e}))}):null,(0,E.jsxs)(`p`,{children:[f(e.recommendation??``).measured??e.recommendation,` `,(0,E.jsx)(_,{finding:e})]})]})}var O=(0,T.memo)(function({catalog:e,defaultCollapsed:t=!0}){let{sortMode:o,setSortMode:f,orderBy:p}=w(),[_,b]=(0,T.useState)(!t),[x,O]=(0,T.useState)(0),{findings:k,pills:A}=(0,T.useMemo)(()=>{let t=c(e,`underBroadcast`).sort((e,t)=>n[e.impactBand]-n[t.impactBand]);return{findings:t,pills:[...new Set(t.flatMap(e=>e.stageIds))].map(e=>({id:e}))}},[e]),j=p(k,e=>[e],v),M=u(),N=M?j.findIndex(e=>e===M.finding):null,{totalPages:P,effectivePage:F,visible:I}=S(j,x,O,N);return k.length===0?null:(0,E.jsxs)(l,{title:`Missed Broadcast Join`,fixFor:k,impactBand:a(k),open:_,onOpenChange:b,badges:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(r,{type:`underBroadcast`,impactBand:a(k)??`info`,className:d}),y(k,k.length,_)?(0,E.jsx)(C,{mode:o,onChange:f}):null]}),statusBadge:(0,E.jsx)(i,{children:(0,E.jsx)(s,{confidence:k[0].confidence,validationRequired:k[0].validationRequired,evidenceKey:`sqlPlan`})}),summary:(0,E.jsx)(m,{value:`${A.length} stage${A.length===1?``:`s`}`,context:g(k.length)}),children:[(0,E.jsx)(`ul`,{className:`space-y-3 text-sm`,children:I.map(e=>(0,E.jsx)(D,{finding:e},e.id))}),(0,E.jsx)(h,{page:F,totalPages:P,onPrev:()=>O(e=>e-1),onNext:()=>O(e=>e+1)})]})});export{O as UnderBroadcast};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{A as n,k as r}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{A as n,k as r}from"./index-DCeWge12.js";var i=e(t(),1);function a(e){return e.map(e=>`${e.type}:${e.stageId}`).join(`,`)}function o(e){let t=n(),r=a(e),o=(0,i.useRef)([]);return(0,i.useCallback)(n=>{o.current.forEach(e=>e()),o.current=[],n&&t&&(o.current=e.map(e=>t.registerFindingAnchor(e,n)))},[r,t])}function s(e){let t=r();return t!==null&&e.includes(t)}function c(e){return e?`bg-primary/10 ring-2 ring-primary rounded-md`:``}function l(e){let t=o(e),n=s(e);return{ref:t,tabIndex:-1,dataFlashed:n?`true`:`false`,flashClassName:c(n)}}var u=`border-b border-border pb-3 last:border-b-0 last:pb-0`;export{l as n,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./useRecentFiles-
|
|
1
|
+
import{p as e}from"./useRecentFiles-C3Ov47U7.js";function t(e){let t=0,n=!1;for(let r of e){let e=r.impactEstimate?.wallClock;e&&(n=!0,t+=e.low)}return n?t:null}function n(e){return e.some(e=>e.impactEstimate?.wallClock!=null)}function r(e,t,r){return n(e)&&t>1&&r}function i(e){return(n,r)=>{let i=t(e(n)),a=t(e(r));return i==null&&a==null?0:i==null?1:a==null?-1:a-i}}function a(t){if(t.stageId!=null)return t.stageId;let n=e(t);return n&&n.length>0?Math.min(...n):null}function o(e){return(t,n)=>{let r=e(t),i=e(n);return r==null&&i==null?0:r==null?1:i==null?-1:r-i}}export{a as i,o as n,r,i as t};
|