sparkforensics-server 0.2.3 → 0.2.4

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.
Files changed (129) hide show
  1. package/package.json +1 -1
  2. package/public/assets/{AutoscalingChurn-Bf5TN-s_.js → AutoscalingChurn-BOiUUfuY.js} +1 -1
  3. package/public/assets/{CacheUtilization-DRf_FNrK.js → CacheUtilization-DwX7lisd.js} +1 -1
  4. package/public/assets/{CachingOpportunity-BTJzIhtI.js → CachingOpportunity-DUE3GKpx.js} +1 -1
  5. package/public/assets/{ColdStart-DnFgnD3n.js → ColdStart-ZHxPrJmI.js} +1 -1
  6. package/public/assets/{ConfigAudit-B5FsOdmu.js → ConfigAudit-BkVnq2XE.js} +1 -1
  7. package/public/assets/{CoreUsageArea-CTksBPuq.js → CoreUsageArea-DobrSXk2.js} +1 -1
  8. package/public/assets/{Dashboard-BFMsMuc_.js → Dashboard-y3_9iQJo.js} +1 -1
  9. package/public/assets/{DuplicatePlanSubtree-BCt-Guuh.js → DuplicatePlanSubtree-BSQZFeNq.js} +1 -1
  10. package/public/assets/{DurationHistogram-xRcnND4k.js → DurationHistogram-DlQv4ZCB.js} +1 -1
  11. package/public/assets/{EmptyState-CnTrSjtU.js → EmptyState-DqnSxTjJ.js} +1 -1
  12. package/public/assets/{ExecutorUtilization-CP21XlUq.js → ExecutorUtilization-CuQUxaCd.js} +1 -1
  13. package/public/assets/{GcPressure-BoEJsLjb.js → GcPressure-CLT5hkMJ.js} +1 -1
  14. package/public/assets/{ImpactEstimate-BHcqJkcZ.js → ImpactEstimate-Df_laG-n.js} +1 -1
  15. package/public/assets/{IncompleteRun-b9FWrOHn.js → IncompleteRun-CpIkS4XZ.js} +1 -1
  16. package/public/assets/{JobFailures-C5FkTq3O.js → JobFailures-DKbvYc4J.js} +1 -1
  17. package/public/assets/{MemoryUtilization-D2W4AB_f.js → MemoryUtilization-C5kHmXIb.js} +1 -1
  18. package/public/assets/{OverBroadcast-Btu3xorf.js → OverBroadcast-C5pF66aq.js} +1 -1
  19. package/public/assets/{PartitionSizing-yZWhLN0e.js → PartitionSizing-BvEJQ5M1.js} +1 -1
  20. package/public/assets/{PlanExplorer-DSk1ivS4.js → PlanExplorer-DjGTZifP.js} +1 -1
  21. package/public/assets/{PlanGraphRoute-C3iOzUdB.js → PlanGraphRoute-DoIGA7_H.js} +1 -1
  22. package/public/assets/{RetryWaste-B4436kr1.js → RetryWaste-C0znHd_w.js} +1 -1
  23. package/public/assets/{RowPagination-oeWB8gBm.js → RowPagination-2icPidMP.js} +1 -1
  24. package/public/assets/{ShuffleIO-DUiv8EJe.js → ShuffleIO-L_XSnJ_V.js} +1 -1
  25. package/public/assets/{Skew-D2lB1oQc.js → Skew-w4uV5H_g.js} +1 -1
  26. package/public/assets/{SlowHost-Qb_8aa-W.js → SlowHost-D5tWJ1UR.js} +1 -1
  27. package/public/assets/{SmallFiles-u6suTgfj.js → SmallFiles-CTtNiSOh.js} +1 -1
  28. package/public/assets/{SpeculationWaste-vUCniiFP.js → SpeculationWaste-xCKwjz2K.js} +1 -1
  29. package/public/assets/{Spill-BskXFX2e.js → Spill-BT8my24K.js} +1 -1
  30. package/public/assets/{StageFailed-D9b83Jvy.js → StageFailed-De3vVDbc.js} +1 -1
  31. package/public/assets/{StageFindingGroup-DagqHOUz.js → StageFindingGroup-R4OW-g4U.js} +1 -1
  32. package/public/assets/{StageHeader-DibMSunO.js → StageHeader-CGeWqC-0.js} +1 -1
  33. package/public/assets/{StagePill-Dt6V9yVw.js → StagePill-BwwKLcFl.js} +1 -1
  34. package/public/assets/{StageShape-CfdrDUZa.js → StageShape-D4LmPVyV.js} +1 -1
  35. package/public/assets/{StageSlowness-BoGLIYKR.js → StageSlowness-8-z6qn4Q.js} +1 -1
  36. package/public/assets/{Straggler-DU1WSU-m.js → Straggler-BIgxsowI.js} +1 -1
  37. package/public/assets/{TaskFailures-DkY6zBNJ.js → TaskFailures-B9lLt6Rw.js} +1 -1
  38. package/public/assets/{TinyTask-Lsnt5mJF.js → TinyTask-DYXks5sT.js} +1 -1
  39. package/public/assets/{UnderBroadcast-DxHc0lwy.js → UnderBroadcast-BWqWMpeG.js} +1 -1
  40. package/public/assets/{finding-anchor-Bl1hRK5E.js → finding-anchor-CDbHtqKT.js} +1 -1
  41. package/public/assets/{inbox-DHIFHqcn.js → inbox-M_EuWNiK.js} +1 -1
  42. package/public/assets/{index-U654cmB8.js → index-pnImGbgQ.js} +3 -3
  43. package/public/assets/{parser-worker-5a9aUx3o.js → parser-worker-C3BAO6z9.js} +4 -2
  44. package/public/assets/{select-CtKaJ5Hx.js → select-C-MZGNpb.js} +1 -1
  45. package/public/assets/{toggle-group-DB2VfFIx.js → toggle-group-C3nz7UQ_.js} +1 -1
  46. package/public/assets/{useRecentFiles-BiYdWs8J.js → useRecentFiles-0XuhS91q.js} +4 -4
  47. package/public/assets/{useSortMode-BhPky1lW.js → useSortMode-DHlKZeWv.js} +1 -1
  48. package/public/assets/zstd-worker-C1Jq9lfb.js +1 -0
  49. package/public/docs/404.html +2 -2
  50. package/public/docs/assets/{app.BczRxXPr.js → app.DsFQcynM.js} +1 -1
  51. package/public/docs/assets/chunks/@localSearchIndexroot.BEfYag5Q.js +1 -0
  52. package/public/docs/assets/chunks/{VPLocalSearchBox.DXvkTVnC.js → VPLocalSearchBox.oa8NbaiV.js} +1 -1
  53. package/public/docs/assets/chunks/{theme.ByUdwrLG.js → theme.Ca4dR9dL.js} +2 -2
  54. package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.B1vUqtry.js → contributor-guide_architecture_detector-contract.md.aQQfP7pj.js} +1 -1
  55. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.sf9DU2bA.js +1 -0
  56. package/public/docs/assets/{contributor-guide_architecture_impact-estimation.md.DHVq1UPt.lean.js → contributor-guide_architecture_impact-estimation.md.sf9DU2bA.lean.js} +1 -1
  57. package/public/docs/assets/contributor-guide_architecture_overview.md.BXQdgG5u.js +1 -0
  58. package/public/docs/assets/contributor-guide_architecture_overview.md.BXQdgG5u.lean.js +1 -0
  59. package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.C0SovZX8.js → contributor-guide_architecture_worker-protocol.md.P7d1vtEJ.js} +2 -2
  60. package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.C0SovZX8.lean.js → contributor-guide_architecture_worker-protocol.md.P7d1vtEJ.lean.js} +1 -1
  61. package/public/docs/assets/contributor-guide_testing.md.BU6vyA-9.js +1 -0
  62. package/public/docs/assets/contributor-guide_testing.md.BU6vyA-9.lean.js +1 -0
  63. package/public/docs/contributor-guide/architecture/board-widgets.html +3 -3
  64. package/public/docs/contributor-guide/architecture/detector-contract.html +5 -5
  65. package/public/docs/contributor-guide/architecture/drill-down.html +3 -3
  66. package/public/docs/contributor-guide/architecture/impact-estimation.html +5 -5
  67. package/public/docs/contributor-guide/architecture/index.html +3 -3
  68. package/public/docs/contributor-guide/architecture/overview.html +5 -5
  69. package/public/docs/contributor-guide/architecture/state-and-history.html +3 -3
  70. package/public/docs/contributor-guide/architecture/widget-rendering.html +3 -3
  71. package/public/docs/contributor-guide/architecture/worker-protocol.html +5 -5
  72. package/public/docs/contributor-guide/contributing.html +3 -3
  73. package/public/docs/contributor-guide/development-setup.html +3 -3
  74. package/public/docs/contributor-guide/testing.html +5 -5
  75. package/public/docs/hashmap.json +1 -1
  76. package/public/docs/index.html +3 -3
  77. package/public/docs/tuning-reference/anti-patterns.html +3 -3
  78. package/public/docs/tuning-reference/aqe.html +3 -3
  79. package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +3 -3
  80. package/public/docs/tuning-reference/bottleneck-cold-start.html +3 -3
  81. package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +3 -3
  82. package/public/docs/tuning-reference/bottleneck-failures.html +3 -3
  83. package/public/docs/tuning-reference/bottleneck-gc.html +3 -3
  84. package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +3 -3
  85. package/public/docs/tuning-reference/bottleneck-memory-utilization.html +3 -3
  86. package/public/docs/tuning-reference/bottleneck-retry-waste.html +3 -3
  87. package/public/docs/tuning-reference/bottleneck-shuffle.html +3 -3
  88. package/public/docs/tuning-reference/bottleneck-skew.html +3 -3
  89. package/public/docs/tuning-reference/bottleneck-slow-host.html +3 -3
  90. package/public/docs/tuning-reference/bottleneck-small-files.html +3 -3
  91. package/public/docs/tuning-reference/bottleneck-spill.html +3 -3
  92. package/public/docs/tuning-reference/bottleneck-straggler.html +3 -3
  93. package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +3 -3
  94. package/public/docs/tuning-reference/bottleneck-utilization.html +3 -3
  95. package/public/docs/tuning-reference/caching.html +3 -3
  96. package/public/docs/tuning-reference/cluster-config.html +3 -3
  97. package/public/docs/tuning-reference/config.html +3 -3
  98. package/public/docs/tuning-reference/data-formats.html +3 -3
  99. package/public/docs/tuning-reference/index.html +3 -3
  100. package/public/docs/tuning-reference/intro.html +3 -3
  101. package/public/docs/tuning-reference/joins.html +3 -3
  102. package/public/docs/tuning-reference/memory-model.html +3 -3
  103. package/public/docs/tuning-reference/metrics.html +3 -3
  104. package/public/docs/tuning-reference/partitioning.html +3 -3
  105. package/public/docs/tuning-reference/pyspark.html +3 -3
  106. package/public/docs/tuning-reference/shuffle.html +3 -3
  107. package/public/docs/tuning-reference/spark-architecture.html +3 -3
  108. package/public/docs/tuning-reference/table-formats.html +3 -3
  109. package/public/docs/user-guide/alternative-log-retrieval.html +3 -3
  110. package/public/docs/user-guide/getting-started.html +3 -3
  111. package/public/docs/user-guide/mcp-tools.html +3 -3
  112. package/public/docs/user-guide/run-comparison.html +3 -3
  113. package/public/docs/user-guide/understanding-findings.html +3 -3
  114. package/public/index.html +1 -1
  115. package/vendor-core/impact-estimator.js +23 -3
  116. package/vendor-core/occupancy.js +8 -7
  117. package/vendor-core/parser-worker.js +31 -15
  118. package/vendor-core/plan-summary.js +1 -1
  119. package/vendor-core/stage-quantiles.js +53 -1
  120. package/vendor-core/types.js +5 -0
  121. package/vendor-core/zstd-worker-client.js +180 -0
  122. package/vendor-core/zstd-worker.js +103 -0
  123. package/public/docs/assets/chunks/@localSearchIndexroot.c2HfrwDg.js +0 -1
  124. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DHVq1UPt.js +0 -1
  125. package/public/docs/assets/contributor-guide_architecture_overview.md.DkXdJ9jE.js +0 -1
  126. package/public/docs/assets/contributor-guide_architecture_overview.md.DkXdJ9jE.lean.js +0 -1
  127. package/public/docs/assets/contributor-guide_testing.md.BohuQWvl.js +0 -1
  128. package/public/docs/assets/contributor-guide_testing.md.BohuQWvl.lean.js +0 -1
  129. /package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.B1vUqtry.lean.js → contributor-guide_architecture_detector-contract.md.aQQfP7pj.lean.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparkforensics-server",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Local companion server for the SparkForensics dashboard: serves the app and proxies Spark History Server fetches to avoid browser CORS restrictions.",
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,T as n,f as r,l as i,o as a,s as o,t as s,v as c,w as l}from"./charts-vendor-0VMaLVLN.js";import{p as u}from"./plan-graph-vendor-B0sEms9Z.js";import{T as d,w as f}from"./useRecentFiles-BiYdWs8J.js";import{A as p,D as m,O as h,i as g}from"./index-U654cmB8.js";import{t as _}from"./downsample-WmNM1qc9.js";import{t as v}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as y}from"./ImpactEstimate-BHcqJkcZ.js";var b=e(t(),1),x=u(),S=60,C=6e4,w=220;function T(e,t,n,r,i){if(e.length===0&&t.length===0)return[];let a=Math.max(i,r-n),o=Math.max(1,Math.ceil(a/i)),s=[];for(let e=0;e<o;e++)s.push({tStart:n+e*i,adds:0,removes:0});let c=e=>Math.min(o-1,Math.max(0,Math.floor((e-n)/i)));for(let t of e)s[c(t.timestamp)].adds++;for(let e of t)s[c(e.timestamp)].removes++;return s}function E(e,t){let n=Math.max(1,t-e);return Math.max(C,Math.ceil(n/S))}function D(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e)),n=e/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function O(e){let t=D(e.reduce((e,t)=>Math.max(e,Math.abs(t.added),Math.abs(t.removed)),0));return{domain:[-t,t],ticks:[-t,-t/2,0,t/2,t]}}function k(e){return Math.abs(e.height)<1?null:(0,x.jsx)(l,{...e})}function A({finding:e}){return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1 transition-colors`,children:[(0,x.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Short-lived executors: `,(0,x.jsxs)(`strong`,{children:[e.value,`%`]})]}),(0,x.jsx)(y,{finding:e}),(0,x.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,x.jsx)(m,{impactBand:e.impactBand,className:`mt-1.5`}),(0,x.jsxs)(`span`,{children:[e.recommendation,` `,(0,x.jsx)(p,{anchor:`#config-autoscale-bounds`,children:`Tuning executorIdleTimeout and the min/max bounds`}),`.`]})]})]})}var j=(0,b.memo)(function({appModel:e,activeFileId:t,catalog:l=[],defaultCollapsed:u=!0}){let p=(0,b.useMemo)(()=>{let t=e.executors.added,n=e.executors.removed;if(t.length===0&&n.length===0)return{hasEvents:!1,added:t,removed:n};let r=e.app,i=r?.startTime??0,a=r?.endTime??i,o=E(i,a),s=_(T(t,n,i,a,o)).map(e=>({t:`${Math.round((e.tStart-i)/1e3)}s`,added:e.adds,removed:-e.removes}));return{hasEvents:!0,added:t,removed:n,rows:s,yAxisScale:O(s)}},[e,t]);if(!p.hasEvents)return(0,x.jsx)(g,{title:`Autoscaling Churn`,summary:(0,x.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`No executor add/remove events (static allocation).`}),children:(0,x.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No executor add/remove events (static allocation).`})});let{added:m,removed:y,rows:S,yAxisScale:C}=p,D=l.find(e=>e.type===`autoscalingChurn`);return(0,x.jsx)(g,{title:`Autoscaling Churn`,impactBand:D?.impactBand,badges:D&&(0,x.jsx)(h,{type:`autoscalingChurn`,impactBand:D.impactBand}),defaultCollapsed:u,summary:(0,x.jsx)(v,{value:`${m.length} added / ${y.length} removed`,context:D?`${D.value}% short-lived executors, ${D.impactBand}`:`executor churn events`}),children:(0,x.jsxs)(`div`,{className:`space-y-2`,children:[D&&(0,x.jsx)(A,{finding:D}),(0,x.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`executors added / removed over time`}),(0,x.jsx)(d,{ariaLabel:`Executor added and removed counts per time bucket over the run.`,height:w,table:{caption:`Executor added/removed counts by time bucket`,columns:[`Time`,`Executors added`,`Executors removed`],rows:S.map(e=>[e.t,e.added,Math.abs(e.removed)]),align:[`right`,`right`,`right`]},children:(0,x.jsxs)(s,{data:S,children:[(0,x.jsx)(r,{stroke:f.muted,strokeOpacity:.2}),(0,x.jsx)(o,{dataKey:`t`,tick:{fontSize:10}}),(0,x.jsx)(a,{tick:{fontSize:10},width:32,domain:C.domain,ticks:C.ticks}),(0,x.jsx)(c,{formatter:(e,t)=>[Math.abs(Number(e)),t]}),(0,x.jsx)(n,{wrapperStyle:{fontSize:10}}),(0,x.jsx)(i,{dataKey:`added`,name:`Added`,stackId:`churn`,fill:f.clean,shape:k}),(0,x.jsx)(i,{dataKey:`removed`,name:`Removed`,stackId:`churn`,fill:f.muted,shape:k})]})})]})})});export{j as AutoscalingChurn};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,T as n,f as r,l as i,o as a,s as o,t as s,v as c,w as l}from"./charts-vendor-0VMaLVLN.js";import{p as u}from"./plan-graph-vendor-B0sEms9Z.js";import{T as d,w as f}from"./useRecentFiles-0XuhS91q.js";import{A as p,D as m,O as h,i as g}from"./index-pnImGbgQ.js";import{t as _}from"./downsample-WmNM1qc9.js";import{t as v}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as y}from"./ImpactEstimate-Df_laG-n.js";var b=e(t(),1),x=u(),S=60,C=6e4,w=220;function T(e,t,n,r,i){if(e.length===0&&t.length===0)return[];let a=Math.max(i,r-n),o=Math.max(1,Math.ceil(a/i)),s=[];for(let e=0;e<o;e++)s.push({tStart:n+e*i,adds:0,removes:0});let c=e=>Math.min(o-1,Math.max(0,Math.floor((e-n)/i)));for(let t of e)s[c(t.timestamp)].adds++;for(let e of t)s[c(e.timestamp)].removes++;return s}function E(e,t){let n=Math.max(1,t-e);return Math.max(C,Math.ceil(n/S))}function D(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e)),n=e/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function O(e){let t=D(e.reduce((e,t)=>Math.max(e,Math.abs(t.added),Math.abs(t.removed)),0));return{domain:[-t,t],ticks:[-t,-t/2,0,t/2,t]}}function k(e){return Math.abs(e.height)<1?null:(0,x.jsx)(l,{...e})}function A({finding:e}){return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1 transition-colors`,children:[(0,x.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Short-lived executors: `,(0,x.jsxs)(`strong`,{children:[e.value,`%`]})]}),(0,x.jsx)(y,{finding:e}),(0,x.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,x.jsx)(m,{impactBand:e.impactBand,className:`mt-1.5`}),(0,x.jsxs)(`span`,{children:[e.recommendation,` `,(0,x.jsx)(p,{anchor:`#config-autoscale-bounds`,children:`Tuning executorIdleTimeout and the min/max bounds`}),`.`]})]})]})}var j=(0,b.memo)(function({appModel:e,activeFileId:t,catalog:l=[],defaultCollapsed:u=!0}){let p=(0,b.useMemo)(()=>{let t=e.executors.added,n=e.executors.removed;if(t.length===0&&n.length===0)return{hasEvents:!1,added:t,removed:n};let r=e.app,i=r?.startTime??0,a=r?.endTime??i,o=E(i,a),s=_(T(t,n,i,a,o)).map(e=>({t:`${Math.round((e.tStart-i)/1e3)}s`,added:e.adds,removed:-e.removes}));return{hasEvents:!0,added:t,removed:n,rows:s,yAxisScale:O(s)}},[e,t]);if(!p.hasEvents)return(0,x.jsx)(g,{title:`Autoscaling Churn`,summary:(0,x.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`No executor add/remove events (static allocation).`}),children:(0,x.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No executor add/remove events (static allocation).`})});let{added:m,removed:y,rows:S,yAxisScale:C}=p,D=l.find(e=>e.type===`autoscalingChurn`);return(0,x.jsx)(g,{title:`Autoscaling Churn`,impactBand:D?.impactBand,badges:D&&(0,x.jsx)(h,{type:`autoscalingChurn`,impactBand:D.impactBand}),defaultCollapsed:u,summary:(0,x.jsx)(v,{value:`${m.length} added / ${y.length} removed`,context:D?`${D.value}% short-lived executors, ${D.impactBand}`:`executor churn events`}),children:(0,x.jsxs)(`div`,{className:`space-y-2`,children:[D&&(0,x.jsx)(A,{finding:D}),(0,x.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`executors added / removed over time`}),(0,x.jsx)(d,{ariaLabel:`Executor added and removed counts per time bucket over the run.`,height:w,table:{caption:`Executor added/removed counts by time bucket`,columns:[`Time`,`Executors added`,`Executors removed`],rows:S.map(e=>[e.t,e.added,Math.abs(e.removed)]),align:[`right`,`right`,`right`]},children:(0,x.jsxs)(s,{data:S,children:[(0,x.jsx)(r,{stroke:f.muted,strokeOpacity:.2}),(0,x.jsx)(o,{dataKey:`t`,tick:{fontSize:10}}),(0,x.jsx)(a,{tick:{fontSize:10},width:32,domain:C.domain,ticks:C.ticks}),(0,x.jsx)(c,{formatter:(e,t)=>[Math.abs(Number(e)),t]}),(0,x.jsx)(n,{wrapperStyle:{fontSize:10}}),(0,x.jsx)(i,{dataKey:`added`,name:`Added`,stackId:`churn`,fill:f.clean,shape:k}),(0,x.jsx)(i,{dataKey:`removed`,name:`Removed`,stackId:`churn`,fill:f.muted,shape:k})]})})]})})});export{j as AutoscalingChurn};
@@ -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-B0sEms9Z.js";import{A as r,D as i,O as a,_ as o,b as s,bt as c,gt as l,h as u,ht as d,i as f,k as p,l as m,m as h,ot as g,pt as _,ut as v,v as y,y as b}from"./index-U654cmB8.js";import{t as x}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as S}from"./ImpactEstimate-BHcqJkcZ.js";import{t as C}from"./RowPagination-oeWB8gBm.js";import{n as w}from"./finding-anchor-Bl1hRK5E.js";import{t as T}from"./usePagedRows-jNUWgVTD.js";var E=e(t(),1),D=n(),O=70;function k(e){if(!e)return`—`;let t=[];return e.useMemory&&t.push(`Memory`),e.useDisk&&t.push(`Disk`),e.deserialized?t.push(`Deserialized`):(e.useMemory||e.useDisk)&&t.push(`Serialized`),(e.replication??1)>1&&t.push(`x${e.replication}`),t.join(` · `)||`—`}function A(e){return e.name||`RDD ${e.id}`}function j(e){let t=l(A(e));return t.length<=O?t:`${t.slice(0,O)}…`}function M(e){let t=_(`pct`,d(e));return e.variant===`diskSpillover`?`${t} spilled to disk: ${v(e.diskSize??0)} disk / ${v(e.memorySize??0)} memory`:`${t} cached (${e.numCachedPartitions??0}/${e.numPartitions??0} partitions)`}function N({finding:e}){let t=w([e]),n=e.rddName??`RDD ${e.rddId}`;return(0,D.jsxs)(`div`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 transition-colors ${t.flashClassName}`,children:[(0,D.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2`,children:[(0,D.jsx)(i,{impactBand:e.impactBand,className:`mt-1.5`}),(0,D.jsx)(`span`,{children:n})]}),(0,D.jsx)(p,{children:(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M(e)})}),(0,D.jsx)(S,{finding:e}),(0,D.jsx)(`p`,{className:`text-sm`,children:e.recommendation})]})}var P=(0,E.memo)(function({appModel:e,catalog:t}){let[n,l]=(0,E.useState)(0),[d,p]=(0,E.useState)(0),_=e.app?.rddInfo,S=(0,E.useMemo)(()=>_?[..._.values()].filter(e=>(e.storageLevel?.useMemory||e.storageLevel?.useDisk)&&(e.numCachedPartitions??0)>0).sort((e,t)=>(t.memorySize??0)+(t.diskSize??0)-((e.memorySize??0)+(e.diskSize??0))):[],[_]),w=(0,E.useMemo)(()=>t.filter(e=>e.type===`cacheUtilization`).sort((e,t)=>g[e.impactBand]-g[t.impactBand]),[t]),O=T(S,n,l),M=m(),P=M?w.findIndex(e=>e===M.finding):null,F=T(w,d,p,P);if(S.length===0)return null;let I=e=>w.filter(t=>t.rddId===e),L=S.reduce((e,t)=>e+(t.memorySize??0)+(t.diskSize??0),0);return(0,D.jsx)(`div`,{"data-widget":`cache-utilization`,children:(0,D.jsxs)(f,{title:`Cache Storage`,impactBand:c(w),badges:(0,D.jsxs)(D.Fragment,{children:[w.length>0?(0,D.jsx)(a,{type:`cacheUtilization`,impactBand:c(w)??`info`}):null,(0,D.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[S.length,` cached RDD`,S.length===1?``:`s`,`, see`,` `,(0,D.jsx)(r,{anchor:`#memory-model`,children:`how Spark accounts cached memory`})]})]}),defaultCollapsed:!0,summary:(0,D.jsx)(x,{value:v(L),context:`cached across memory + disk`}),children:[(0,D.jsxs)(h,{children:[(0,D.jsx)(b,{children:(0,D.jsxs)(s,{children:[(0,D.jsx)(y,{children:`RDD`}),(0,D.jsx)(y,{children:`Storage level`}),(0,D.jsx)(y,{className:`text-right`,children:`Cached partitions`}),(0,D.jsx)(y,{className:`text-right`,children:`Memory`}),(0,D.jsx)(y,{className:`text-right`,children:`Disk`})]})}),(0,D.jsx)(u,{children:O.visible.map(e=>{let t=A(e),n=j(e),r=I(e.id);return(0,D.jsxs)(s,{children:[(0,D.jsxs)(o,{className:`max-w-80 truncate`,title:t===n?void 0:t,children:[n,r.length>0&&(0,D.jsx)(i,{impactBand:c(r)??`info`,className:`ml-1.5`})]}),(0,D.jsx)(o,{children:k(e.storageLevel)}),(0,D.jsxs)(o,{className:`text-right`,children:[e.numCachedPartitions,` / `,e.numPartitions]}),(0,D.jsx)(o,{className:`text-right`,children:v(e.memorySize??0)}),(0,D.jsx)(o,{className:`text-right`,children:v(e.diskSize??0)})]},e.id)})})]}),(0,D.jsx)(C,{page:O.effectivePage,totalPages:O.totalPages,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1)}),w.length>0?(0,D.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm`,children:[F.visible.map(e=>(0,D.jsx)(N,{finding:e},e.id)),(0,D.jsx)(C,{page:F.effectivePage,totalPages:F.totalPages,onPrev:()=>p(e=>e-1),onNext:()=>p(e=>e+1)})]}):null]})})});export{P as CacheUtilization};
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-B0sEms9Z.js";import{A as r,D as i,O as a,_ as o,b as s,bt as c,gt as l,h as u,ht as d,i as f,k as p,l as m,m as h,ot as g,pt as _,ut as v,v as y,y as b}from"./index-pnImGbgQ.js";import{t as x}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as S}from"./ImpactEstimate-Df_laG-n.js";import{t as C}from"./RowPagination-2icPidMP.js";import{n as w}from"./finding-anchor-CDbHtqKT.js";import{t as T}from"./usePagedRows-jNUWgVTD.js";var E=e(t(),1),D=n(),O=70;function k(e){if(!e)return`—`;let t=[];return e.useMemory&&t.push(`Memory`),e.useDisk&&t.push(`Disk`),e.deserialized?t.push(`Deserialized`):(e.useMemory||e.useDisk)&&t.push(`Serialized`),(e.replication??1)>1&&t.push(`x${e.replication}`),t.join(` · `)||`—`}function A(e){return e.name||`RDD ${e.id}`}function j(e){let t=l(A(e));return t.length<=O?t:`${t.slice(0,O)}…`}function M(e){let t=_(`pct`,d(e));return e.variant===`diskSpillover`?`${t} spilled to disk: ${v(e.diskSize??0)} disk / ${v(e.memorySize??0)} memory`:`${t} cached (${e.numCachedPartitions??0}/${e.numPartitions??0} partitions)`}function N({finding:e}){let t=w([e]),n=e.rddName??`RDD ${e.rddId}`;return(0,D.jsxs)(`div`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 transition-colors ${t.flashClassName}`,children:[(0,D.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2`,children:[(0,D.jsx)(i,{impactBand:e.impactBand,className:`mt-1.5`}),(0,D.jsx)(`span`,{children:n})]}),(0,D.jsx)(p,{children:(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M(e)})}),(0,D.jsx)(S,{finding:e}),(0,D.jsx)(`p`,{className:`text-sm`,children:e.recommendation})]})}var P=(0,E.memo)(function({appModel:e,catalog:t}){let[n,l]=(0,E.useState)(0),[d,p]=(0,E.useState)(0),_=e.app?.rddInfo,S=(0,E.useMemo)(()=>_?[..._.values()].filter(e=>(e.storageLevel?.useMemory||e.storageLevel?.useDisk)&&(e.numCachedPartitions??0)>0).sort((e,t)=>(t.memorySize??0)+(t.diskSize??0)-((e.memorySize??0)+(e.diskSize??0))):[],[_]),w=(0,E.useMemo)(()=>t.filter(e=>e.type===`cacheUtilization`).sort((e,t)=>g[e.impactBand]-g[t.impactBand]),[t]),O=T(S,n,l),M=m(),P=M?w.findIndex(e=>e===M.finding):null,F=T(w,d,p,P);if(S.length===0)return null;let I=e=>w.filter(t=>t.rddId===e),L=S.reduce((e,t)=>e+(t.memorySize??0)+(t.diskSize??0),0);return(0,D.jsx)(`div`,{"data-widget":`cache-utilization`,children:(0,D.jsxs)(f,{title:`Cache Storage`,impactBand:c(w),badges:(0,D.jsxs)(D.Fragment,{children:[w.length>0?(0,D.jsx)(a,{type:`cacheUtilization`,impactBand:c(w)??`info`}):null,(0,D.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[S.length,` cached RDD`,S.length===1?``:`s`,`, see`,` `,(0,D.jsx)(r,{anchor:`#memory-model`,children:`how Spark accounts cached memory`})]})]}),defaultCollapsed:!0,summary:(0,D.jsx)(x,{value:v(L),context:`cached across memory + disk`}),children:[(0,D.jsxs)(h,{children:[(0,D.jsx)(b,{children:(0,D.jsxs)(s,{children:[(0,D.jsx)(y,{children:`RDD`}),(0,D.jsx)(y,{children:`Storage level`}),(0,D.jsx)(y,{className:`text-right`,children:`Cached partitions`}),(0,D.jsx)(y,{className:`text-right`,children:`Memory`}),(0,D.jsx)(y,{className:`text-right`,children:`Disk`})]})}),(0,D.jsx)(u,{children:O.visible.map(e=>{let t=A(e),n=j(e),r=I(e.id);return(0,D.jsxs)(s,{children:[(0,D.jsxs)(o,{className:`max-w-80 truncate`,title:t===n?void 0:t,children:[n,r.length>0&&(0,D.jsx)(i,{impactBand:c(r)??`info`,className:`ml-1.5`})]}),(0,D.jsx)(o,{children:k(e.storageLevel)}),(0,D.jsxs)(o,{className:`text-right`,children:[e.numCachedPartitions,` / `,e.numPartitions]}),(0,D.jsx)(o,{className:`text-right`,children:v(e.memorySize??0)}),(0,D.jsx)(o,{className:`text-right`,children:v(e.diskSize??0)})]},e.id)})})]}),(0,D.jsx)(C,{page:O.effectivePage,totalPages:O.totalPages,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1)}),w.length>0?(0,D.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm`,children:[F.visible.map(e=>(0,D.jsx)(N,{finding:e},e.id)),(0,D.jsx)(C,{page:F.effectivePage,totalPages:F.totalPages,onPrev:()=>p(e=>e-1),onNext:()=>p(e=>e+1)})]}):null]})})});export{P as CacheUtilization};
@@ -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-B0sEms9Z.js";import{S as r}from"./useRecentFiles-BiYdWs8J.js";import{At as i,O as a,_ as o,b as s,h as c,i as l,j as u,k as d,l as f,m as p,ut as m,v as h,y as g}from"./index-U654cmB8.js";import{t as _}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as v}from"./ImpactEstimate-BHcqJkcZ.js";import{t as y}from"./RowPagination-oeWB8gBm.js";import{n as b}from"./finding-anchor-Bl1hRK5E.js";import{t as x}from"./usePagedRows-jNUWgVTD.js";var S={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};S.node;var C=i(S),w=e(t(),1),T=n();function E({relations:e,operator:t}){let n=t===`union`?`union`:`join`;return(0,T.jsx)(`span`,{className:`inline-flex flex-wrap items-baseline`,children:e.map((e,t)=>(0,T.jsxs)(`span`,{children:[t>0?(0,T.jsxs)(T.Fragment,{children:[` `,(0,T.jsx)(`span`,{className:`mx-1 font-semibold uppercase text-xs tracking-wide text-primary`,children:n}),` `]}):null,e.relation]},e.relation))})}function D({finding:e}){let t=b([e]),n=e.variant===`composite`;return(0,T.jsxs)(s,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`transition-colors ${t.flashClassName}`,children:[(0,T.jsx)(o,{children:(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[n?(0,T.jsx)(C,{className:`size-3.5 text-muted-foreground`,"aria-hidden":`true`}):null,n&&e.relations&&e.relations.length>0?(0,T.jsx)(E,{relations:e.relations,operator:e.operator}):(0,T.jsx)(`span`,{children:e.relation}),n?(0,T.jsx)(u,{variant:`outline`,className:`text-xs uppercase border-dashed`,children:e.operator?.toUpperCase()}):(0,T.jsx)(u,{variant:`secondary`,className:`text-xs uppercase`,children:e.format})]})}),(0,T.jsxs)(o,{children:[e.value,` queries`]}),(0,T.jsx)(o,{className:`text-right`,children:m(e.totalReadBytes??0)}),(0,T.jsxs)(o,{children:[(0,T.jsx)(v,{finding:e}),(0,T.jsx)(`p`,{className:`mt-1`,children:e.recommendation}),(0,T.jsx)(d,{children:(0,T.jsx)(r,{confidence:e.confidence,validationRequired:e.validationRequired})})]})]})}var O=(0,w.memo)(function({catalog:e,defaultCollapsed:t=!0}){let[n,r]=(0,w.useState)(0),i=(0,w.useMemo)(()=>e.filter(e=>e.type===`cachingOpportunity`).sort((e,t)=>(t.totalReadBytes??0)-(e.totalReadBytes??0)||(typeof t.value==`number`?t.value:0)-(typeof e.value==`number`?e.value:0)),[e]),o=f(),u=o?i.findIndex(e=>e===o.finding):null,{totalPages:m,effectivePage:v,visible:b}=x(i,n,r,u);if(i.length===0)return null;let S=i[0];return(0,T.jsx)(l,{title:`Caching Opportunities`,impactBand:`info`,badges:(0,T.jsx)(a,{type:`cachingOpportunity`,impactBand:`info`}),defaultCollapsed:t,summary:(0,T.jsx)(_,{value:`${S.value}×`,context:`read by ${S.value} queries: ${S.relation}`}),children:(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsxs)(p,{children:[(0,T.jsx)(g,{children:(0,T.jsxs)(s,{children:[(0,T.jsx)(h,{children:`Relation`}),(0,T.jsx)(h,{children:`Read by`}),(0,T.jsx)(h,{className:`text-right`,children:`Data read`}),(0,T.jsx)(h,{children:`Recommendation`})]})}),(0,T.jsx)(c,{children:b.map((e,t)=>(0,T.jsx)(D,{finding:e},`${e.format}:${e.relation}:${(e.executionIds??[]).join(`,`)}:${t}`))})]}),(0,T.jsx)(d,{children:(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Reuse is inferred from plan structure, not confirmed by execution. Verify before caching.`})}),(0,T.jsx)(y,{page:v,totalPages:m,onPrev:()=>r(e=>e-1),onNext:()=>r(e=>e+1)})]})})});export{O as CachingOpportunity};
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-B0sEms9Z.js";import{S as r}from"./useRecentFiles-0XuhS91q.js";import{At as i,O as a,_ as o,b as s,h as c,i as l,j as u,k as d,l as f,m as p,ut as m,v as h,y as g}from"./index-pnImGbgQ.js";import{t as _}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as v}from"./ImpactEstimate-Df_laG-n.js";import{t as y}from"./RowPagination-2icPidMP.js";import{n as b}from"./finding-anchor-CDbHtqKT.js";import{t as x}from"./usePagedRows-jNUWgVTD.js";var S={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};S.node;var C=i(S),w=e(t(),1),T=n();function E({relations:e,operator:t}){let n=t===`union`?`union`:`join`;return(0,T.jsx)(`span`,{className:`inline-flex flex-wrap items-baseline`,children:e.map((e,t)=>(0,T.jsxs)(`span`,{children:[t>0?(0,T.jsxs)(T.Fragment,{children:[` `,(0,T.jsx)(`span`,{className:`mx-1 font-semibold uppercase text-xs tracking-wide text-primary`,children:n}),` `]}):null,e.relation]},e.relation))})}function D({finding:e}){let t=b([e]),n=e.variant===`composite`;return(0,T.jsxs)(s,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`transition-colors ${t.flashClassName}`,children:[(0,T.jsx)(o,{children:(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[n?(0,T.jsx)(C,{className:`size-3.5 text-muted-foreground`,"aria-hidden":`true`}):null,n&&e.relations&&e.relations.length>0?(0,T.jsx)(E,{relations:e.relations,operator:e.operator}):(0,T.jsx)(`span`,{children:e.relation}),n?(0,T.jsx)(u,{variant:`outline`,className:`text-xs uppercase border-dashed`,children:e.operator?.toUpperCase()}):(0,T.jsx)(u,{variant:`secondary`,className:`text-xs uppercase`,children:e.format})]})}),(0,T.jsxs)(o,{children:[e.value,` queries`]}),(0,T.jsx)(o,{className:`text-right`,children:m(e.totalReadBytes??0)}),(0,T.jsxs)(o,{children:[(0,T.jsx)(v,{finding:e}),(0,T.jsx)(`p`,{className:`mt-1`,children:e.recommendation}),(0,T.jsx)(d,{children:(0,T.jsx)(r,{confidence:e.confidence,validationRequired:e.validationRequired})})]})]})}var O=(0,w.memo)(function({catalog:e,defaultCollapsed:t=!0}){let[n,r]=(0,w.useState)(0),i=(0,w.useMemo)(()=>e.filter(e=>e.type===`cachingOpportunity`).sort((e,t)=>(t.totalReadBytes??0)-(e.totalReadBytes??0)||(typeof t.value==`number`?t.value:0)-(typeof e.value==`number`?e.value:0)),[e]),o=f(),u=o?i.findIndex(e=>e===o.finding):null,{totalPages:m,effectivePage:v,visible:b}=x(i,n,r,u);if(i.length===0)return null;let S=i[0];return(0,T.jsx)(l,{title:`Caching Opportunities`,impactBand:`info`,badges:(0,T.jsx)(a,{type:`cachingOpportunity`,impactBand:`info`}),defaultCollapsed:t,summary:(0,T.jsx)(_,{value:`${S.value}×`,context:`read by ${S.value} queries: ${S.relation}`}),children:(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsxs)(p,{children:[(0,T.jsx)(g,{children:(0,T.jsxs)(s,{children:[(0,T.jsx)(h,{children:`Relation`}),(0,T.jsx)(h,{children:`Read by`}),(0,T.jsx)(h,{className:`text-right`,children:`Data read`}),(0,T.jsx)(h,{children:`Recommendation`})]})}),(0,T.jsx)(c,{children:b.map((e,t)=>(0,T.jsx)(D,{finding:e},`${e.format}:${e.relation}:${(e.executionIds??[]).join(`,`)}:${t}`))})]}),(0,T.jsx)(d,{children:(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Reuse is inferred from plan structure, not confirmed by execution. Verify before caching.`})}),(0,T.jsx)(y,{page:v,totalPages:m,onPrev:()=>r(e=>e-1),onNext:()=>r(e=>e+1)})]})})});export{O as CachingOpportunity};
@@ -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-B0sEms9Z.js";import{D as r,O as i,i as a,l as o,ot as s}from"./index-U654cmB8.js";import{t as c}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as l}from"./ImpactEstimate-BHcqJkcZ.js";import{t as u}from"./RowPagination-oeWB8gBm.js";import{r as d}from"./impact-sort-DxaUheWV.js";import{n as f}from"./finding-anchor-Bl1hRK5E.js";import{t as p}from"./usePagedRows-jNUWgVTD.js";import{n as m,t as h}from"./useSortMode-BhPky1lW.js";var g=e(t(),1),_=n();function v(e){return`${e.value}s`}function y({finding:e}){let t=f([e]);return(0,_.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 text-sm transition-colors ${t.flashClassName}`,children:[(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,_.jsx)(r,{impactBand:e.impactBand}),(0,_.jsx)(`strong`,{children:v(e)})]}),(0,_.jsx)(l,{finding:e}),(0,_.jsx)(`p`,{className:`text-muted-foreground pt-1`,children:e.recommendation})]})}var b=(0,g.memo)(function({catalog:e,defaultCollapsed:t=!0}){let{sortMode:n,setSortMode:r,orderBy:l}=h(),[f,b]=(0,g.useState)(!t),[x,S]=(0,g.useState)(0),C=e.filter(e=>e.type===`coldStart`).slice().sort((e,t)=>s[e.impactBand]-s[t.impactBand]),w=l(C,e=>[e],e=>e.stageId??null),T=o(),E=T?w.findIndex(e=>e===T.finding):null,{totalPages:D,effectivePage:O,visible:k}=p(w,x,S,E);return C.length===0?null:(0,_.jsxs)(a,{title:`Cold Start`,impactBand:C[0].impactBand,badges:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(i,{type:`coldStart`,impactBand:C[0].impactBand}),d(C,C.length,f)?(0,_.jsx)(m,{mode:n,onChange:r}):null]}),open:f,onOpenChange:b,summary:(0,_.jsx)(c,{value:v(C[0]),context:`${C.length} issue${C.length===1?``:`s`} flagged`}),children:[(0,_.jsx)(`ul`,{className:`space-y-2`,children:k.map(e=>(0,_.jsx)(y,{finding:e},e.id))}),(0,_.jsx)(u,{page:O,totalPages:D,onPrev:()=>S(e=>e-1),onNext:()=>S(e=>e+1)})]})});export{b as ColdStart};
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-B0sEms9Z.js";import{D as r,O as i,i as a,l as o,ot as s}from"./index-pnImGbgQ.js";import{t as c}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as l}from"./ImpactEstimate-Df_laG-n.js";import{t as u}from"./RowPagination-2icPidMP.js";import{r as d}from"./impact-sort-DxaUheWV.js";import{n as f}from"./finding-anchor-CDbHtqKT.js";import{t as p}from"./usePagedRows-jNUWgVTD.js";import{n as m,t as h}from"./useSortMode-DHlKZeWv.js";var g=e(t(),1),_=n();function v(e){return`${e.value}s`}function y({finding:e}){let t=f([e]);return(0,_.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 text-sm transition-colors ${t.flashClassName}`,children:[(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,_.jsx)(r,{impactBand:e.impactBand}),(0,_.jsx)(`strong`,{children:v(e)})]}),(0,_.jsx)(l,{finding:e}),(0,_.jsx)(`p`,{className:`text-muted-foreground pt-1`,children:e.recommendation})]})}var b=(0,g.memo)(function({catalog:e,defaultCollapsed:t=!0}){let{sortMode:n,setSortMode:r,orderBy:l}=h(),[f,b]=(0,g.useState)(!t),[x,S]=(0,g.useState)(0),C=e.filter(e=>e.type===`coldStart`).slice().sort((e,t)=>s[e.impactBand]-s[t.impactBand]),w=l(C,e=>[e],e=>e.stageId??null),T=o(),E=T?w.findIndex(e=>e===T.finding):null,{totalPages:D,effectivePage:O,visible:k}=p(w,x,S,E);return C.length===0?null:(0,_.jsxs)(a,{title:`Cold Start`,impactBand:C[0].impactBand,badges:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(i,{type:`coldStart`,impactBand:C[0].impactBand}),d(C,C.length,f)?(0,_.jsx)(m,{mode:n,onChange:r}):null]}),open:f,onOpenChange:b,summary:(0,_.jsx)(c,{value:v(C[0]),context:`${C.length} issue${C.length===1?``:`s`} flagged`}),children:[(0,_.jsx)(`ul`,{className:`space-y-2`,children:k.map(e=>(0,_.jsx)(y,{finding:e},e.id))}),(0,_.jsx)(u,{page:O,totalPages:D,onPrev:()=>S(e=>e-1),onNext:()=>S(e=>e+1)})]})});export{b as ColdStart};
@@ -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-B0sEms9Z.js";import{S as r}from"./useRecentFiles-BiYdWs8J.js";import{A as i,D as a,H as o,N as s,O as c,bt as l,i as u,k as d,l as f,ot as p}from"./index-U654cmB8.js";import{t as m}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as h}from"./ImpactEstimate-BHcqJkcZ.js";import{t as g}from"./RowPagination-oeWB8gBm.js";import{n as _}from"./finding-anchor-Bl1hRK5E.js";import{t as v}from"./usePagedRows-jNUWgVTD.js";var y=e(t(),1),b=n();function x({finding:e}){let t=_([e]);return(0,b.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 transition-colors ${t.flashClassName}`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(a,{impactBand:e.impactBand}),(0,b.jsx)(`code`,{className:`text-xs`,children:e.property}),(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`=`}),(0,b.jsx)(`code`,{className:`rounded bg-accent/10 px-1.5 py-0.5 font-mono text-xs text-accent`,children:String(e.value)})]}),(0,b.jsx)(h,{finding:e}),(0,b.jsxs)(`p`,{className:`text-sm`,children:[e.recommendation,e.docAnchor?(0,b.jsxs)(b.Fragment,{children:[` `,(0,b.jsxs)(i,{anchor:e.docAnchor,children:[`Why `,e.property,` matters`]})]}):null]})]})}var S=(0,y.memo)(function({appModel:e,configFindings:t,defaultCollapsed:n=!0}){let[i,a]=(0,y.useState)(0),h=(0,y.useMemo)(()=>(t??o(e.app)).filter(e=>e.type===`configAudit`).slice().sort((e,t)=>p[e.impactBand]-p[t.impactBand]),[t,e]),_=f(),S=_?h.findIndex(e=>e===_.finding):null,{totalPages:C,effectivePage:w,visible:T}=v(h,i,a,S);if(h.length===0){let t=e.evidenceAvailability?.entries.find(e=>e.key===`sparkConfiguration`),n;if(t)n=t.state===`present`?`No misconfigurations detected.`:t.state===`unknown`&&t.reasonCode===`parseIncomplete`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`span`,{children:[t.summary,` `]}),(0,b.jsx)(d,{children:(0,b.jsx)(r,{evidenceKey:`sparkConfiguration`})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{children:`No environment info captured in this log. `}),(0,b.jsx)(d,{children:(0,b.jsx)(r,{evidenceKey:`sparkConfiguration`})})]});else{let t=e.app?.evidenceInputs;n=(t?t.environmentUpdates>0:Object.keys(e.app?.config??{}).length>0||e.app?.resources)?`No misconfigurations detected.`:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{children:`No environment info captured in this log. `}),(0,b.jsx)(d,{children:(0,b.jsx)(r,{evidenceKey:`sparkConfiguration`})})]})}let i=(0,b.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:n});return(0,b.jsx)(u,{title:`Config Sanity`,compact:!0,summary:i,children:i})}let E=l(h);return(0,b.jsxs)(u,{title:`Config Sanity`,impactBand:E,badges:(0,b.jsx)(c,{type:`configAudit`,impactBand:E??`info`,docAnchor:s(h)}),statusBadge:(0,b.jsx)(d,{children:(0,b.jsx)(r,{evidenceKey:`sparkConfiguration`})}),defaultCollapsed:n,summary:(0,b.jsx)(m,{value:`${h.length}`,context:`misconfiguration${h.length===1?``:`s`} flagged`}),children:[(0,b.jsx)(`ul`,{className:`space-y-4`,children:T.map(e=>(0,b.jsx)(x,{finding:e},e.id))}),(0,b.jsx)(g,{page:w,totalPages:C,onPrev:()=>a(e=>e-1),onNext:()=>a(e=>e+1)})]})});export{S as ConfigAudit};
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-B0sEms9Z.js";import{S as r}from"./useRecentFiles-0XuhS91q.js";import{A as i,D as a,H as o,N as s,O as c,bt as l,i as u,k as d,l as f,ot as p}from"./index-pnImGbgQ.js";import{t as m}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as h}from"./ImpactEstimate-Df_laG-n.js";import{t as g}from"./RowPagination-2icPidMP.js";import{n as _}from"./finding-anchor-CDbHtqKT.js";import{t as v}from"./usePagedRows-jNUWgVTD.js";var y=e(t(),1),b=n();function x({finding:e}){let t=_([e]);return(0,b.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 transition-colors ${t.flashClassName}`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(a,{impactBand:e.impactBand}),(0,b.jsx)(`code`,{className:`text-xs`,children:e.property}),(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`=`}),(0,b.jsx)(`code`,{className:`rounded bg-accent/10 px-1.5 py-0.5 font-mono text-xs text-accent`,children:String(e.value)})]}),(0,b.jsx)(h,{finding:e}),(0,b.jsxs)(`p`,{className:`text-sm`,children:[e.recommendation,e.docAnchor?(0,b.jsxs)(b.Fragment,{children:[` `,(0,b.jsxs)(i,{anchor:e.docAnchor,children:[`Why `,e.property,` matters`]})]}):null]})]})}var S=(0,y.memo)(function({appModel:e,configFindings:t,defaultCollapsed:n=!0}){let[i,a]=(0,y.useState)(0),h=(0,y.useMemo)(()=>(t??o(e.app)).filter(e=>e.type===`configAudit`).slice().sort((e,t)=>p[e.impactBand]-p[t.impactBand]),[t,e]),_=f(),S=_?h.findIndex(e=>e===_.finding):null,{totalPages:C,effectivePage:w,visible:T}=v(h,i,a,S);if(h.length===0){let t=e.evidenceAvailability?.entries.find(e=>e.key===`sparkConfiguration`),n;if(t)n=t.state===`present`?`No misconfigurations detected.`:t.state===`unknown`&&t.reasonCode===`parseIncomplete`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`span`,{children:[t.summary,` `]}),(0,b.jsx)(d,{children:(0,b.jsx)(r,{evidenceKey:`sparkConfiguration`})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{children:`No environment info captured in this log. `}),(0,b.jsx)(d,{children:(0,b.jsx)(r,{evidenceKey:`sparkConfiguration`})})]});else{let t=e.app?.evidenceInputs;n=(t?t.environmentUpdates>0:Object.keys(e.app?.config??{}).length>0||e.app?.resources)?`No misconfigurations detected.`:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{children:`No environment info captured in this log. `}),(0,b.jsx)(d,{children:(0,b.jsx)(r,{evidenceKey:`sparkConfiguration`})})]})}let i=(0,b.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:n});return(0,b.jsx)(u,{title:`Config Sanity`,compact:!0,summary:i,children:i})}let E=l(h);return(0,b.jsxs)(u,{title:`Config Sanity`,impactBand:E,badges:(0,b.jsx)(c,{type:`configAudit`,impactBand:E??`info`,docAnchor:s(h)}),statusBadge:(0,b.jsx)(d,{children:(0,b.jsx)(r,{evidenceKey:`sparkConfiguration`})}),defaultCollapsed:n,summary:(0,b.jsx)(m,{value:`${h.length}`,context:`misconfiguration${h.length===1?``:`s`} flagged`}),children:[(0,b.jsx)(`ul`,{className:`space-y-4`,children:T.map(e=>(0,b.jsx)(x,{finding:e},e.id))}),(0,b.jsx)(g,{page:w,totalPages:C,onPrev:()=>a(e=>e-1),onNext:()=>a(e=>e+1)})]})});export{S as ConfigAudit};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,T as n,f as r,n as i,o as a,s as o,u as s,v as c}from"./charts-vendor-0VMaLVLN.js";import{p as l}from"./plan-graph-vendor-B0sEms9Z.js";import{S as u,T as d,w as f}from"./useRecentFiles-BiYdWs8J.js";import{t as p}from"./inbox-DHIFHqcn.js";import{A as m,D as h,J as g,O as _,i as v,k as y}from"./index-U654cmB8.js";import{t as b}from"./EmptyState-CnTrSjtU.js";import{t as x}from"./downsample-WmNM1qc9.js";import{t as S}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as C}from"./ImpactEstimate-BHcqJkcZ.js";import{t as w}from"./RowPagination-oeWB8gBm.js";import{t as T}from"./usePagedRows-jNUWgVTD.js";var E=e(t(),1),D=[`PROCESS_LOCAL`,`NODE_LOCAL`,`RACK_LOCAL`,`NO_PREF`,`ANY`];function O(e,{bucketWidthMs:t=6e4,tiers:n=D}={}){let r=e.filter(e=>(e.completedAt??0)>(e.submittedAt??0)&&(e.executorRunTime??0)>0);if(r.length===0)return{labels:[],series:{}};let i=r.reduce((e,t)=>Math.min(e,t.submittedAt??e),1/0),a=r.reduce((e,t)=>Math.max(e,t.completedAt??e),-1/0),o=Math.max(1,Math.ceil((a-i)/t)),s={};for(let e of n)s[e]=Array(o).fill(0);let c=Array(o).fill(0);for(let e of r){let n=e.completedAt??0,r=e.submittedAt??0,a=n-r,l=(e.executorRunTime??0)/a,u=(e.localityStats??[]).reduce((e,t)=>e+t.count,0)||1,d=new Map((e.localityStats??[]).map(e=>[e.locality,e.count/u]));for(let e=0;e<o;e++){let a=i+e*t,o=a+t,u=Math.min(n,o)-Math.max(r,a);if(u<=0)continue;let f=u/t;for(let[t,n]of d){let r=l*n*f;s[t]?s[t][e]+=r:c[e]+=r}}}c.some(e=>e>0)&&(s.OTHER=c);let l=Array(o).fill(0);for(let e of Object.keys(s))for(let t=0;t<o;t++)l[t]+=s[e][t];let u=l.reduce((e,t)=>Math.max(e,t),0);s.idle=l.map(e=>Math.max(0,u-e));let d=[];for(let e=0;e<o;e++)d.push(i+e*t);return{labels:d,series:s}}var k=l(),A=240,j=60,M={PROCESS_LOCAL:`Process-local`,NODE_LOCAL:`Node-local`,RACK_LOCAL:`Rack-local`,NO_PREF:`No preference`,ANY:`Any`,OTHER:`Other`,idle:`Idle`},N={PROCESS_LOCAL:f.clean,NODE_LOCAL:f.accent,RACK_LOCAL:f.warning,NO_PREF:f.muted,ANY:f.critical,OTHER:f.muted,idle:f.muted},P=`Core Usage by Locality`,F=(0,E.memo)(function({appModel:e,catalog:t,activeFileId:l,defaultCollapsed:F=!0}){let[I,L]=(0,E.useState)(0),R=(0,E.useMemo)(()=>{let t=[...e.stages.values()];if(!t.some(e=>(e.executorRunTime??0)>0&&(e.completedAt??0)>(e.submittedAt??0)))return{hasActivity:!1};let n=e.app,r=n?.startTime??0,i=n?.endTime??r,{labels:a,series:o}=O(t,{bucketWidthMs:Math.max(6e4,Math.ceil(Math.max(1,i-r)/j))}),s=[...D.filter(e=>o[e]),...o.OTHER?[`OTHER`]:[],`idle`],c=a.map((e,t)=>{let n={t:Math.round((e-r)/1e3)};for(let e of s)n[e]=o[e]?.[t]??0;return n}),l=x(c),u=s.filter(e=>e!==`idle`);return{hasActivity:!0,order:s,points:c,sampled:l,peakCores:c.reduce((e,t)=>Math.max(e,u.reduce((e,n)=>e+t[n],0)),0)}},[e,l]),z=(0,E.useMemo)(()=>g([...e.stages.values()],{topN:1/0}),[e,l]),B=t.find(e=>e.type===`coreLocality`),V=t.some(e=>e.type===`memoryUtilization`&&e.variant===`idleCores`),H=z.topStages.filter(e=>e.nonLocalTasks>0),{totalPages:U,effectivePage:W,visible:G}=T(H,I,L);if(!R.hasActivity)return(0,k.jsx)(v,{title:P,summary:(0,k.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`No stage activity to plot.`}),children:(0,k.jsx)(b,{tone:`neutral`,icon:p,title:`No stage activity to plot.`})});let{order:K,points:q,sampled:J,peakCores:Y}=R;return(0,k.jsx)(v,{title:P,impactBand:B?.impactBand,badges:B?(0,k.jsx)(_,{type:`coreLocality`,impactBand:B.impactBand}):null,defaultCollapsed:F,summary:(0,k.jsx)(S,{value:`${Math.round(Y)} cores`,context:`peak concurrent, by locality`}),children:(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsx)(y,{children:(0,k.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`approximate: stage-level attribution`,B?null:(0,k.jsxs)(k.Fragment,{children:[`, see `,(0,k.jsx)(m,{anchor:`#bottleneck-utilization`,children:`how utilization is measured`})]})]})}),B?(0,k.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,k.jsx)(h,{impactBand:B.impactBand,className:`mt-1.5`}),(0,k.jsxs)(`span`,{children:[(0,k.jsxs)(`strong`,{children:[B.value,`% non-local`]}),`: `,B.recommendation]})]}):null,B?(0,k.jsx)(C,{finding:B}):null,(0,k.jsx)(y,{children:B?(0,k.jsx)(u,{confidence:B.confidence,validationRequired:B.validationRequired}):null}),(0,k.jsx)(d,{ariaLabel:`Approximate concurrent core usage over time, stacked by task locality tier, with idle capacity shown. See the legend for tier colors.`,height:A,table:{caption:`Concurrent core usage over time by locality tier`,columns:[`Time (s)`,...K.map(e=>M[e]??e)],rows:q.map(e=>[e.t,...K.map(t=>Math.round(e[t]))]),align:Array.from({length:K.length+1},()=>`right`)},children:(0,k.jsxs)(i,{data:J,children:[(0,k.jsx)(r,{vertical:!1,stroke:f.muted,strokeOpacity:.2}),(0,k.jsx)(o,{dataKey:`t`,tick:{fontSize:10},label:{value:`seconds from app start`,position:`insideBottom`,offset:-2,fontSize:10}}),(0,k.jsx)(a,{tick:{fontSize:10},width:36,label:{value:`avg concurrent cores`,angle:-90,position:`insideLeft`,fontSize:10}}),(0,k.jsx)(c,{}),(0,k.jsx)(n,{wrapperStyle:{fontSize:10}}),K.map(e=>(0,k.jsx)(s,{type:`monotone`,dataKey:e,name:M[e]??e,stackId:`cores`,stroke:N[e]??f.muted,fill:N[e]??f.muted,fillOpacity:e===`idle`?.15:.8,isAnimationActive:!1},e))]})}),(0,k.jsx)(y,{children:G.length>0?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`ul`,{className:`space-y-1 text-xs text-muted-foreground`,children:G.map(e=>(0,k.jsxs)(`li`,{children:[`Stage `,e.stageId,`: `,Math.round(e.ratio*100),`% non-local (`,e.nonLocalTasks,`/`,e.taskCount,` tasks)`]},e.stageId))}),(0,k.jsx)(w,{page:W,totalPages:U,onPrev:()=>L(e=>e-1),onNext:()=>L(e=>e+1)})]}):null}),(0,k.jsx)(y,{children:V?(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Idle cores also flagged → see Memory Utilization widget`}):null})]})})});export{F as CoreUsageArea};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,T as n,f as r,n as i,o as a,s as o,u as s,v as c}from"./charts-vendor-0VMaLVLN.js";import{p as l}from"./plan-graph-vendor-B0sEms9Z.js";import{S as u,T as d,w as f}from"./useRecentFiles-0XuhS91q.js";import{t as p}from"./inbox-M_EuWNiK.js";import{A as m,D as h,J as g,O as _,i as v,k as y}from"./index-pnImGbgQ.js";import{t as b}from"./EmptyState-DqnSxTjJ.js";import{t as x}from"./downsample-WmNM1qc9.js";import{t as S}from"./WidgetLeadSummary-BdUUi7L5.js";import{t as C}from"./ImpactEstimate-Df_laG-n.js";import{t as w}from"./RowPagination-2icPidMP.js";import{t as T}from"./usePagedRows-jNUWgVTD.js";var E=e(t(),1),D=[`PROCESS_LOCAL`,`NODE_LOCAL`,`RACK_LOCAL`,`NO_PREF`,`ANY`];function O(e,{bucketWidthMs:t=6e4,tiers:n=D}={}){let r=e.filter(e=>(e.completedAt??0)>(e.submittedAt??0)&&(e.executorRunTime??0)>0);if(r.length===0)return{labels:[],series:{}};let i=r.reduce((e,t)=>Math.min(e,t.submittedAt??e),1/0),a=r.reduce((e,t)=>Math.max(e,t.completedAt??e),-1/0),o=Math.max(1,Math.ceil((a-i)/t)),s={};for(let e of n)s[e]=Array(o).fill(0);let c=Array(o).fill(0);for(let e of r){let n=e.completedAt??0,r=e.submittedAt??0,a=n-r,l=(e.executorRunTime??0)/a,u=(e.localityStats??[]).reduce((e,t)=>e+t.count,0)||1,d=new Map((e.localityStats??[]).map(e=>[e.locality,e.count/u]));for(let e=0;e<o;e++){let a=i+e*t,o=a+t,u=Math.min(n,o)-Math.max(r,a);if(u<=0)continue;let f=u/t;for(let[t,n]of d){let r=l*n*f;s[t]?s[t][e]+=r:c[e]+=r}}}c.some(e=>e>0)&&(s.OTHER=c);let l=Array(o).fill(0);for(let e of Object.keys(s))for(let t=0;t<o;t++)l[t]+=s[e][t];let u=l.reduce((e,t)=>Math.max(e,t),0);s.idle=l.map(e=>Math.max(0,u-e));let d=[];for(let e=0;e<o;e++)d.push(i+e*t);return{labels:d,series:s}}var k=l(),A=240,j=60,M={PROCESS_LOCAL:`Process-local`,NODE_LOCAL:`Node-local`,RACK_LOCAL:`Rack-local`,NO_PREF:`No preference`,ANY:`Any`,OTHER:`Other`,idle:`Idle`},N={PROCESS_LOCAL:f.clean,NODE_LOCAL:f.accent,RACK_LOCAL:f.warning,NO_PREF:f.muted,ANY:f.critical,OTHER:f.muted,idle:f.muted},P=`Core Usage by Locality`,F=(0,E.memo)(function({appModel:e,catalog:t,activeFileId:l,defaultCollapsed:F=!0}){let[I,L]=(0,E.useState)(0),R=(0,E.useMemo)(()=>{let t=[...e.stages.values()];if(!t.some(e=>(e.executorRunTime??0)>0&&(e.completedAt??0)>(e.submittedAt??0)))return{hasActivity:!1};let n=e.app,r=n?.startTime??0,i=n?.endTime??r,{labels:a,series:o}=O(t,{bucketWidthMs:Math.max(6e4,Math.ceil(Math.max(1,i-r)/j))}),s=[...D.filter(e=>o[e]),...o.OTHER?[`OTHER`]:[],`idle`],c=a.map((e,t)=>{let n={t:Math.round((e-r)/1e3)};for(let e of s)n[e]=o[e]?.[t]??0;return n}),l=x(c),u=s.filter(e=>e!==`idle`);return{hasActivity:!0,order:s,points:c,sampled:l,peakCores:c.reduce((e,t)=>Math.max(e,u.reduce((e,n)=>e+t[n],0)),0)}},[e,l]),z=(0,E.useMemo)(()=>g([...e.stages.values()],{topN:1/0}),[e,l]),B=t.find(e=>e.type===`coreLocality`),V=t.some(e=>e.type===`memoryUtilization`&&e.variant===`idleCores`),H=z.topStages.filter(e=>e.nonLocalTasks>0),{totalPages:U,effectivePage:W,visible:G}=T(H,I,L);if(!R.hasActivity)return(0,k.jsx)(v,{title:P,summary:(0,k.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`No stage activity to plot.`}),children:(0,k.jsx)(b,{tone:`neutral`,icon:p,title:`No stage activity to plot.`})});let{order:K,points:q,sampled:J,peakCores:Y}=R;return(0,k.jsx)(v,{title:P,impactBand:B?.impactBand,badges:B?(0,k.jsx)(_,{type:`coreLocality`,impactBand:B.impactBand}):null,defaultCollapsed:F,summary:(0,k.jsx)(S,{value:`${Math.round(Y)} cores`,context:`peak concurrent, by locality`}),children:(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsx)(y,{children:(0,k.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`approximate: stage-level attribution`,B?null:(0,k.jsxs)(k.Fragment,{children:[`, see `,(0,k.jsx)(m,{anchor:`#bottleneck-utilization`,children:`how utilization is measured`})]})]})}),B?(0,k.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,k.jsx)(h,{impactBand:B.impactBand,className:`mt-1.5`}),(0,k.jsxs)(`span`,{children:[(0,k.jsxs)(`strong`,{children:[B.value,`% non-local`]}),`: `,B.recommendation]})]}):null,B?(0,k.jsx)(C,{finding:B}):null,(0,k.jsx)(y,{children:B?(0,k.jsx)(u,{confidence:B.confidence,validationRequired:B.validationRequired}):null}),(0,k.jsx)(d,{ariaLabel:`Approximate concurrent core usage over time, stacked by task locality tier, with idle capacity shown. See the legend for tier colors.`,height:A,table:{caption:`Concurrent core usage over time by locality tier`,columns:[`Time (s)`,...K.map(e=>M[e]??e)],rows:q.map(e=>[e.t,...K.map(t=>Math.round(e[t]))]),align:Array.from({length:K.length+1},()=>`right`)},children:(0,k.jsxs)(i,{data:J,children:[(0,k.jsx)(r,{vertical:!1,stroke:f.muted,strokeOpacity:.2}),(0,k.jsx)(o,{dataKey:`t`,tick:{fontSize:10},label:{value:`seconds from app start`,position:`insideBottom`,offset:-2,fontSize:10}}),(0,k.jsx)(a,{tick:{fontSize:10},width:36,label:{value:`avg concurrent cores`,angle:-90,position:`insideLeft`,fontSize:10}}),(0,k.jsx)(c,{}),(0,k.jsx)(n,{wrapperStyle:{fontSize:10}}),K.map(e=>(0,k.jsx)(s,{type:`monotone`,dataKey:e,name:M[e]??e,stackId:`cores`,stroke:N[e]??f.muted,fill:N[e]??f.muted,fillOpacity:e===`idle`?.15:.8,isAnimationActive:!1},e))]})}),(0,k.jsx)(y,{children:G.length>0?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`ul`,{className:`space-y-1 text-xs text-muted-foreground`,children:G.map(e=>(0,k.jsxs)(`li`,{children:[`Stage `,e.stageId,`: `,Math.round(e.ratio*100),`% non-local (`,e.nonLocalTasks,`/`,e.taskCount,` tasks)`]},e.stageId))}),(0,k.jsx)(w,{page:W,totalPages:U,onPrev:()=>L(e=>e-1),onNext:()=>L(e=>e+1)})]}):null}),(0,k.jsx)(y,{children:V?(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Idle cores also flagged → see Memory Utilization widget`}):null})]})})});export{F as CoreUsageArea};