@flanksource/clicky-ui 0.3.49 → 0.3.50

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 (384) hide show
  1. package/dist/connections/ConnectionsPage.cjs +219 -0
  2. package/dist/connections/ConnectionsPage.cjs.map +1 -0
  3. package/dist/connections/ConnectionsPage.d.ts +23 -0
  4. package/dist/connections/ConnectionsPage.d.ts.map +1 -0
  5. package/dist/connections/ConnectionsPage.js +219 -0
  6. package/dist/connections/ConnectionsPage.js.map +1 -0
  7. package/dist/connections/connectionActionStatus.cjs +43 -0
  8. package/dist/connections/connectionActionStatus.cjs.map +1 -0
  9. package/dist/connections/connectionActionStatus.d.ts +5 -0
  10. package/dist/connections/connectionActionStatus.d.ts.map +1 -0
  11. package/dist/connections/connectionActionStatus.js +43 -0
  12. package/dist/connections/connectionActionStatus.js.map +1 -0
  13. package/dist/connections/connectionActionTypes.cjs +24 -0
  14. package/dist/connections/connectionActionTypes.cjs.map +1 -0
  15. package/dist/connections/connectionActionTypes.d.ts +36 -0
  16. package/dist/connections/connectionActionTypes.d.ts.map +1 -0
  17. package/dist/connections/connectionActionTypes.js +24 -0
  18. package/dist/connections/connectionActionTypes.js.map +1 -0
  19. package/dist/connections/connectionActions.cjs +11 -0
  20. package/dist/connections/connectionActions.cjs.map +1 -0
  21. package/dist/connections/connectionActions.d.ts +15 -0
  22. package/dist/connections/connectionActions.d.ts.map +1 -0
  23. package/dist/connections/connectionActions.js +11 -0
  24. package/dist/connections/connectionActions.js.map +1 -0
  25. package/dist/connections/connectionDashboard.cjs +185 -0
  26. package/dist/connections/connectionDashboard.cjs.map +1 -0
  27. package/dist/connections/connectionDashboard.d.ts +25 -0
  28. package/dist/connections/connectionDashboard.d.ts.map +1 -0
  29. package/dist/connections/connectionDashboard.js +185 -0
  30. package/dist/connections/connectionDashboard.js.map +1 -0
  31. package/dist/connections/connectionDashboardModel.cjs +43 -0
  32. package/dist/connections/connectionDashboardModel.cjs.map +1 -0
  33. package/dist/connections/connectionDashboardModel.d.ts +75 -0
  34. package/dist/connections/connectionDashboardModel.d.ts.map +1 -0
  35. package/dist/connections/connectionDashboardModel.js +43 -0
  36. package/dist/connections/connectionDashboardModel.js.map +1 -0
  37. package/dist/connections/connectionDashboardRenderer.cjs +21 -0
  38. package/dist/connections/connectionDashboardRenderer.cjs.map +1 -0
  39. package/dist/connections/connectionDashboardRenderer.d.ts +15 -0
  40. package/dist/connections/connectionDashboardRenderer.d.ts.map +1 -0
  41. package/dist/connections/connectionDashboardRenderer.js +21 -0
  42. package/dist/connections/connectionDashboardRenderer.js.map +1 -0
  43. package/dist/connections/connectionDashboardRow.cjs +169 -0
  44. package/dist/connections/connectionDashboardRow.cjs.map +1 -0
  45. package/dist/connections/connectionDashboardRow.d.ts +12 -0
  46. package/dist/connections/connectionDashboardRow.d.ts.map +1 -0
  47. package/dist/connections/connectionDashboardRow.js +169 -0
  48. package/dist/connections/connectionDashboardRow.js.map +1 -0
  49. package/dist/connections/connectionErrorView.cjs +8 -0
  50. package/dist/connections/connectionErrorView.cjs.map +1 -0
  51. package/dist/connections/connectionErrorView.d.ts +4 -0
  52. package/dist/connections/connectionErrorView.d.ts.map +1 -0
  53. package/dist/connections/connectionErrorView.js +8 -0
  54. package/dist/connections/connectionErrorView.js.map +1 -0
  55. package/dist/connections/connectionHealth.cjs +82 -0
  56. package/dist/connections/connectionHealth.cjs.map +1 -0
  57. package/dist/connections/connectionHealth.d.ts +33 -0
  58. package/dist/connections/connectionHealth.d.ts.map +1 -0
  59. package/dist/connections/connectionHealth.js +82 -0
  60. package/dist/connections/connectionHealth.js.map +1 -0
  61. package/dist/connections/connectionLogging.cjs +29 -0
  62. package/dist/connections/connectionLogging.cjs.map +1 -0
  63. package/dist/connections/connectionLogging.d.ts +11 -0
  64. package/dist/connections/connectionLogging.d.ts.map +1 -0
  65. package/dist/connections/connectionLogging.js +29 -0
  66. package/dist/connections/connectionLogging.js.map +1 -0
  67. package/dist/connections/connectionLoggingField.cjs +37 -0
  68. package/dist/connections/connectionLoggingField.cjs.map +1 -0
  69. package/dist/connections/connectionLoggingField.d.ts +12 -0
  70. package/dist/connections/connectionLoggingField.d.ts.map +1 -0
  71. package/dist/connections/connectionLoggingField.js +37 -0
  72. package/dist/connections/connectionLoggingField.js.map +1 -0
  73. package/dist/connections/connectionLoggingModel.cjs +16 -0
  74. package/dist/connections/connectionLoggingModel.cjs.map +1 -0
  75. package/dist/connections/connectionLoggingModel.d.ts +6 -0
  76. package/dist/connections/connectionLoggingModel.d.ts.map +1 -0
  77. package/dist/connections/connectionLoggingModel.js +16 -0
  78. package/dist/connections/connectionLoggingModel.js.map +1 -0
  79. package/dist/connections/connectionResolveView.cjs +24 -0
  80. package/dist/connections/connectionResolveView.cjs.map +1 -0
  81. package/dist/connections/connectionResolveView.d.ts +5 -0
  82. package/dist/connections/connectionResolveView.d.ts.map +1 -0
  83. package/dist/connections/connectionResolveView.js +24 -0
  84. package/dist/connections/connectionResolveView.js.map +1 -0
  85. package/dist/connections/connectionTestButton.cjs +58 -0
  86. package/dist/connections/connectionTestButton.cjs.map +1 -0
  87. package/dist/connections/connectionTestButton.d.ts +6 -0
  88. package/dist/connections/connectionTestButton.d.ts.map +1 -0
  89. package/dist/connections/connectionTestButton.js +58 -0
  90. package/dist/connections/connectionTestButton.js.map +1 -0
  91. package/dist/connections/connectionTestView.cjs +12 -0
  92. package/dist/connections/connectionTestView.cjs.map +1 -0
  93. package/dist/connections/connectionTestView.d.ts +5 -0
  94. package/dist/connections/connectionTestView.d.ts.map +1 -0
  95. package/dist/connections/connectionTestView.js +12 -0
  96. package/dist/connections/connectionTestView.js.map +1 -0
  97. package/dist/connections/connectionsPageModel.cjs +33 -0
  98. package/dist/connections/connectionsPageModel.cjs.map +1 -0
  99. package/dist/connections/connectionsPageModel.d.ts +24 -0
  100. package/dist/connections/connectionsPageModel.d.ts.map +1 -0
  101. package/dist/connections/connectionsPageModel.js +33 -0
  102. package/dist/connections/connectionsPageModel.js.map +1 -0
  103. package/dist/connections/iconProvider.cjs +20 -0
  104. package/dist/connections/iconProvider.cjs.map +1 -0
  105. package/dist/connections/iconProvider.d.ts +7 -0
  106. package/dist/connections/iconProvider.d.ts.map +1 -0
  107. package/dist/connections/iconProvider.js +20 -0
  108. package/dist/connections/iconProvider.js.map +1 -0
  109. package/dist/connections.cjs +45 -0
  110. package/dist/connections.cjs.map +1 -0
  111. package/dist/connections.d.ts +34 -0
  112. package/dist/connections.d.ts.map +1 -0
  113. package/dist/connections.js +45 -0
  114. package/dist/connections.js.map +1 -0
  115. package/dist/data/diagnostics/DiagnosticsDetailPanel.cjs +52 -295
  116. package/dist/data/diagnostics/DiagnosticsDetailPanel.cjs.map +1 -1
  117. package/dist/data/diagnostics/DiagnosticsDetailPanel.d.ts.map +1 -1
  118. package/dist/data/diagnostics/DiagnosticsDetailPanel.js +47 -290
  119. package/dist/data/diagnostics/DiagnosticsDetailPanel.js.map +1 -1
  120. package/dist/data/diagnostics/MetricTile.cjs +44 -0
  121. package/dist/data/diagnostics/MetricTile.cjs.map +1 -0
  122. package/dist/data/diagnostics/MetricTile.d.ts +13 -0
  123. package/dist/data/diagnostics/MetricTile.d.ts.map +1 -0
  124. package/dist/data/diagnostics/MetricTile.js +44 -0
  125. package/dist/data/diagnostics/MetricTile.js.map +1 -0
  126. package/dist/data/diagnostics/StackDumpView.cjs +227 -0
  127. package/dist/data/diagnostics/StackDumpView.cjs.map +1 -0
  128. package/dist/data/diagnostics/StackDumpView.d.ts +53 -0
  129. package/dist/data/diagnostics/StackDumpView.d.ts.map +1 -0
  130. package/dist/data/diagnostics/StackDumpView.js +227 -0
  131. package/dist/data/diagnostics/StackDumpView.js.map +1 -0
  132. package/dist/data/diagnostics/fixtures.d.ts +1 -0
  133. package/dist/data/diagnostics/fixtures.d.ts.map +1 -1
  134. package/dist/data/diagnostics/metric-tone.cjs +18 -0
  135. package/dist/data/diagnostics/metric-tone.cjs.map +1 -0
  136. package/dist/data/diagnostics/metric-tone.d.ts +6 -0
  137. package/dist/data/diagnostics/metric-tone.d.ts.map +1 -0
  138. package/dist/data/diagnostics/metric-tone.js +18 -0
  139. package/dist/data/diagnostics/metric-tone.js.map +1 -0
  140. package/dist/data/diagnostics/stacktrace.cjs +44 -0
  141. package/dist/data/diagnostics/stacktrace.cjs.map +1 -1
  142. package/dist/data/diagnostics/stacktrace.d.ts +7 -0
  143. package/dist/data/diagnostics/stacktrace.d.ts.map +1 -1
  144. package/dist/data/diagnostics/stacktrace.js +44 -0
  145. package/dist/data/diagnostics/stacktrace.js.map +1 -1
  146. package/dist/data/diagnostics/types.d.ts +2 -8
  147. package/dist/data/diagnostics/types.d.ts.map +1 -1
  148. package/dist/data/lint/LintDetail.cjs +339 -0
  149. package/dist/data/lint/LintDetail.cjs.map +1 -0
  150. package/dist/data/lint/LintDetail.d.ts +17 -0
  151. package/dist/data/lint/LintDetail.d.ts.map +1 -0
  152. package/dist/data/lint/LintDetail.js +339 -0
  153. package/dist/data/lint/LintDetail.js.map +1 -0
  154. package/dist/data/lint/LintFilterBar.cjs +103 -0
  155. package/dist/data/lint/LintFilterBar.cjs.map +1 -0
  156. package/dist/data/lint/LintFilterBar.d.ts +16 -0
  157. package/dist/data/lint/LintFilterBar.d.ts.map +1 -0
  158. package/dist/data/lint/LintFilterBar.js +103 -0
  159. package/dist/data/lint/LintFilterBar.js.map +1 -0
  160. package/dist/data/lint/LintResults.cjs +144 -0
  161. package/dist/data/lint/LintResults.cjs.map +1 -0
  162. package/dist/data/lint/LintResults.d.ts +39 -0
  163. package/dist/data/lint/LintResults.d.ts.map +1 -0
  164. package/dist/data/lint/LintResults.fixtures.d.ts +10 -0
  165. package/dist/data/lint/LintResults.fixtures.d.ts.map +1 -0
  166. package/dist/data/lint/LintResults.js +144 -0
  167. package/dist/data/lint/LintResults.js.map +1 -0
  168. package/dist/data/lint/LintTreeNode.cjs +66 -0
  169. package/dist/data/lint/LintTreeNode.cjs.map +1 -0
  170. package/dist/data/lint/LintTreeNode.d.ts +7 -0
  171. package/dist/data/lint/LintTreeNode.d.ts.map +1 -0
  172. package/dist/data/lint/LintTreeNode.js +66 -0
  173. package/dist/data/lint/LintTreeNode.js.map +1 -0
  174. package/dist/data/lint/actions.cjs +195 -0
  175. package/dist/data/lint/actions.cjs.map +1 -0
  176. package/dist/data/lint/actions.d.ts +29 -0
  177. package/dist/data/lint/actions.d.ts.map +1 -0
  178. package/dist/data/lint/actions.js +195 -0
  179. package/dist/data/lint/actions.js.map +1 -0
  180. package/dist/data/lint/grouping-options.cjs +14 -0
  181. package/dist/data/lint/grouping-options.cjs.map +1 -0
  182. package/dist/data/lint/grouping-options.d.ts +9 -0
  183. package/dist/data/lint/grouping-options.d.ts.map +1 -0
  184. package/dist/data/lint/grouping-options.js +14 -0
  185. package/dist/data/lint/grouping-options.js.map +1 -0
  186. package/dist/data/lint/grouping.cjs +450 -0
  187. package/dist/data/lint/grouping.cjs.map +1 -0
  188. package/dist/data/lint/grouping.d.ts +10 -0
  189. package/dist/data/lint/grouping.d.ts.map +1 -0
  190. package/dist/data/lint/grouping.js +450 -0
  191. package/dist/data/lint/grouping.js.map +1 -0
  192. package/dist/data/lint/index.d.ts +10 -0
  193. package/dist/data/lint/index.d.ts.map +1 -0
  194. package/dist/data/lint/paths.cjs +35 -0
  195. package/dist/data/lint/paths.cjs.map +1 -0
  196. package/dist/data/lint/paths.d.ts +13 -0
  197. package/dist/data/lint/paths.d.ts.map +1 -0
  198. package/dist/data/lint/paths.js +35 -0
  199. package/dist/data/lint/paths.js.map +1 -0
  200. package/dist/data/lint/stats.cjs +76 -0
  201. package/dist/data/lint/stats.cjs.map +1 -0
  202. package/dist/data/lint/stats.d.ts +19 -0
  203. package/dist/data/lint/stats.d.ts.map +1 -0
  204. package/dist/data/lint/stats.js +76 -0
  205. package/dist/data/lint/stats.js.map +1 -0
  206. package/dist/data/lint/types.cjs +16 -0
  207. package/dist/data/lint/types.cjs.map +1 -0
  208. package/dist/data/lint/types.d.ts +93 -0
  209. package/dist/data/lint/types.d.ts.map +1 -0
  210. package/dist/data/lint/types.js +16 -0
  211. package/dist/data/lint/types.js.map +1 -0
  212. package/dist/data/test-runner/TestAttemptDetail.cjs +113 -0
  213. package/dist/data/test-runner/TestAttemptDetail.cjs.map +1 -0
  214. package/dist/data/test-runner/TestAttemptDetail.d.ts +19 -0
  215. package/dist/data/test-runner/TestAttemptDetail.d.ts.map +1 -0
  216. package/dist/data/test-runner/TestAttemptDetail.js +113 -0
  217. package/dist/data/test-runner/TestAttemptDetail.js.map +1 -0
  218. package/dist/data/test-runner/TestAttempts.cjs +36 -0
  219. package/dist/data/test-runner/TestAttempts.cjs.map +1 -0
  220. package/dist/data/test-runner/TestAttempts.d.ts +5 -0
  221. package/dist/data/test-runner/TestAttempts.d.ts.map +1 -0
  222. package/dist/data/test-runner/TestAttempts.js +36 -0
  223. package/dist/data/test-runner/TestAttempts.js.map +1 -0
  224. package/dist/data/test-runner/TestDetailPanel.cjs +13 -3
  225. package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
  226. package/dist/data/test-runner/TestDetailPanel.d.ts.map +1 -1
  227. package/dist/data/test-runner/TestDetailPanel.js +14 -4
  228. package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
  229. package/dist/data/test-runner/TestFailureDetail.cjs +9 -29
  230. package/dist/data/test-runner/TestFailureDetail.cjs.map +1 -1
  231. package/dist/data/test-runner/TestFailureDetail.d.ts +6 -6
  232. package/dist/data/test-runner/TestFailureDetail.d.ts.map +1 -1
  233. package/dist/data/test-runner/TestFailureDetail.js +9 -29
  234. package/dist/data/test-runner/TestFailureDetail.js.map +1 -1
  235. package/dist/data/test-runner/TestRunSummary.cjs +33 -0
  236. package/dist/data/test-runner/TestRunSummary.cjs.map +1 -1
  237. package/dist/data/test-runner/TestRunSummary.d.ts.map +1 -1
  238. package/dist/data/test-runner/TestRunSummary.js +34 -1
  239. package/dist/data/test-runner/TestRunSummary.js.map +1 -1
  240. package/dist/data/test-runner/TestRunner.cjs +3 -0
  241. package/dist/data/test-runner/TestRunner.cjs.map +1 -1
  242. package/dist/data/test-runner/TestRunner.d.ts +8 -1
  243. package/dist/data/test-runner/TestRunner.d.ts.map +1 -1
  244. package/dist/data/test-runner/TestRunner.js +3 -0
  245. package/dist/data/test-runner/TestRunner.js.map +1 -1
  246. package/dist/data/test-runner/TestTreeNode.cjs +3 -1
  247. package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
  248. package/dist/data/test-runner/TestTreeNode.d.ts.map +1 -1
  249. package/dist/data/test-runner/TestTreeNode.js +3 -1
  250. package/dist/data/test-runner/TestTreeNode.js.map +1 -1
  251. package/dist/data/test-runner/adapter.cjs +9 -1
  252. package/dist/data/test-runner/adapter.cjs.map +1 -1
  253. package/dist/data/test-runner/adapter.d.ts +5 -0
  254. package/dist/data/test-runner/adapter.d.ts.map +1 -1
  255. package/dist/data/test-runner/adapter.js +9 -1
  256. package/dist/data/test-runner/adapter.js.map +1 -1
  257. package/dist/data/test-runner/attempts.cjs +62 -0
  258. package/dist/data/test-runner/attempts.cjs.map +1 -0
  259. package/dist/data/test-runner/attempts.d.ts +13 -0
  260. package/dist/data/test-runner/attempts.d.ts.map +1 -0
  261. package/dist/data/test-runner/attempts.js +62 -0
  262. package/dist/data/test-runner/attempts.js.map +1 -0
  263. package/dist/data/test-runner/context.cjs.map +1 -1
  264. package/dist/data/test-runner/context.d.ts +6 -0
  265. package/dist/data/test-runner/context.d.ts.map +1 -1
  266. package/dist/data/test-runner/context.js.map +1 -1
  267. package/dist/data/test-runner/index.d.ts +5 -1
  268. package/dist/data/test-runner/index.d.ts.map +1 -1
  269. package/dist/data/test-runner/marks.cjs +2 -0
  270. package/dist/data/test-runner/marks.cjs.map +1 -1
  271. package/dist/data/test-runner/marks.d.ts.map +1 -1
  272. package/dist/data/test-runner/marks.js +2 -0
  273. package/dist/data/test-runner/marks.js.map +1 -1
  274. package/dist/data/test-runner/process-metrics.cjs +15 -0
  275. package/dist/data/test-runner/process-metrics.cjs.map +1 -0
  276. package/dist/data/test-runner/process-metrics.d.ts +22 -0
  277. package/dist/data/test-runner/process-metrics.d.ts.map +1 -0
  278. package/dist/data/test-runner/process-metrics.js +15 -0
  279. package/dist/data/test-runner/process-metrics.js.map +1 -0
  280. package/dist/data/test-runner/status.cjs +11 -3
  281. package/dist/data/test-runner/status.cjs.map +1 -1
  282. package/dist/data/test-runner/status.d.ts +3 -1
  283. package/dist/data/test-runner/status.d.ts.map +1 -1
  284. package/dist/data/test-runner/status.js +11 -3
  285. package/dist/data/test-runner/status.js.map +1 -1
  286. package/dist/data/test-runner/types.d.ts +14 -0
  287. package/dist/data/test-runner/types.d.ts.map +1 -1
  288. package/dist/data/traces/GoProfileView.cjs +176 -0
  289. package/dist/data/traces/GoProfileView.cjs.map +1 -0
  290. package/dist/data/traces/GoProfileView.d.ts +30 -0
  291. package/dist/data/traces/GoProfileView.d.ts.map +1 -0
  292. package/dist/data/traces/GoProfileView.js +176 -0
  293. package/dist/data/traces/GoProfileView.js.map +1 -0
  294. package/dist/data/traces/ProcessFacetTable.cjs +79 -0
  295. package/dist/data/traces/ProcessFacetTable.cjs.map +1 -0
  296. package/dist/data/traces/ProcessFacetTable.d.ts +21 -0
  297. package/dist/data/traces/ProcessFacetTable.d.ts.map +1 -0
  298. package/dist/data/traces/ProcessFacetTable.js +79 -0
  299. package/dist/data/traces/ProcessFacetTable.js.map +1 -0
  300. package/dist/data/traces/ProcessRecordViews.cjs +41 -0
  301. package/dist/data/traces/ProcessRecordViews.cjs.map +1 -0
  302. package/dist/data/traces/ProcessRecordViews.d.ts +16 -0
  303. package/dist/data/traces/ProcessRecordViews.d.ts.map +1 -0
  304. package/dist/data/traces/ProcessRecordViews.js +41 -0
  305. package/dist/data/traces/ProcessRecordViews.js.map +1 -0
  306. package/dist/data/traces/ProcessTraceDetail.cjs +316 -0
  307. package/dist/data/traces/ProcessTraceDetail.cjs.map +1 -0
  308. package/dist/data/traces/ProcessTraceDetail.d.ts +39 -0
  309. package/dist/data/traces/ProcessTraceDetail.d.ts.map +1 -0
  310. package/dist/data/traces/ProcessTraceDetail.js +316 -0
  311. package/dist/data/traces/ProcessTraceDetail.js.map +1 -0
  312. package/dist/data/traces/ProcessTraceTree.cjs +76 -34
  313. package/dist/data/traces/ProcessTraceTree.cjs.map +1 -1
  314. package/dist/data/traces/ProcessTraceTree.d.ts +21 -4
  315. package/dist/data/traces/ProcessTraceTree.d.ts.map +1 -1
  316. package/dist/data/traces/ProcessTraceTree.js +72 -30
  317. package/dist/data/traces/ProcessTraceTree.js.map +1 -1
  318. package/dist/data/traces/Sparkline.cjs +27 -5
  319. package/dist/data/traces/Sparkline.cjs.map +1 -1
  320. package/dist/data/traces/Sparkline.d.ts +17 -1
  321. package/dist/data/traces/Sparkline.d.ts.map +1 -1
  322. package/dist/data/traces/Sparkline.js +28 -6
  323. package/dist/data/traces/Sparkline.js.map +1 -1
  324. package/dist/data/traces/TraceView.cjs +9 -0
  325. package/dist/data/traces/TraceView.cjs.map +1 -1
  326. package/dist/data/traces/TraceView.d.ts +4 -2
  327. package/dist/data/traces/TraceView.d.ts.map +1 -1
  328. package/dist/data/traces/TraceView.js +9 -0
  329. package/dist/data/traces/TraceView.js.map +1 -1
  330. package/dist/data/traces/TraceWindowList.cjs +117 -0
  331. package/dist/data/traces/TraceWindowList.cjs.map +1 -0
  332. package/dist/data/traces/TraceWindowList.d.ts +48 -0
  333. package/dist/data/traces/TraceWindowList.d.ts.map +1 -0
  334. package/dist/data/traces/TraceWindowList.js +117 -0
  335. package/dist/data/traces/TraceWindowList.js.map +1 -0
  336. package/dist/data/traces/fixtures.d.ts +25 -1
  337. package/dist/data/traces/fixtures.d.ts.map +1 -1
  338. package/dist/data/traces/index.d.ts +10 -3
  339. package/dist/data/traces/index.d.ts.map +1 -1
  340. package/dist/data/traces/process-facets.cjs +48 -0
  341. package/dist/data/traces/process-facets.cjs.map +1 -0
  342. package/dist/data/traces/process-facets.d.ts +38 -0
  343. package/dist/data/traces/process-facets.d.ts.map +1 -0
  344. package/dist/data/traces/process-facets.js +48 -0
  345. package/dist/data/traces/process-facets.js.map +1 -0
  346. package/dist/data/traces/process-tree.cjs +36 -4
  347. package/dist/data/traces/process-tree.cjs.map +1 -1
  348. package/dist/data/traces/process-tree.d.ts +20 -1
  349. package/dist/data/traces/process-tree.d.ts.map +1 -1
  350. package/dist/data/traces/process-tree.js +36 -4
  351. package/dist/data/traces/process-tree.js.map +1 -1
  352. package/dist/data/traces/profile-aggregate.cjs +78 -0
  353. package/dist/data/traces/profile-aggregate.cjs.map +1 -0
  354. package/dist/data/traces/profile-aggregate.d.ts +41 -0
  355. package/dist/data/traces/profile-aggregate.d.ts.map +1 -0
  356. package/dist/data/traces/profile-aggregate.js +78 -0
  357. package/dist/data/traces/profile-aggregate.js.map +1 -0
  358. package/dist/data/traces/stack-checkpoints.cjs +22 -0
  359. package/dist/data/traces/stack-checkpoints.cjs.map +1 -0
  360. package/dist/data/traces/stack-checkpoints.d.ts +18 -0
  361. package/dist/data/traces/stack-checkpoints.d.ts.map +1 -0
  362. package/dist/data/traces/stack-checkpoints.js +22 -0
  363. package/dist/data/traces/stack-checkpoints.js.map +1 -0
  364. package/dist/data/traces/types.d.ts +120 -5
  365. package/dist/data/traces/types.d.ts.map +1 -1
  366. package/dist/data/verification/adapters.cjs +1 -0
  367. package/dist/data/verification/adapters.cjs.map +1 -1
  368. package/dist/data/verification/adapters.d.ts.map +1 -1
  369. package/dist/data/verification/adapters.js +1 -0
  370. package/dist/data/verification/adapters.js.map +1 -1
  371. package/dist/data/version-info.cjs +3 -3
  372. package/dist/data/version-info.js +3 -3
  373. package/dist/data.cjs +85 -7
  374. package/dist/data.cjs.map +1 -1
  375. package/dist/data.d.ts +4 -0
  376. package/dist/data.d.ts.map +1 -1
  377. package/dist/data.js +81 -3
  378. package/dist/data.js.map +1 -1
  379. package/dist/index.cjs +87 -9
  380. package/dist/index.cjs.map +1 -1
  381. package/dist/index.js +81 -3
  382. package/dist/index.js.map +1 -1
  383. package/dist/styles.css +1 -1
  384. package/package.json +6 -1
@@ -19,6 +19,12 @@ export interface Test {
19
19
  * failure (a warned child never fails its parent). Distinct from `failed`.
20
20
  */
21
21
  warned?: boolean;
22
+ /**
23
+ * Never ran because the run stopped after an earlier failure — distinct from
24
+ * an intentional skip, which is `skipped` alone. An aborted node is
25
+ * normally also `skipped`; it counts once, as aborted.
26
+ */
27
+ aborted?: boolean;
22
28
  pending?: boolean;
23
29
  /**
24
30
  * Execution started but not yet finished — distinct from `pending`
@@ -69,12 +75,20 @@ export interface TestAttempt {
69
75
  cpu_percent?: number;
70
76
  rss?: number;
71
77
  goroutine_count?: number;
78
+ /**
79
+ * The pid, CPU and RSS belong to a process shared with other tests (every
80
+ * package of a unified `go test` batch has the same pid), not to this test
81
+ * alone, so a viewer should label them as the batch's.
82
+ */
83
+ shared_process?: boolean;
72
84
  }
73
85
  export interface TestSummary {
74
86
  Total: number;
75
87
  Passed: number;
76
88
  Failed: number;
77
89
  Warned?: number;
90
+ /** Count of nodes that never ran because the run stopped after an earlier failure. */
91
+ Aborted?: number;
78
92
  Skipped: number;
79
93
  Pending: number;
80
94
  Running?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/test-runner/types.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B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jE,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const react = require("react");
5
+ const select = require("../../components/select.cjs");
6
+ const utils = require("../../lib/utils.cjs");
7
+ const Icon = require("../Icon.cjs");
8
+ const profileAggregate = require("./profile-aggregate.cjs");
9
+ const processTree = require("./process-tree.cjs");
10
+ const UiChevronDown = require("../../icons/components/UiChevronDown.cjs");
11
+ const UiChevronRight = require("../../icons/components/UiChevronRight.cjs");
12
+ const DEFAULT_TOP_N = 20;
13
+ const DRILL_DOWN_STACKS = 5;
14
+ function frameLocation(frame) {
15
+ return frame.file ? `${frame.file}${frame.line ? `:${frame.line}` : ""}` : "";
16
+ }
17
+ function Percent({ value, total }) {
18
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: total > 0 ? `${(value / total * 100).toFixed(1)}%` : "—" });
19
+ }
20
+ function DrillDown({
21
+ samples,
22
+ sampleType,
23
+ unit,
24
+ func,
25
+ total
26
+ }) {
27
+ const stacks = profileAggregate.stacksThrough(samples, sampleType, func, DRILL_DOWN_STACKS);
28
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-density-2", "data-profile-stacks": func, children: stacks.map((stack, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded border border-border bg-muted/30 p-density-2", children: [
29
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1 text-[11px] text-muted-foreground", children: [
30
+ profileAggregate.formatProfileValue(stack.value, unit),
31
+ " ",
32
+ /* @__PURE__ */ jsxRuntime.jsx(Percent, { value: stack.value, total })
33
+ ] }),
34
+ /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "space-y-0.5 font-mono text-[11px] leading-4", children: stack.frames.map((frame, depth) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: utils.cn("break-all", frame.func === func ? "font-semibold text-foreground" : "text-muted-foreground"), children: [
35
+ frame.func,
36
+ frameLocation(frame) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-[10px] font-normal opacity-80", children: frameLocation(frame) })
37
+ ] }, depth)) })
38
+ ] }, index)) });
39
+ }
40
+ function ProfileTopTable({ samples, topN = DEFAULT_TOP_N, className }) {
41
+ var _a, _b;
42
+ const types = react.useMemo(() => profileAggregate.profileValueTypes(samples), [samples]);
43
+ const [picked, setPicked] = react.useState(null);
44
+ const sampleType = ((_a = types.find((type) => type.sampleType === picked)) == null ? void 0 : _a.sampleType) ?? ((_b = types[types.length - 1]) == null ? void 0 : _b.sampleType);
45
+ const [sortKey, setSortKey] = react.useState("flat");
46
+ const [showAll, setShowAll] = react.useState(false);
47
+ const [open, setOpen] = react.useState(null);
48
+ const aggregate = react.useMemo(() => sampleType ? profileAggregate.aggregateProfile(samples, sampleType) : void 0, [samples, sampleType]);
49
+ if (!sampleType || !aggregate) {
50
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: "The profile has no samples" });
51
+ }
52
+ const sorted = sortKey === "flat" ? aggregate.functions : [...aggregate.functions].sort((a, b) => b.cum - a.cum || b.flat - a.flat);
53
+ const shown = showAll ? sorted : sorted.slice(0, topN);
54
+ const sortHeader = (key, label) => /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: "px-2 py-1 text-right font-medium", "aria-sort": sortKey === key ? "descending" : "none", children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: utils.cn("hover:text-foreground", sortKey === key && "text-foreground"), onClick: () => setSortKey(key), children: label }) });
55
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn("space-y-density-2", className), "data-profile-top": "", children: [
56
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-density-2 text-xs text-muted-foreground", children: [
57
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
58
+ "Total ",
59
+ profileAggregate.formatProfileValue(aggregate.total, aggregate.unit),
60
+ " across ",
61
+ aggregate.functions.length,
62
+ " functions"
63
+ ] }),
64
+ types.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-[12rem]", children: /* @__PURE__ */ jsxRuntime.jsx(
65
+ select.Select,
66
+ {
67
+ "aria-label": "Sample type",
68
+ value: sampleType,
69
+ onChange: (event) => {
70
+ setPicked(event.target.value);
71
+ setOpen(null);
72
+ },
73
+ options: types.map((type) => ({ value: type.sampleType, label: `${type.sampleType} (${type.unit})` }))
74
+ }
75
+ ) })
76
+ ] }),
77
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full table-fixed border-collapse text-xs", children: [
78
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b border-border", children: [
79
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: "px-2 py-1 text-left font-medium", children: "Function" }),
80
+ sortHeader("flat", "Flat"),
81
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: "w-16 px-2 py-1 text-right font-medium", children: "Flat %" }),
82
+ sortHeader("cum", "Cum"),
83
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: "w-16 px-2 py-1 text-right font-medium", children: "Cum %" })
84
+ ] }) }),
85
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: shown.map((row) => {
86
+ const expanded = open === row.func;
87
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
88
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b border-border/60 hover:bg-muted/40", "data-profile-function": row.func, children: [
89
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
90
+ "button",
91
+ {
92
+ type: "button",
93
+ "aria-expanded": expanded,
94
+ className: "flex w-full items-start gap-1 text-left",
95
+ onClick: () => setOpen(expanded ? null : row.func),
96
+ children: [
97
+ /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { icon: expanded ? UiChevronDown.UiChevronDown : UiChevronRight.UiChevronRight, className: "mt-0.5 shrink-0 text-[11px]" }),
98
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0", children: [
99
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block break-all font-mono text-[11px] font-semibold", children: row.func }),
100
+ frameLocation(row) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block break-all text-[10px] text-muted-foreground", children: frameLocation(row) })
101
+ ] })
102
+ ]
103
+ }
104
+ ) }),
105
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-1 text-right tabular-nums", children: profileAggregate.formatProfileValue(row.flat, aggregate.unit) }),
106
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-1 text-right tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsx(Percent, { value: row.flat, total: aggregate.total }) }),
107
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-1 text-right tabular-nums", children: profileAggregate.formatProfileValue(row.cum, aggregate.unit) }),
108
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-1 text-right tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsx(Percent, { value: row.cum, total: aggregate.total }) })
109
+ ] }),
110
+ expanded && /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-2 py-density-2", children: /* @__PURE__ */ jsxRuntime.jsx(
111
+ DrillDown,
112
+ {
113
+ samples,
114
+ sampleType,
115
+ unit: aggregate.unit,
116
+ func: row.func,
117
+ total: aggregate.total
118
+ }
119
+ ) }) })
120
+ ] }, row.func);
121
+ }) })
122
+ ] }),
123
+ !showAll && sorted.length > shown.length && /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "text-xs text-primary hover:underline", onClick: () => setShowAll(true), children: [
124
+ "Show all ",
125
+ sorted.length,
126
+ " functions"
127
+ ] })
128
+ ] });
129
+ }
130
+ function profileCheckpoints(records) {
131
+ const groups = /* @__PURE__ */ new Map();
132
+ for (const record of records) groups.set(record.checkpointId, [...groups.get(record.checkpointId) ?? [], record]);
133
+ return [...groups].map(([checkpointId, group]) => {
134
+ const [first] = group;
135
+ return {
136
+ checkpointId,
137
+ takenAt: first.takenAt,
138
+ reason: first.reason,
139
+ source: first.source,
140
+ profile: first.profile,
141
+ records: group
142
+ };
143
+ }).sort((a, b) => Date.parse(a.takenAt) - Date.parse(b.takenAt));
144
+ }
145
+ function GoProfileView({ records, processKey, topN, className }) {
146
+ const keys = react.useMemo(() => new Set(records.map((record) => record.key)), [records]);
147
+ if (keys.size > 1 && processKey === void 0) {
148
+ throw new Error(`GoProfileView got records of ${keys.size} processes; pass processKey to choose one`);
149
+ }
150
+ const own = react.useMemo(
151
+ () => processKey === void 0 ? records : records.filter((record) => record.key === processKey),
152
+ [records, processKey]
153
+ );
154
+ const checkpoints = react.useMemo(() => profileCheckpoints(own), [own]);
155
+ const [picked, setPicked] = react.useState(null);
156
+ const selected = checkpoints.find((checkpoint) => checkpoint.checkpointId === picked) ?? checkpoints[checkpoints.length - 1];
157
+ if (!selected) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: "No profile collected yet" });
158
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn("space-y-density-2", className), "data-go-profile": selected.profile, children: [
159
+ checkpoints.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-md", children: /* @__PURE__ */ jsxRuntime.jsx(
160
+ select.Select,
161
+ {
162
+ "aria-label": "Profile checkpoint",
163
+ value: selected.checkpointId,
164
+ onChange: (event) => setPicked(event.target.value),
165
+ options: [...checkpoints].reverse().map((checkpoint) => ({
166
+ value: checkpoint.checkpointId,
167
+ label: [processTree.formatProcessTimestamp(checkpoint.takenAt), checkpoint.profile, checkpoint.reason, checkpoint.source].filter(Boolean).join(" · ")
168
+ }))
169
+ }
170
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: [selected.profile, processTree.formatProcessTimestamp(selected.takenAt), selected.reason, selected.source].filter(Boolean).join(" · ") }),
171
+ /* @__PURE__ */ jsxRuntime.jsx(ProfileTopTable, { samples: selected.records, ...topN !== void 0 ? { topN } : {} }, selected.checkpointId)
172
+ ] });
173
+ }
174
+ exports.GoProfileView = GoProfileView;
175
+ exports.ProfileTopTable = ProfileTopTable;
176
+ //# sourceMappingURL=GoProfileView.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoProfileView.cjs","sources":["../../../src/data/traces/GoProfileView.tsx"],"sourcesContent":["import { Fragment, useMemo, useState } from \"react\";\nimport { Select } from \"../../components/select\";\nimport { UiChevronDown, UiChevronRight } from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport { Icon } from \"../Icon\";\nimport {\n aggregateProfile,\n formatProfileValue,\n profileValueTypes,\n stacksThrough,\n type ProfileFunctionRow,\n} from \"./profile-aggregate\";\nimport { formatProcessTimestamp } from \"./process-tree\";\nimport type { GoProfileRecord, ProfileSample, StackFrame } from \"./types\";\n\nconst DEFAULT_TOP_N = 20;\nconst DRILL_DOWN_STACKS = 5;\n\ntype SortKey = \"flat\" | \"cum\";\n\nfunction frameLocation(frame: StackFrame): string {\n return frame.file ? `${frame.file}${frame.line ? `:${frame.line}` : \"\"}` : \"\";\n}\n\nfunction Percent({ value, total }: { value: number; total: number }) {\n return <span className=\"text-muted-foreground\">{total > 0 ? `${((value / total) * 100).toFixed(1)}%` : \"—\"}</span>;\n}\n\nfunction DrillDown({\n samples,\n sampleType,\n unit,\n func,\n total,\n}: {\n samples: ProfileSample[];\n sampleType: string;\n unit: string;\n func: string;\n total: number;\n}) {\n const stacks = stacksThrough(samples, sampleType, func, DRILL_DOWN_STACKS);\n return (\n <div className=\"space-y-density-2\" data-profile-stacks={func}>\n {stacks.map((stack, index) => (\n <div key={index} className=\"rounded border border-border bg-muted/30 p-density-2\">\n <div className=\"mb-1 text-[11px] text-muted-foreground\">\n {formatProfileValue(stack.value, unit)} <Percent value={stack.value} total={total} />\n </div>\n <ol className=\"space-y-0.5 font-mono text-[11px] leading-4\">\n {stack.frames.map((frame, depth) => (\n <li key={depth} className={cn(\"break-all\", frame.func === func ? \"font-semibold text-foreground\" : \"text-muted-foreground\")}>\n {frame.func}\n {frameLocation(frame) && <span className=\"ml-2 text-[10px] font-normal opacity-80\">{frameLocation(frame)}</span>}\n </li>\n ))}\n </ol>\n </div>\n ))}\n </div>\n );\n}\n\nexport type ProfileTopTableProps = {\n /** Samples of any profile: a value of some type and unit attributed to a stack, innermost frame first. */\n samples: ProfileSample[];\n /** Functions shown before \"Show all\"; defaults to 20. */\n topN?: number;\n className?: string;\n};\n\n/**\n * The heaviest functions of a profile: a table by flat value (the innermost\n * frame) and cumulative value (anywhere in the stack), sortable by either, per\n * sample type, with a drill-down from a function to the stacks that reach it.\n * Not specific to Go: any samples of a value, a unit and a stack fit.\n */\nexport function ProfileTopTable({ samples, topN = DEFAULT_TOP_N, className }: ProfileTopTableProps) {\n const types = useMemo(() => profileValueTypes(samples), [samples]);\n // pprof's default sample index is its last value type: cpu, inuse_space.\n const [picked, setPicked] = useState<string | null>(null);\n const sampleType = types.find((type) => type.sampleType === picked)?.sampleType ?? types[types.length - 1]?.sampleType;\n const [sortKey, setSortKey] = useState<SortKey>(\"flat\");\n const [showAll, setShowAll] = useState(false);\n const [open, setOpen] = useState<string | null>(null);\n const aggregate = useMemo(() => (sampleType ? aggregateProfile(samples, sampleType) : undefined), [samples, sampleType]);\n\n if (!sampleType || !aggregate) {\n return <div className=\"text-sm text-muted-foreground\">The profile has no samples</div>;\n }\n\n const sorted: ProfileFunctionRow[] =\n sortKey === \"flat\" ? aggregate.functions : [...aggregate.functions].sort((a, b) => b.cum - a.cum || b.flat - a.flat);\n const shown = showAll ? sorted : sorted.slice(0, topN);\n const sortHeader = (key: SortKey, label: string) => (\n <th scope=\"col\" className=\"px-2 py-1 text-right font-medium\" aria-sort={sortKey === key ? \"descending\" : \"none\"}>\n <button type=\"button\" className={cn(\"hover:text-foreground\", sortKey === key && \"text-foreground\")} onClick={() => setSortKey(key)}>\n {label}\n </button>\n </th>\n );\n\n return (\n <div className={cn(\"space-y-density-2\", className)} data-profile-top=\"\">\n <div className=\"flex flex-wrap items-center justify-between gap-density-2 text-xs text-muted-foreground\">\n <span>\n Total {formatProfileValue(aggregate.total, aggregate.unit)} across {aggregate.functions.length} functions\n </span>\n {types.length > 1 && (\n <div className=\"min-w-[12rem]\">\n <Select\n aria-label=\"Sample type\"\n value={sampleType}\n onChange={(event) => {\n setPicked(event.target.value);\n setOpen(null);\n }}\n options={types.map((type) => ({ value: type.sampleType, label: `${type.sampleType} (${type.unit})` }))}\n />\n </div>\n )}\n </div>\n <table className=\"w-full table-fixed border-collapse text-xs\">\n <thead className=\"text-muted-foreground\">\n <tr className=\"border-b border-border\">\n <th scope=\"col\" className=\"px-2 py-1 text-left font-medium\">\n Function\n </th>\n {sortHeader(\"flat\", \"Flat\")}\n <th scope=\"col\" className=\"w-16 px-2 py-1 text-right font-medium\">\n Flat %\n </th>\n {sortHeader(\"cum\", \"Cum\")}\n <th scope=\"col\" className=\"w-16 px-2 py-1 text-right font-medium\">\n Cum %\n </th>\n </tr>\n </thead>\n <tbody>\n {shown.map((row) => {\n const expanded = open === row.func;\n return (\n <Fragment key={row.func}>\n <tr className=\"border-b border-border/60 hover:bg-muted/40\" data-profile-function={row.func}>\n <td className=\"px-2 py-1\">\n <button\n type=\"button\"\n aria-expanded={expanded}\n className=\"flex w-full items-start gap-1 text-left\"\n onClick={() => setOpen(expanded ? null : row.func)}\n >\n <Icon icon={expanded ? UiChevronDown : UiChevronRight} className=\"mt-0.5 shrink-0 text-[11px]\" />\n <span className=\"min-w-0\">\n <span className=\"block break-all font-mono text-[11px] font-semibold\">{row.func}</span>\n {frameLocation(row) && (\n <span className=\"block break-all text-[10px] text-muted-foreground\">{frameLocation(row)}</span>\n )}\n </span>\n </button>\n </td>\n <td className=\"px-2 py-1 text-right tabular-nums\">{formatProfileValue(row.flat, aggregate.unit)}</td>\n <td className=\"px-2 py-1 text-right tabular-nums\">\n <Percent value={row.flat} total={aggregate.total} />\n </td>\n <td className=\"px-2 py-1 text-right tabular-nums\">{formatProfileValue(row.cum, aggregate.unit)}</td>\n <td className=\"px-2 py-1 text-right tabular-nums\">\n <Percent value={row.cum} total={aggregate.total} />\n </td>\n </tr>\n {expanded && (\n <tr>\n <td colSpan={5} className=\"px-2 py-density-2\">\n <DrillDown\n samples={samples}\n sampleType={sampleType}\n unit={aggregate.unit}\n func={row.func}\n total={aggregate.total}\n />\n </td>\n </tr>\n )}\n </Fragment>\n );\n })}\n </tbody>\n </table>\n {!showAll && sorted.length > shown.length && (\n <button type=\"button\" className=\"text-xs text-primary hover:underline\" onClick={() => setShowAll(true)}>\n Show all {sorted.length} functions\n </button>\n )}\n </div>\n );\n}\n\nexport type GoProfileViewProps = {\n /** `goprof` records, possibly of several checkpoints and processes; those of one process are shown. */\n records: GoProfileRecord[];\n /** The `process_tree` key whose profiles to show; required when the records span processes. */\n processKey?: string;\n topN?: number;\n className?: string;\n};\n\ntype ProfileCheckpoint = { checkpointId: string; takenAt: string; reason: string; source: string; profile: string; records: GoProfileRecord[] };\n\nfunction profileCheckpoints(records: GoProfileRecord[]): ProfileCheckpoint[] {\n const groups = new Map<string, GoProfileRecord[]>();\n for (const record of records) groups.set(record.checkpointId, [...(groups.get(record.checkpointId) ?? []), record]);\n return [...groups]\n .map(([checkpointId, group]): ProfileCheckpoint => {\n const [first] = group as [GoProfileRecord, ...GoProfileRecord[]];\n return {\n checkpointId,\n takenAt: first.takenAt,\n reason: first.reason,\n source: first.source,\n profile: first.profile,\n records: group,\n };\n })\n .sort((a, b) => Date.parse(a.takenAt) - Date.parse(b.takenAt));\n}\n\n/**\n * A Go pprof profile as the `goprof` kind stores it: the checkpoint chooser\n * (profile type, source and time; the latest by default) over a top-N table of\n * functions by flat and cumulative value with a frames drill-down. Props-only.\n */\nexport function GoProfileView({ records, processKey, topN, className }: GoProfileViewProps) {\n const keys = useMemo(() => new Set(records.map((record) => record.key)), [records]);\n if (keys.size > 1 && processKey === undefined) {\n throw new Error(`GoProfileView got records of ${keys.size} processes; pass processKey to choose one`);\n }\n const own = useMemo(\n () => (processKey === undefined ? records : records.filter((record) => record.key === processKey)),\n [records, processKey],\n );\n const checkpoints = useMemo(() => profileCheckpoints(own), [own]);\n const [picked, setPicked] = useState<string | null>(null);\n const selected = checkpoints.find((checkpoint) => checkpoint.checkpointId === picked) ?? checkpoints[checkpoints.length - 1];\n\n if (!selected) return <div className=\"text-sm text-muted-foreground\">No profile collected yet</div>;\n\n return (\n <div className={cn(\"space-y-density-2\", className)} data-go-profile={selected.profile}>\n {checkpoints.length > 1 ? (\n <div className=\"max-w-md\">\n <Select\n aria-label=\"Profile checkpoint\"\n value={selected.checkpointId}\n onChange={(event) => setPicked(event.target.value)}\n options={[...checkpoints].reverse().map((checkpoint) => ({\n value: checkpoint.checkpointId,\n label: [formatProcessTimestamp(checkpoint.takenAt), checkpoint.profile, checkpoint.reason, checkpoint.source]\n .filter(Boolean)\n .join(\" · \"),\n }))}\n />\n </div>\n ) : (\n <div className=\"text-xs text-muted-foreground\">\n {[selected.profile, formatProcessTimestamp(selected.takenAt), selected.reason, selected.source].filter(Boolean).join(\" · \")}\n </div>\n )}\n <ProfileTopTable key={selected.checkpointId} samples={selected.records} {...(topN !== undefined ? { topN } : {})} />\n </div>\n );\n}\n"],"names":["jsx","stacksThrough","jsxs","formatProfileValue","cn","useMemo","profileValueTypes","useState","aggregateProfile","Select","Fragment","Icon","UiChevronDown","UiChevronRight","formatProcessTimestamp"],"mappings":";;;;;;;;;;;AAeA,MAAM,gBAAgB;AACtB,MAAM,oBAAoB;AAI1B,SAAS,cAAc,OAA2B;AAChD,SAAO,MAAM,OAAO,GAAG,MAAM,IAAI,GAAG,MAAM,OAAO,IAAI,MAAM,IAAI,KAAK,EAAE,KAAK;AAC7E;AAEA,SAAS,QAAQ,EAAE,OAAO,SAA2C;AACnE,SAAOA,2BAAAA,IAAC,QAAA,EAAK,WAAU,yBAAyB,kBAAQ,IAAI,IAAK,QAAQ,QAAS,KAAK,QAAQ,CAAC,CAAC,MAAM,KAAI;AAC7G;AAEA,SAAS,UAAU;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMG;AACD,QAAM,SAASC,iBAAAA,cAAc,SAAS,YAAY,MAAM,iBAAiB;AACzE,SACED,2BAAAA,IAAC,OAAA,EAAI,WAAU,qBAAoB,uBAAqB,MACrD,UAAA,OAAO,IAAI,CAAC,OAAO,UAClBE,2BAAAA,KAAC,OAAA,EAAgB,WAAU,wDACzB,UAAA;AAAA,IAAAA,2BAAAA,KAAC,OAAA,EAAI,WAAU,0CACZ,UAAA;AAAA,MAAAC,oCAAmB,MAAM,OAAO,IAAI;AAAA,MAAE;AAAA,MAACH,2BAAAA,IAAC,SAAA,EAAQ,OAAO,MAAM,OAAO,MAAA,CAAc;AAAA,IAAA,GACrF;AAAA,IACAA,2BAAAA,IAAC,QAAG,WAAU,+CACX,gBAAM,OAAO,IAAI,CAAC,OAAO,0CACvB,MAAA,EAAe,WAAWI,MAAAA,GAAG,aAAa,MAAM,SAAS,OAAO,kCAAkC,uBAAuB,GACvH,UAAA;AAAA,MAAA,MAAM;AAAA,MACN,cAAc,KAAK,KAAKJ,2BAA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AAO,EACd,KAAK,KAAK;AAAA,QAAA,EACb;AAAA,MAAA;AAAA,IAAA,EACJ,CACF,IAEAd,2BAAAA,IAAC,OAAA,EAAI,WAAU,iCACZ,UAAA,CAAC,SAAS,SAASc,mCAAuB,SAAS,OAAO,GAAG,SAAS,QAAQ,SAAS,MAAM,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK,EAAA,CAC5H;AAAA,IAEFd,2BAAAA,IAAC,iBAAA,EAA4C,SAAS,SAAS,SAAU,GAAI,SAAS,SAAY,EAAE,KAAA,IAAS,CAAA,EAAC,GAAxF,SAAS,YAAmF;AAAA,EAAA,GACpH;AAEJ;;;"}
@@ -0,0 +1,30 @@
1
+ import { GoProfileRecord, ProfileSample } from './types.js';
2
+ export type ProfileTopTableProps = {
3
+ /** Samples of any profile: a value of some type and unit attributed to a stack, innermost frame first. */
4
+ samples: ProfileSample[];
5
+ /** Functions shown before "Show all"; defaults to 20. */
6
+ topN?: number;
7
+ className?: string;
8
+ };
9
+ /**
10
+ * The heaviest functions of a profile: a table by flat value (the innermost
11
+ * frame) and cumulative value (anywhere in the stack), sortable by either, per
12
+ * sample type, with a drill-down from a function to the stacks that reach it.
13
+ * Not specific to Go: any samples of a value, a unit and a stack fit.
14
+ */
15
+ export declare function ProfileTopTable({ samples, topN, className }: ProfileTopTableProps): import("react").JSX.Element;
16
+ export type GoProfileViewProps = {
17
+ /** `goprof` records, possibly of several checkpoints and processes; those of one process are shown. */
18
+ records: GoProfileRecord[];
19
+ /** The `process_tree` key whose profiles to show; required when the records span processes. */
20
+ processKey?: string;
21
+ topN?: number;
22
+ className?: string;
23
+ };
24
+ /**
25
+ * A Go pprof profile as the `goprof` kind stores it: the checkpoint chooser
26
+ * (profile type, source and time; the latest by default) over a top-N table of
27
+ * functions by flat and cumulative value with a frames drill-down. Props-only.
28
+ */
29
+ export declare function GoProfileView({ records, processKey, topN, className }: GoProfileViewProps): import("react").JSX.Element;
30
+ //# sourceMappingURL=GoProfileView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoProfileView.d.ts","sourceRoot":"","sources":["../../../src/data/traces/GoProfileView.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAc,MAAM,SAAS,CAAC;AAkD1E,MAAM,MAAM,oBAAoB,GAAG;IACjC,0GAA0G;IAC1G,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,IAAoB,EAAE,SAAS,EAAE,EAAE,oBAAoB,+BAqHjG;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uGAAuG;IACvG,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAsBF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAuCzF"}
@@ -0,0 +1,176 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useState, Fragment } from "react";
3
+ import { Select } from "../../components/select.js";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { Icon } from "../Icon.js";
6
+ import { profileValueTypes, aggregateProfile, formatProfileValue, stacksThrough } from "./profile-aggregate.js";
7
+ import { formatProcessTimestamp } from "./process-tree.js";
8
+ import { UiChevronDown } from "../../icons/components/UiChevronDown.js";
9
+ import { UiChevronRight } from "../../icons/components/UiChevronRight.js";
10
+ const DEFAULT_TOP_N = 20;
11
+ const DRILL_DOWN_STACKS = 5;
12
+ function frameLocation(frame) {
13
+ return frame.file ? `${frame.file}${frame.line ? `:${frame.line}` : ""}` : "";
14
+ }
15
+ function Percent({ value, total }) {
16
+ return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: total > 0 ? `${(value / total * 100).toFixed(1)}%` : "—" });
17
+ }
18
+ function DrillDown({
19
+ samples,
20
+ sampleType,
21
+ unit,
22
+ func,
23
+ total
24
+ }) {
25
+ const stacks = stacksThrough(samples, sampleType, func, DRILL_DOWN_STACKS);
26
+ return /* @__PURE__ */ jsx("div", { className: "space-y-density-2", "data-profile-stacks": func, children: stacks.map((stack, index) => /* @__PURE__ */ jsxs("div", { className: "rounded border border-border bg-muted/30 p-density-2", children: [
27
+ /* @__PURE__ */ jsxs("div", { className: "mb-1 text-[11px] text-muted-foreground", children: [
28
+ formatProfileValue(stack.value, unit),
29
+ " ",
30
+ /* @__PURE__ */ jsx(Percent, { value: stack.value, total })
31
+ ] }),
32
+ /* @__PURE__ */ jsx("ol", { className: "space-y-0.5 font-mono text-[11px] leading-4", children: stack.frames.map((frame, depth) => /* @__PURE__ */ jsxs("li", { className: cn("break-all", frame.func === func ? "font-semibold text-foreground" : "text-muted-foreground"), children: [
33
+ frame.func,
34
+ frameLocation(frame) && /* @__PURE__ */ jsx("span", { className: "ml-2 text-[10px] font-normal opacity-80", children: frameLocation(frame) })
35
+ ] }, depth)) })
36
+ ] }, index)) });
37
+ }
38
+ function ProfileTopTable({ samples, topN = DEFAULT_TOP_N, className }) {
39
+ var _a, _b;
40
+ const types = useMemo(() => profileValueTypes(samples), [samples]);
41
+ const [picked, setPicked] = useState(null);
42
+ const sampleType = ((_a = types.find((type) => type.sampleType === picked)) == null ? void 0 : _a.sampleType) ?? ((_b = types[types.length - 1]) == null ? void 0 : _b.sampleType);
43
+ const [sortKey, setSortKey] = useState("flat");
44
+ const [showAll, setShowAll] = useState(false);
45
+ const [open, setOpen] = useState(null);
46
+ const aggregate = useMemo(() => sampleType ? aggregateProfile(samples, sampleType) : void 0, [samples, sampleType]);
47
+ if (!sampleType || !aggregate) {
48
+ return /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "The profile has no samples" });
49
+ }
50
+ const sorted = sortKey === "flat" ? aggregate.functions : [...aggregate.functions].sort((a, b) => b.cum - a.cum || b.flat - a.flat);
51
+ const shown = showAll ? sorted : sorted.slice(0, topN);
52
+ const sortHeader = (key, label) => /* @__PURE__ */ jsx("th", { scope: "col", className: "px-2 py-1 text-right font-medium", "aria-sort": sortKey === key ? "descending" : "none", children: /* @__PURE__ */ jsx("button", { type: "button", className: cn("hover:text-foreground", sortKey === key && "text-foreground"), onClick: () => setSortKey(key), children: label }) });
53
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-density-2", className), "data-profile-top": "", children: [
54
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-density-2 text-xs text-muted-foreground", children: [
55
+ /* @__PURE__ */ jsxs("span", { children: [
56
+ "Total ",
57
+ formatProfileValue(aggregate.total, aggregate.unit),
58
+ " across ",
59
+ aggregate.functions.length,
60
+ " functions"
61
+ ] }),
62
+ types.length > 1 && /* @__PURE__ */ jsx("div", { className: "min-w-[12rem]", children: /* @__PURE__ */ jsx(
63
+ Select,
64
+ {
65
+ "aria-label": "Sample type",
66
+ value: sampleType,
67
+ onChange: (event) => {
68
+ setPicked(event.target.value);
69
+ setOpen(null);
70
+ },
71
+ options: types.map((type) => ({ value: type.sampleType, label: `${type.sampleType} (${type.unit})` }))
72
+ }
73
+ ) })
74
+ ] }),
75
+ /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed border-collapse text-xs", children: [
76
+ /* @__PURE__ */ jsx("thead", { className: "text-muted-foreground", children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-border", children: [
77
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "px-2 py-1 text-left font-medium", children: "Function" }),
78
+ sortHeader("flat", "Flat"),
79
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "w-16 px-2 py-1 text-right font-medium", children: "Flat %" }),
80
+ sortHeader("cum", "Cum"),
81
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "w-16 px-2 py-1 text-right font-medium", children: "Cum %" })
82
+ ] }) }),
83
+ /* @__PURE__ */ jsx("tbody", { children: shown.map((row) => {
84
+ const expanded = open === row.func;
85
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
86
+ /* @__PURE__ */ jsxs("tr", { className: "border-b border-border/60 hover:bg-muted/40", "data-profile-function": row.func, children: [
87
+ /* @__PURE__ */ jsx("td", { className: "px-2 py-1", children: /* @__PURE__ */ jsxs(
88
+ "button",
89
+ {
90
+ type: "button",
91
+ "aria-expanded": expanded,
92
+ className: "flex w-full items-start gap-1 text-left",
93
+ onClick: () => setOpen(expanded ? null : row.func),
94
+ children: [
95
+ /* @__PURE__ */ jsx(Icon, { icon: expanded ? UiChevronDown : UiChevronRight, className: "mt-0.5 shrink-0 text-[11px]" }),
96
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
97
+ /* @__PURE__ */ jsx("span", { className: "block break-all font-mono text-[11px] font-semibold", children: row.func }),
98
+ frameLocation(row) && /* @__PURE__ */ jsx("span", { className: "block break-all text-[10px] text-muted-foreground", children: frameLocation(row) })
99
+ ] })
100
+ ]
101
+ }
102
+ ) }),
103
+ /* @__PURE__ */ jsx("td", { className: "px-2 py-1 text-right tabular-nums", children: formatProfileValue(row.flat, aggregate.unit) }),
104
+ /* @__PURE__ */ jsx("td", { className: "px-2 py-1 text-right tabular-nums", children: /* @__PURE__ */ jsx(Percent, { value: row.flat, total: aggregate.total }) }),
105
+ /* @__PURE__ */ jsx("td", { className: "px-2 py-1 text-right tabular-nums", children: formatProfileValue(row.cum, aggregate.unit) }),
106
+ /* @__PURE__ */ jsx("td", { className: "px-2 py-1 text-right tabular-nums", children: /* @__PURE__ */ jsx(Percent, { value: row.cum, total: aggregate.total }) })
107
+ ] }),
108
+ expanded && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 5, className: "px-2 py-density-2", children: /* @__PURE__ */ jsx(
109
+ DrillDown,
110
+ {
111
+ samples,
112
+ sampleType,
113
+ unit: aggregate.unit,
114
+ func: row.func,
115
+ total: aggregate.total
116
+ }
117
+ ) }) })
118
+ ] }, row.func);
119
+ }) })
120
+ ] }),
121
+ !showAll && sorted.length > shown.length && /* @__PURE__ */ jsxs("button", { type: "button", className: "text-xs text-primary hover:underline", onClick: () => setShowAll(true), children: [
122
+ "Show all ",
123
+ sorted.length,
124
+ " functions"
125
+ ] })
126
+ ] });
127
+ }
128
+ function profileCheckpoints(records) {
129
+ const groups = /* @__PURE__ */ new Map();
130
+ for (const record of records) groups.set(record.checkpointId, [...groups.get(record.checkpointId) ?? [], record]);
131
+ return [...groups].map(([checkpointId, group]) => {
132
+ const [first] = group;
133
+ return {
134
+ checkpointId,
135
+ takenAt: first.takenAt,
136
+ reason: first.reason,
137
+ source: first.source,
138
+ profile: first.profile,
139
+ records: group
140
+ };
141
+ }).sort((a, b) => Date.parse(a.takenAt) - Date.parse(b.takenAt));
142
+ }
143
+ function GoProfileView({ records, processKey, topN, className }) {
144
+ const keys = useMemo(() => new Set(records.map((record) => record.key)), [records]);
145
+ if (keys.size > 1 && processKey === void 0) {
146
+ throw new Error(`GoProfileView got records of ${keys.size} processes; pass processKey to choose one`);
147
+ }
148
+ const own = useMemo(
149
+ () => processKey === void 0 ? records : records.filter((record) => record.key === processKey),
150
+ [records, processKey]
151
+ );
152
+ const checkpoints = useMemo(() => profileCheckpoints(own), [own]);
153
+ const [picked, setPicked] = useState(null);
154
+ const selected = checkpoints.find((checkpoint) => checkpoint.checkpointId === picked) ?? checkpoints[checkpoints.length - 1];
155
+ if (!selected) return /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "No profile collected yet" });
156
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-density-2", className), "data-go-profile": selected.profile, children: [
157
+ checkpoints.length > 1 ? /* @__PURE__ */ jsx("div", { className: "max-w-md", children: /* @__PURE__ */ jsx(
158
+ Select,
159
+ {
160
+ "aria-label": "Profile checkpoint",
161
+ value: selected.checkpointId,
162
+ onChange: (event) => setPicked(event.target.value),
163
+ options: [...checkpoints].reverse().map((checkpoint) => ({
164
+ value: checkpoint.checkpointId,
165
+ label: [formatProcessTimestamp(checkpoint.takenAt), checkpoint.profile, checkpoint.reason, checkpoint.source].filter(Boolean).join(" · ")
166
+ }))
167
+ }
168
+ ) }) : /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: [selected.profile, formatProcessTimestamp(selected.takenAt), selected.reason, selected.source].filter(Boolean).join(" · ") }),
169
+ /* @__PURE__ */ jsx(ProfileTopTable, { samples: selected.records, ...topN !== void 0 ? { topN } : {} }, selected.checkpointId)
170
+ ] });
171
+ }
172
+ export {
173
+ GoProfileView,
174
+ ProfileTopTable
175
+ };
176
+ //# sourceMappingURL=GoProfileView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoProfileView.js","sources":["../../../src/data/traces/GoProfileView.tsx"],"sourcesContent":["import { Fragment, useMemo, useState } from \"react\";\nimport { Select } from \"../../components/select\";\nimport { UiChevronDown, UiChevronRight } from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport { Icon } from \"../Icon\";\nimport {\n aggregateProfile,\n formatProfileValue,\n profileValueTypes,\n stacksThrough,\n type ProfileFunctionRow,\n} from \"./profile-aggregate\";\nimport { formatProcessTimestamp } from \"./process-tree\";\nimport type { GoProfileRecord, ProfileSample, StackFrame } from \"./types\";\n\nconst DEFAULT_TOP_N = 20;\nconst DRILL_DOWN_STACKS = 5;\n\ntype SortKey = \"flat\" | \"cum\";\n\nfunction frameLocation(frame: StackFrame): string {\n return frame.file ? `${frame.file}${frame.line ? `:${frame.line}` : \"\"}` : \"\";\n}\n\nfunction Percent({ value, total }: { value: number; total: number }) {\n return <span className=\"text-muted-foreground\">{total > 0 ? `${((value / total) * 100).toFixed(1)}%` : \"—\"}</span>;\n}\n\nfunction DrillDown({\n samples,\n sampleType,\n unit,\n func,\n total,\n}: {\n samples: ProfileSample[];\n sampleType: string;\n unit: string;\n func: string;\n total: number;\n}) {\n const stacks = stacksThrough(samples, sampleType, func, DRILL_DOWN_STACKS);\n return (\n <div className=\"space-y-density-2\" data-profile-stacks={func}>\n {stacks.map((stack, index) => (\n <div key={index} className=\"rounded border border-border bg-muted/30 p-density-2\">\n <div className=\"mb-1 text-[11px] text-muted-foreground\">\n {formatProfileValue(stack.value, unit)} <Percent value={stack.value} total={total} />\n </div>\n <ol className=\"space-y-0.5 font-mono text-[11px] leading-4\">\n {stack.frames.map((frame, depth) => (\n <li key={depth} className={cn(\"break-all\", frame.func === func ? \"font-semibold text-foreground\" : \"text-muted-foreground\")}>\n {frame.func}\n {frameLocation(frame) && <span className=\"ml-2 text-[10px] font-normal opacity-80\">{frameLocation(frame)}</span>}\n </li>\n ))}\n </ol>\n </div>\n ))}\n </div>\n );\n}\n\nexport type ProfileTopTableProps = {\n /** Samples of any profile: a value of some type and unit attributed to a stack, innermost frame first. */\n samples: ProfileSample[];\n /** Functions shown before \"Show all\"; defaults to 20. */\n topN?: number;\n className?: string;\n};\n\n/**\n * The heaviest functions of a profile: a table by flat value (the innermost\n * frame) and cumulative value (anywhere in the stack), sortable by either, per\n * sample type, with a drill-down from a function to the stacks that reach it.\n * Not specific to Go: any samples of a value, a unit and a stack fit.\n */\nexport function ProfileTopTable({ samples, topN = DEFAULT_TOP_N, className }: ProfileTopTableProps) {\n const types = useMemo(() => profileValueTypes(samples), [samples]);\n // pprof's default sample index is its last value type: cpu, inuse_space.\n const [picked, setPicked] = useState<string | null>(null);\n const sampleType = types.find((type) => type.sampleType === picked)?.sampleType ?? types[types.length - 1]?.sampleType;\n const [sortKey, setSortKey] = useState<SortKey>(\"flat\");\n const [showAll, setShowAll] = useState(false);\n const [open, setOpen] = useState<string | null>(null);\n const aggregate = useMemo(() => (sampleType ? aggregateProfile(samples, sampleType) : undefined), [samples, sampleType]);\n\n if (!sampleType || !aggregate) {\n return <div className=\"text-sm text-muted-foreground\">The profile has no samples</div>;\n }\n\n const sorted: ProfileFunctionRow[] =\n sortKey === \"flat\" ? aggregate.functions : [...aggregate.functions].sort((a, b) => b.cum - a.cum || b.flat - a.flat);\n const shown = showAll ? sorted : sorted.slice(0, topN);\n const sortHeader = (key: SortKey, label: string) => (\n <th scope=\"col\" className=\"px-2 py-1 text-right font-medium\" aria-sort={sortKey === key ? \"descending\" : \"none\"}>\n <button type=\"button\" className={cn(\"hover:text-foreground\", sortKey === key && \"text-foreground\")} onClick={() => setSortKey(key)}>\n {label}\n </button>\n </th>\n );\n\n return (\n <div className={cn(\"space-y-density-2\", className)} data-profile-top=\"\">\n <div className=\"flex flex-wrap items-center justify-between gap-density-2 text-xs text-muted-foreground\">\n <span>\n Total {formatProfileValue(aggregate.total, aggregate.unit)} across {aggregate.functions.length} functions\n </span>\n {types.length > 1 && (\n <div className=\"min-w-[12rem]\">\n <Select\n aria-label=\"Sample type\"\n value={sampleType}\n onChange={(event) => {\n setPicked(event.target.value);\n setOpen(null);\n }}\n options={types.map((type) => ({ value: type.sampleType, label: `${type.sampleType} (${type.unit})` }))}\n />\n </div>\n )}\n </div>\n <table className=\"w-full table-fixed border-collapse text-xs\">\n <thead className=\"text-muted-foreground\">\n <tr className=\"border-b border-border\">\n <th scope=\"col\" className=\"px-2 py-1 text-left font-medium\">\n Function\n </th>\n {sortHeader(\"flat\", \"Flat\")}\n <th scope=\"col\" className=\"w-16 px-2 py-1 text-right font-medium\">\n Flat %\n </th>\n {sortHeader(\"cum\", \"Cum\")}\n <th scope=\"col\" className=\"w-16 px-2 py-1 text-right font-medium\">\n Cum %\n </th>\n </tr>\n </thead>\n <tbody>\n {shown.map((row) => {\n const expanded = open === row.func;\n return (\n <Fragment key={row.func}>\n <tr className=\"border-b border-border/60 hover:bg-muted/40\" data-profile-function={row.func}>\n <td className=\"px-2 py-1\">\n <button\n type=\"button\"\n aria-expanded={expanded}\n className=\"flex w-full items-start gap-1 text-left\"\n onClick={() => setOpen(expanded ? null : row.func)}\n >\n <Icon icon={expanded ? UiChevronDown : UiChevronRight} className=\"mt-0.5 shrink-0 text-[11px]\" />\n <span className=\"min-w-0\">\n <span className=\"block break-all font-mono text-[11px] font-semibold\">{row.func}</span>\n {frameLocation(row) && (\n <span className=\"block break-all text-[10px] text-muted-foreground\">{frameLocation(row)}</span>\n )}\n </span>\n </button>\n </td>\n <td className=\"px-2 py-1 text-right tabular-nums\">{formatProfileValue(row.flat, aggregate.unit)}</td>\n <td className=\"px-2 py-1 text-right tabular-nums\">\n <Percent value={row.flat} total={aggregate.total} />\n </td>\n <td className=\"px-2 py-1 text-right tabular-nums\">{formatProfileValue(row.cum, aggregate.unit)}</td>\n <td className=\"px-2 py-1 text-right tabular-nums\">\n <Percent value={row.cum} total={aggregate.total} />\n </td>\n </tr>\n {expanded && (\n <tr>\n <td colSpan={5} className=\"px-2 py-density-2\">\n <DrillDown\n samples={samples}\n sampleType={sampleType}\n unit={aggregate.unit}\n func={row.func}\n total={aggregate.total}\n />\n </td>\n </tr>\n )}\n </Fragment>\n );\n })}\n </tbody>\n </table>\n {!showAll && sorted.length > shown.length && (\n <button type=\"button\" className=\"text-xs text-primary hover:underline\" onClick={() => setShowAll(true)}>\n Show all {sorted.length} functions\n </button>\n )}\n </div>\n );\n}\n\nexport type GoProfileViewProps = {\n /** `goprof` records, possibly of several checkpoints and processes; those of one process are shown. */\n records: GoProfileRecord[];\n /** The `process_tree` key whose profiles to show; required when the records span processes. */\n processKey?: string;\n topN?: number;\n className?: string;\n};\n\ntype ProfileCheckpoint = { checkpointId: string; takenAt: string; reason: string; source: string; profile: string; records: GoProfileRecord[] };\n\nfunction profileCheckpoints(records: GoProfileRecord[]): ProfileCheckpoint[] {\n const groups = new Map<string, GoProfileRecord[]>();\n for (const record of records) groups.set(record.checkpointId, [...(groups.get(record.checkpointId) ?? []), record]);\n return [...groups]\n .map(([checkpointId, group]): ProfileCheckpoint => {\n const [first] = group as [GoProfileRecord, ...GoProfileRecord[]];\n return {\n checkpointId,\n takenAt: first.takenAt,\n reason: first.reason,\n source: first.source,\n profile: first.profile,\n records: group,\n };\n })\n .sort((a, b) => Date.parse(a.takenAt) - Date.parse(b.takenAt));\n}\n\n/**\n * A Go pprof profile as the `goprof` kind stores it: the checkpoint chooser\n * (profile type, source and time; the latest by default) over a top-N table of\n * functions by flat and cumulative value with a frames drill-down. Props-only.\n */\nexport function GoProfileView({ records, processKey, topN, className }: GoProfileViewProps) {\n const keys = useMemo(() => new Set(records.map((record) => record.key)), [records]);\n if (keys.size > 1 && processKey === undefined) {\n throw new Error(`GoProfileView got records of ${keys.size} processes; pass processKey to choose one`);\n }\n const own = useMemo(\n () => (processKey === undefined ? records : records.filter((record) => record.key === processKey)),\n [records, processKey],\n );\n const checkpoints = useMemo(() => profileCheckpoints(own), [own]);\n const [picked, setPicked] = useState<string | null>(null);\n const selected = checkpoints.find((checkpoint) => checkpoint.checkpointId === picked) ?? checkpoints[checkpoints.length - 1];\n\n if (!selected) return <div className=\"text-sm text-muted-foreground\">No profile collected yet</div>;\n\n return (\n <div className={cn(\"space-y-density-2\", className)} data-go-profile={selected.profile}>\n {checkpoints.length > 1 ? (\n <div className=\"max-w-md\">\n <Select\n aria-label=\"Profile checkpoint\"\n value={selected.checkpointId}\n onChange={(event) => setPicked(event.target.value)}\n options={[...checkpoints].reverse().map((checkpoint) => ({\n value: checkpoint.checkpointId,\n label: [formatProcessTimestamp(checkpoint.takenAt), checkpoint.profile, checkpoint.reason, checkpoint.source]\n .filter(Boolean)\n .join(\" · \"),\n }))}\n />\n </div>\n ) : (\n <div className=\"text-xs text-muted-foreground\">\n {[selected.profile, formatProcessTimestamp(selected.takenAt), selected.reason, selected.source].filter(Boolean).join(\" · \")}\n </div>\n )}\n <ProfileTopTable key={selected.checkpointId} samples={selected.records} {...(topN !== undefined ? { topN } : {})} />\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAeA,MAAM,gBAAgB;AACtB,MAAM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CAAC,SAAU,4BAAQ,OAAA,EAAI,WAAU,iCAAgC,UAAA,4BAAwB;AAE7F,SACE,qBAAC,SAAI,WAAW,GAAG,qBAAqB,SAAS,GAAG,mBAAiB,SAAS,SAC3E,UAAA;AAAA,IAAA,YAAY,SAAS,IACpB,oBAAC,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,cAAW;AAAA,QACX,OAAO,SAAS;AAAA,QAChB,UAAU,CAAC,UAAU,UAAU,MAAM,OAAO,KAAK;AAAA,QACjD,SAAS,CAAC,GAAG,WAAW,EAAE,QAAA,EAAU,IAAI,CAAC,gBAAgB;AAAA,UACvD,OAAO,WAAW;AAAA,UAClB,OAAO,CAAC,uBAAuB,WAAW,OAAO,GAAG,WAAW,SAAS,WAAW,QAAQ,WAAW,MAAM,EACzG,OAAO,OAAO,EACd,KAAK,KAAK;AAAA,QAAA,EACb;AAAA,MAAA;AAAA,IAAA,EACJ,CACF,IAEA,oBAAC,OAAA,EAAI,WAAU,iCACZ,UAAA,CAAC,SAAS,SAAS,uBAAuB,SAAS,OAAO,GAAG,SAAS,QAAQ,SAAS,MAAM,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK,EAAA,CAC5H;AAAA,IAEF,oBAAC,iBAAA,EAA4C,SAAS,SAAS,SAAU,GAAI,SAAS,SAAY,EAAE,KAAA,IAAS,CAAA,EAAC,GAAxF,SAAS,YAAmF;AAAA,EAAA,GACpH;AAEJ;"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const DataTable = require("../DataTable.cjs");
5
+ const processFacets = require("./process-facets.cjs");
6
+ const processTree = require("./process-tree.cjs");
7
+ const addressColumns = [
8
+ { key: "fd", label: "FD", sortable: true },
9
+ {
10
+ key: "protocol",
11
+ label: "Protocol",
12
+ sortable: true,
13
+ filterable: true,
14
+ accessor: (descriptor) => descriptor.protocol || descriptor.type
15
+ },
16
+ { key: "state", label: "State", sortable: true, filterable: true },
17
+ {
18
+ key: "localAddr",
19
+ label: "Local",
20
+ sortable: true,
21
+ grow: true,
22
+ accessor: (descriptor) => descriptor.localAddr || descriptor.name
23
+ },
24
+ { key: "remoteAddr", label: "Remote", sortable: true }
25
+ ];
26
+ const descriptorColumns = {
27
+ openFiles: [
28
+ { key: "fd", label: "FD", sortable: true },
29
+ { key: "type", label: "Type", sortable: true, filterable: true },
30
+ { key: "name", label: "Path", sortable: true, grow: true }
31
+ ],
32
+ sockets: addressColumns,
33
+ connections: addressColumns,
34
+ ports: [
35
+ { key: "port", label: "Port", sortable: true },
36
+ { key: "protocol", label: "Protocol", sortable: true, filterable: true },
37
+ { key: "localAddr", label: "Address", sortable: true, grow: true },
38
+ { key: "fd", label: "FD", sortable: true }
39
+ ]
40
+ };
41
+ const envColumns = [
42
+ { key: "name", label: "Name", sortable: true },
43
+ { key: "value", label: "Value", grow: true }
44
+ ];
45
+ const tableChrome = { autoFilter: true, showThemeControl: false, showFullscreenControl: false };
46
+ function ProcessFacetTable(props) {
47
+ if (props.facet === "env") {
48
+ const rows = Object.entries(props.environment ?? {}).map(([name, value]) => ({ name, value })).sort((a, b) => a.name.localeCompare(b.name));
49
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", "data-process-facet": "env", children: [
50
+ props.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "whitespace-pre-wrap text-xs text-red-700 dark:text-red-400", role: "alert", children: props.error }),
51
+ props.environment && /* @__PURE__ */ jsxRuntime.jsx(
52
+ DataTable.DataTable,
53
+ {
54
+ data: rows,
55
+ columns: envColumns,
56
+ getRowId: (row) => row.name,
57
+ emptyMessage: "The process has no environment variables",
58
+ ...tableChrome
59
+ }
60
+ )
61
+ ] });
62
+ }
63
+ const { reading, facet } = props;
64
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", "data-process-facet": facet, children: [
65
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: reading ? `Read at ${processTree.formatProcessTimestamp(reading.readAt)}` : "No reading stored for this process yet" }),
66
+ reading && /* @__PURE__ */ jsxRuntime.jsx(
67
+ DataTable.DataTable,
68
+ {
69
+ data: reading.rows,
70
+ columns: descriptorColumns[facet],
71
+ getRowId: (row, index) => `${row.fd}:${index}`,
72
+ emptyMessage: processFacets.SAMPLE_FACETS[facet].empty,
73
+ ...tableChrome
74
+ }
75
+ )
76
+ ] });
77
+ }
78
+ exports.ProcessFacetTable = ProcessFacetTable;
79
+ //# sourceMappingURL=ProcessFacetTable.cjs.map