@parca/profile 0.19.140 → 0.19.143

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 (182) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/GraphTooltipArrow/Content.js +224 -30
  3. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
  4. package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
  5. package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
  6. package/dist/GraphTooltipArrow/index.js +86 -56
  7. package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
  8. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +94 -68
  9. package/dist/MatchersInput/SuggestionItem.js +91 -12
  10. package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
  11. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  12. package/dist/MatchersInput/SuggestionsList.js +371 -157
  13. package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
  14. package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
  15. package/dist/MatchersInput/index.js +308 -115
  16. package/dist/MetricsCircle/index.js +39 -3
  17. package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
  18. package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
  19. package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
  20. package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
  21. package/dist/MetricsGraph/index.js +552 -203
  22. package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
  23. package/dist/MetricsGraph/utils/colorMapping.js +24 -17
  24. package/dist/MetricsSeries/index.js +70 -7
  25. package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
  26. package/dist/PreSelectedMatchers/index.js +249 -102
  27. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  28. package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -45
  29. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  30. package/dist/ProfileExplorer/index.js +183 -32
  31. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  32. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  33. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  34. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  35. package/dist/ProfileFlameChart/index.js +260 -126
  36. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +283 -85
  37. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  38. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  39. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  55. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  56. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  57. package/dist/ProfileFlameGraph/index.js +322 -147
  58. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  59. package/dist/ProfileMetricsGraph/index.js +515 -256
  60. package/dist/ProfileSelector/CompareButton.js +132 -12
  61. package/dist/ProfileSelector/MetricsGraphSection.js +228 -63
  62. package/dist/ProfileSelector/index.d.ts +1 -1
  63. package/dist/ProfileSelector/index.d.ts.map +1 -1
  64. package/dist/ProfileSelector/index.js +734 -142
  65. package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
  66. package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
  67. package/dist/ProfileSelector/useAutoQuerySelector.js +280 -132
  68. package/dist/ProfileSource.js +230 -163
  69. package/dist/ProfileTypeSelector/index.js +214 -125
  70. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  71. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +137 -32
  72. package/dist/ProfileView/components/ColorStackLegend.js +182 -54
  73. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  74. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  75. package/dist/ProfileView/components/DiffLegend.js +172 -29
  76. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  77. package/dist/ProfileView/components/InvertCallStack/index.js +97 -9
  78. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  79. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  80. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  81. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +191 -118
  82. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  83. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  84. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  85. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  86. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +664 -192
  87. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  88. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +196 -155
  89. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  90. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  91. package/dist/ProfileView/components/ViewSelector/index.js +186 -82
  92. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  93. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  94. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  95. package/dist/ProfileView/context/DashboardContext.js +74 -26
  96. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  97. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  98. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  99. package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
  100. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
  101. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +53 -17
  102. package/dist/ProfileView/hooks/useVisualizationState.js +229 -69
  103. package/dist/ProfileView/index.js +383 -45
  104. package/dist/ProfileView/types/visualization.js +1 -13
  105. package/dist/ProfileView/utils/colorUtils.js +8 -7
  106. package/dist/ProfileViewWithData.js +319 -225
  107. package/dist/QueryControls/index.js +418 -47
  108. package/dist/Sandwich/components/CalleesSection.js +54 -4
  109. package/dist/Sandwich/components/CallersSection.js +97 -27
  110. package/dist/Sandwich/components/TableSection.js +77 -4
  111. package/dist/Sandwich/index.js +125 -12
  112. package/dist/Sandwich/utils/processRowData.js +48 -39
  113. package/dist/SelectWithRefresh/index.js +102 -28
  114. package/dist/SimpleMatchers/Select.js +520 -187
  115. package/dist/SimpleMatchers/index.js +590 -288
  116. package/dist/SourceView/Highlighter.js +230 -70
  117. package/dist/SourceView/LineNo.js +72 -17
  118. package/dist/SourceView/index.js +177 -101
  119. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  120. package/dist/SourceView/lang-detector/index.js +28 -14
  121. package/dist/SourceView/useSelectedLineRange.js +72 -20
  122. package/dist/Table/ColorCell.js +42 -1
  123. package/dist/Table/ColumnsVisibility.js +114 -6
  124. package/dist/Table/MoreDropdown.js +107 -21
  125. package/dist/Table/TableContextMenu.js +144 -134
  126. package/dist/Table/TableContextMenuWrapper.js +59 -14
  127. package/dist/Table/hooks/useColorManagement.js +58 -16
  128. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  129. package/dist/Table/hooks/useTableConfiguration.js +323 -167
  130. package/dist/Table/index.js +217 -123
  131. package/dist/Table/utils/functions.js +169 -144
  132. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  133. package/dist/TimelineGuide/index.js +209 -16
  134. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  135. package/dist/TopTable/index.js +325 -121
  136. package/dist/contexts/LabelsQueryProvider.js +94 -32
  137. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  138. package/dist/contexts/utils.js +37 -15
  139. package/dist/hooks/urlParsers.js +27 -15
  140. package/dist/hooks/useColorBy.js +47 -10
  141. package/dist/hooks/useCompareModeMeta.js +112 -62
  142. package/dist/hooks/useDashboardItems.js +52 -11
  143. package/dist/hooks/useLabels.js +295 -52
  144. package/dist/hooks/useQueryState.d.ts +1 -1
  145. package/dist/hooks/useQueryState.d.ts.map +1 -1
  146. package/dist/hooks/useQueryState.js +375 -329
  147. package/dist/index.js +11 -6
  148. package/dist/testdata/fg-diff.json +3750 -0
  149. package/dist/testdata/fg-simple.json +1879 -0
  150. package/dist/testdata/link_data.json +56 -0
  151. package/dist/testdata/tabular.json +30 -0
  152. package/dist/testdata/test_flamegraph.json +26846 -0
  153. package/dist/testdata/test_graph.json +53 -0
  154. package/dist/useDelayedLoader.js +32 -18
  155. package/dist/useGrpcQuery/index.js +71 -11
  156. package/dist/useHasProfileData.js +90 -12
  157. package/dist/useQuery.js +205 -64
  158. package/dist/useSumBy.d.ts.map +1 -1
  159. package/dist/useSumBy.js +294 -138
  160. package/dist/utils.js +62 -30
  161. package/package.json +9 -9
  162. package/src/GraphTooltipArrow/index.tsx +3 -0
  163. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  164. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  165. package/src/MatchersInput/index.tsx +1 -1
  166. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  167. package/src/PreSelectedMatchers/index.tsx +3 -0
  168. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -2
  169. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
  170. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  171. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  172. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  173. package/src/ProfileSelector/index.tsx +31 -9
  174. package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
  175. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
  176. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  177. package/src/Table/hooks/useTableConfiguration.tsx +7 -13
  178. package/src/hooks/useQueryState.ts +18 -3
  179. package/src/useDelayedLoader.ts +10 -10
  180. package/src/useSumBy.ts +12 -18
  181. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
  182. package/dist/hooks/useQueryState.test.js +0 -868
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { c as _c } from "react-compiler-runtime";
2
2
  // Copyright 2022 The Parca Authors
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -11,6 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
+
14
15
  import { KeyDownProvider, useParcaContext } from '@parca/components';
15
16
  import { useContainerDimensions } from '@parca/hooks';
16
17
  import { selectQueryParam } from '@parca/utilities';
@@ -18,55 +19,392 @@ import ColorStackLegend from './components/ColorStackLegend';
18
19
  import { getDashboardItem } from './components/DashboardItems';
19
20
  import { DashboardLayout } from './components/DashboardLayout';
20
21
  import { ProfileHeader } from './components/ProfileHeader';
21
- import { FlameGraphToolbar, SandwichFlameGraphToolbar, TableToolbar, VisualisationToolbar, } from './components/Toolbars';
22
+ import { FlameGraphToolbar, SandwichFlameGraphToolbar, TableToolbar, VisualisationToolbar } from './components/Toolbars';
22
23
  import { DashboardProvider } from './context/DashboardContext';
23
24
  import { ProfileViewContextProvider } from './context/ProfileViewContext';
24
25
  import { useAutoSelectDimension } from './hooks/useAutoSelectDimension';
25
26
  import { useProfileMetadata } from './hooks/useProfileMetadata';
26
27
  import { useVisualizationState } from './hooks/useVisualizationState';
27
- export const ProfileView = ({ total, filtered, flamegraphData, samplesData, topTableData, sourceData, profileSource, queryClient, onDownloadPProf, pprofDownloading, compare, showVisualizationSelector, sandwichData, onSwitchToFifteenMinutes, }) => {
28
- const { timezone, perf, profileViewExternalMainActions, preferencesModal, profileViewExternalSubActions, } = useParcaContext();
29
- const { ref, dimensions } = useContainerDimensions();
30
- const { curPathArrow, setCurPathArrow, colorStackLegend, colorBy, setColorBy, groupBy, toggleGroupBy, setGroupByLabels, flamechartDimension, setFlamechartDimension, sandwichFunctionName, resetSandwichFunctionName, alignFunctionName, setAlignFunctionName, } = useVisualizationState();
31
- useAutoSelectDimension(flamegraphData.metadataLabels, flamechartDimension, setFlamechartDimension, profileSource?.ProfileType());
32
- const { colorMappings } = useProfileMetadata({
33
- flamegraphArrow: flamegraphData.arrow,
34
- metadataMappingFiles: flamegraphData.metadataMappingFiles,
35
- metadataLoading: flamegraphData.metadataLoading,
36
- colorBy,
28
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
+ export var ProfileView = function ProfileView(t0) {
30
+ var $ = _c(105);
31
+ var total = t0.total,
32
+ filtered = t0.filtered,
33
+ flamegraphData = t0.flamegraphData,
34
+ samplesData = t0.samplesData,
35
+ topTableData = t0.topTableData,
36
+ sourceData = t0.sourceData,
37
+ profileSource = t0.profileSource,
38
+ queryClient = t0.queryClient,
39
+ onDownloadPProf = t0.onDownloadPProf,
40
+ pprofDownloading = t0.pprofDownloading,
41
+ compare = t0.compare,
42
+ showVisualizationSelector = t0.showVisualizationSelector,
43
+ sandwichData = t0.sandwichData,
44
+ onSwitchToFifteenMinutes = t0.onSwitchToFifteenMinutes;
45
+ var _useParcaContext = useParcaContext(),
46
+ timezone = _useParcaContext.timezone,
47
+ perf = _useParcaContext.perf,
48
+ profileViewExternalMainActions = _useParcaContext.profileViewExternalMainActions,
49
+ preferencesModal = _useParcaContext.preferencesModal,
50
+ profileViewExternalSubActions = _useParcaContext.profileViewExternalSubActions;
51
+ var _useContainerDimensio = useContainerDimensions(),
52
+ ref = _useContainerDimensio.ref,
53
+ dimensions = _useContainerDimensio.dimensions;
54
+ var _useVisualizationStat = useVisualizationState(),
55
+ curPathArrow = _useVisualizationStat.curPathArrow,
56
+ setCurPathArrow = _useVisualizationStat.setCurPathArrow,
57
+ colorStackLegend = _useVisualizationStat.colorStackLegend,
58
+ colorBy = _useVisualizationStat.colorBy,
59
+ setColorBy = _useVisualizationStat.setColorBy,
60
+ groupBy = _useVisualizationStat.groupBy,
61
+ toggleGroupBy = _useVisualizationStat.toggleGroupBy,
62
+ setGroupByLabels = _useVisualizationStat.setGroupByLabels,
63
+ flamechartDimension = _useVisualizationStat.flamechartDimension,
64
+ setFlamechartDimension = _useVisualizationStat.setFlamechartDimension,
65
+ sandwichFunctionName = _useVisualizationStat.sandwichFunctionName,
66
+ resetSandwichFunctionName = _useVisualizationStat.resetSandwichFunctionName,
67
+ alignFunctionName = _useVisualizationStat.alignFunctionName,
68
+ setAlignFunctionName = _useVisualizationStat.setAlignFunctionName;
69
+ var t1;
70
+ if ($[0] !== profileSource) {
71
+ t1 = profileSource === null || profileSource === void 0 ? void 0 : profileSource.ProfileType();
72
+ $[0] = profileSource;
73
+ $[1] = t1;
74
+ } else {
75
+ t1 = $[1];
76
+ }
77
+ useAutoSelectDimension(flamegraphData.metadataLabels, flamechartDimension, setFlamechartDimension, t1);
78
+ var t2;
79
+ if ($[2] !== colorBy || $[3] !== flamegraphData.arrow || $[4] !== flamegraphData.metadataLoading || $[5] !== flamegraphData.metadataMappingFiles) {
80
+ t2 = {
81
+ flamegraphArrow: flamegraphData.arrow,
82
+ metadataMappingFiles: flamegraphData.metadataMappingFiles,
83
+ metadataLoading: flamegraphData.metadataLoading,
84
+ colorBy: colorBy
85
+ };
86
+ $[2] = colorBy;
87
+ $[3] = flamegraphData.arrow;
88
+ $[4] = flamegraphData.metadataLoading;
89
+ $[5] = flamegraphData.metadataMappingFiles;
90
+ $[6] = t2;
91
+ } else {
92
+ t2 = $[6];
93
+ }
94
+ var _useProfileMetadata = useProfileMetadata(t2),
95
+ colorMappings = _useProfileMetadata.colorMappings;
96
+ var isColorStackLegendEnabled = colorStackLegend === "true";
97
+ var t3;
98
+ if ($[7] !== compare) {
99
+ t3 = compare === true || selectQueryParam("compare_a") === "true" && selectQueryParam("compare_b") === "true";
100
+ $[7] = compare;
101
+ $[8] = t3;
102
+ } else {
103
+ t3 = $[8];
104
+ }
105
+ var compareMode = t3;
106
+ var t4;
107
+ if ($[9] !== curPathArrow || $[10] !== dimensions || $[11] !== filtered || $[12] !== flamegraphData || $[13] !== onSwitchToFifteenMinutes || $[14] !== perf || $[15] !== profileSource || $[16] !== queryClient || $[17] !== samplesData || $[18] !== sandwichData || $[19] !== setCurPathArrow || $[20] !== sourceData || $[21] !== topTableData || $[22] !== total) {
108
+ t4 = function t4(t5) {
109
+ var type = t5.type,
110
+ isHalfScreen = t5.isHalfScreen;
111
+ return getDashboardItem({
112
+ sandwichData: sandwichData,
113
+ type: type,
114
+ isHalfScreen: isHalfScreen,
115
+ dimensions: dimensions,
116
+ flamegraphData: flamegraphData,
117
+ samplesData: samplesData,
118
+ topTableData: topTableData,
119
+ sourceData: sourceData,
120
+ profileSource: profileSource,
121
+ total: total,
122
+ filtered: filtered,
123
+ curPathArrow: curPathArrow,
124
+ setNewCurPathArrow: setCurPathArrow,
125
+ perf: perf,
126
+ queryClient: queryClient,
127
+ onSwitchToFifteenMinutes: onSwitchToFifteenMinutes
128
+ });
129
+ };
130
+ $[9] = curPathArrow;
131
+ $[10] = dimensions;
132
+ $[11] = filtered;
133
+ $[12] = flamegraphData;
134
+ $[13] = onSwitchToFifteenMinutes;
135
+ $[14] = perf;
136
+ $[15] = profileSource;
137
+ $[16] = queryClient;
138
+ $[17] = samplesData;
139
+ $[18] = sandwichData;
140
+ $[19] = setCurPathArrow;
141
+ $[20] = sourceData;
142
+ $[21] = topTableData;
143
+ $[22] = total;
144
+ $[23] = t4;
145
+ } else {
146
+ t4 = $[23];
147
+ }
148
+ var getDashboardItemByType = t4;
149
+ var t5;
150
+ if ($[24] !== curPathArrow || $[25] !== setCurPathArrow) {
151
+ t5 = /*#__PURE__*/_jsx(FlameGraphToolbar, {
152
+ curPath: curPathArrow,
153
+ setNewCurPath: setCurPathArrow
37
154
  });
38
- const isColorStackLegendEnabled = colorStackLegend === 'true';
39
- const compareMode = compare === true ||
40
- (selectQueryParam('compare_a') === 'true' && selectQueryParam('compare_b') === 'true');
41
- const getDashboardItemByType = ({ type, isHalfScreen, }) => {
42
- return getDashboardItem({
43
- sandwichData,
44
- type,
45
- isHalfScreen,
46
- dimensions,
47
- flamegraphData,
48
- samplesData,
49
- topTableData,
50
- sourceData,
51
- profileSource,
52
- total,
53
- filtered,
54
- curPathArrow,
55
- setNewCurPathArrow: setCurPathArrow,
56
- perf,
57
- queryClient,
58
- onSwitchToFifteenMinutes,
59
- });
155
+ $[24] = curPathArrow;
156
+ $[25] = setCurPathArrow;
157
+ $[26] = t5;
158
+ } else {
159
+ t5 = $[26];
160
+ }
161
+ var t6;
162
+ if ($[27] !== profileSource) {
163
+ t6 = profileSource === null || profileSource === void 0 ? void 0 : profileSource.ProfileType();
164
+ $[27] = profileSource;
165
+ $[28] = t6;
166
+ } else {
167
+ t6 = $[28];
168
+ }
169
+ var t7;
170
+ if ($[29] !== filtered || $[30] !== t6 || $[31] !== total) {
171
+ t7 = /*#__PURE__*/_jsx(TableToolbar, {
172
+ profileType: t6,
173
+ total: total,
174
+ filtered: filtered
175
+ });
176
+ $[29] = filtered;
177
+ $[30] = t6;
178
+ $[31] = total;
179
+ $[32] = t7;
180
+ } else {
181
+ t7 = $[32];
182
+ }
183
+ var t8;
184
+ if ($[33] !== resetSandwichFunctionName || $[34] !== sandwichFunctionName) {
185
+ t8 = /*#__PURE__*/_jsx(SandwichFlameGraphToolbar, {
186
+ resetSandwichFunctionName: resetSandwichFunctionName,
187
+ sandwichFunctionName: sandwichFunctionName
188
+ });
189
+ $[33] = resetSandwichFunctionName;
190
+ $[34] = sandwichFunctionName;
191
+ $[35] = t8;
192
+ } else {
193
+ t8 = $[35];
194
+ }
195
+ var t9;
196
+ if ($[36] !== t5 || $[37] !== t7 || $[38] !== t8) {
197
+ t9 = {
198
+ flame: t5,
199
+ table: t7,
200
+ sandwich: t8
201
+ };
202
+ $[36] = t5;
203
+ $[37] = t7;
204
+ $[38] = t8;
205
+ $[39] = t9;
206
+ } else {
207
+ t9 = $[39];
208
+ }
209
+ var actionButtons = t9;
210
+ var t10;
211
+ if ($[40] !== profileSource || $[41] !== timezone) {
212
+ t10 = profileSource !== undefined && profileSource.toString(timezone) !== "";
213
+ $[40] = profileSource;
214
+ $[41] = timezone;
215
+ $[42] = t10;
216
+ } else {
217
+ t10 = $[42];
218
+ }
219
+ var hasProfileSource = t10;
220
+ var t11;
221
+ if ($[43] !== compareMode || $[44] !== profileSource) {
222
+ t11 = {
223
+ profileSource: profileSource,
224
+ compareMode: compareMode
60
225
  };
61
- const actionButtons = {
62
- flame: _jsx(FlameGraphToolbar, { curPath: curPathArrow, setNewCurPath: setCurPathArrow }),
63
- table: (_jsx(TableToolbar, { profileType: profileSource?.ProfileType(), total: total, filtered: filtered })),
64
- sandwich: (_jsx(SandwichFlameGraphToolbar, { resetSandwichFunctionName: resetSandwichFunctionName, sandwichFunctionName: sandwichFunctionName })),
226
+ $[43] = compareMode;
227
+ $[44] = profileSource;
228
+ $[45] = t11;
229
+ } else {
230
+ t11 = $[45];
231
+ }
232
+ var t12;
233
+ if ($[46] !== profileSource || $[47] !== timezone) {
234
+ t12 = profileSource === null || profileSource === void 0 ? void 0 : profileSource.toString(timezone);
235
+ $[46] = profileSource;
236
+ $[47] = timezone;
237
+ $[48] = t12;
238
+ } else {
239
+ t12 = $[48];
240
+ }
241
+ var t13;
242
+ if ($[49] !== hasProfileSource || $[50] !== profileViewExternalMainActions || $[51] !== t12) {
243
+ t13 = /*#__PURE__*/_jsx(ProfileHeader, {
244
+ profileSourceString: t12,
245
+ hasProfileSource: hasProfileSource,
246
+ externalMainActions: profileViewExternalMainActions
247
+ });
248
+ $[49] = hasProfileSource;
249
+ $[50] = profileViewExternalMainActions;
250
+ $[51] = t12;
251
+ $[52] = t13;
252
+ } else {
253
+ t13 = $[52];
254
+ }
255
+ var t14;
256
+ if ($[53] !== profileSource) {
257
+ t14 = profileSource === null || profileSource === void 0 ? void 0 : profileSource.ProfileType();
258
+ $[53] = profileSource;
259
+ $[54] = t14;
260
+ } else {
261
+ t14 = $[54];
262
+ }
263
+ var t15;
264
+ if ($[55] !== flamegraphData.metadataLabels) {
265
+ var _flamegraphData$metad;
266
+ t15 = (_flamegraphData$metad = flamegraphData.metadataLabels) !== null && _flamegraphData$metad !== void 0 ? _flamegraphData$metad : [];
267
+ $[55] = flamegraphData.metadataLabels;
268
+ $[56] = t15;
269
+ } else {
270
+ t15 = $[56];
271
+ }
272
+ var t16;
273
+ if ($[57] !== flamegraphData.metadataLoading || $[58] !== flamegraphData.metadataRefetch || $[59] !== t15) {
274
+ t16 = {
275
+ labels: t15,
276
+ refetch: flamegraphData.metadataRefetch,
277
+ loading: flamegraphData.metadataLoading
65
278
  };
66
- const hasProfileSource = profileSource !== undefined && profileSource.toString(timezone) !== '';
67
- return (_jsx(KeyDownProvider, { children: _jsx(ProfileViewContextProvider, { value: { profileSource, compareMode }, children: _jsxs(DashboardProvider, { children: [_jsx(ProfileHeader, { profileSourceString: profileSource?.toString(timezone), hasProfileSource: hasProfileSource, externalMainActions: profileViewExternalMainActions }), _jsx(VisualisationToolbar, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, hasProfileSource: hasProfileSource, pprofdownloading: pprofDownloading, profileSource: profileSource, queryClient: queryClient, onDownloadPProf: onDownloadPProf, curPath: curPathArrow, setNewCurPath: setCurPathArrow, profileType: profileSource?.ProfileType(), total: total, filtered: filtered, metadata: {
68
- labels: flamegraphData.metadataLabels ?? [],
69
- refetch: flamegraphData.metadataRefetch,
70
- loading: flamegraphData.metadataLoading,
71
- }, preferencesModal: preferencesModal, profileViewExternalSubActions: profileViewExternalSubActions, setGroupByLabels: setGroupByLabels, flamechartDimension: flamechartDimension, setFlamechartDimension: setFlamechartDimension, showVisualizationSelector: showVisualizationSelector, sandwichFunctionName: sandwichFunctionName, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), isColorStackLegendEnabled && (_jsx(ColorStackLegend, { compareMode: compareMode, mappings: colorMappings, loading: flamegraphData.metadataLoading })), _jsx("div", { className: "w-full", ref: ref, children: _jsx(DashboardLayout, { getDashboardItemByType: getDashboardItemByType, actionButtons: actionButtons }) })] }) }) }));
72
- };
279
+ $[57] = flamegraphData.metadataLoading;
280
+ $[58] = flamegraphData.metadataRefetch;
281
+ $[59] = t15;
282
+ $[60] = t16;
283
+ } else {
284
+ t16 = $[60];
285
+ }
286
+ var t17;
287
+ if ($[61] !== alignFunctionName || $[62] !== colorBy || $[63] !== curPathArrow || $[64] !== filtered || $[65] !== flamechartDimension || $[66] !== groupBy || $[67] !== hasProfileSource || $[68] !== onDownloadPProf || $[69] !== pprofDownloading || $[70] !== preferencesModal || $[71] !== profileSource || $[72] !== profileViewExternalSubActions || $[73] !== queryClient || $[74] !== sandwichFunctionName || $[75] !== setAlignFunctionName || $[76] !== setColorBy || $[77] !== setCurPathArrow || $[78] !== setFlamechartDimension || $[79] !== setGroupByLabels || $[80] !== showVisualizationSelector || $[81] !== t14 || $[82] !== t16 || $[83] !== toggleGroupBy || $[84] !== total) {
288
+ t17 = /*#__PURE__*/_jsx(VisualisationToolbar, {
289
+ groupBy: groupBy,
290
+ toggleGroupBy: toggleGroupBy,
291
+ hasProfileSource: hasProfileSource,
292
+ pprofdownloading: pprofDownloading,
293
+ profileSource: profileSource,
294
+ queryClient: queryClient,
295
+ onDownloadPProf: onDownloadPProf,
296
+ curPath: curPathArrow,
297
+ setNewCurPath: setCurPathArrow,
298
+ profileType: t14,
299
+ total: total,
300
+ filtered: filtered,
301
+ metadata: t16,
302
+ preferencesModal: preferencesModal,
303
+ profileViewExternalSubActions: profileViewExternalSubActions,
304
+ setGroupByLabels: setGroupByLabels,
305
+ flamechartDimension: flamechartDimension,
306
+ setFlamechartDimension: setFlamechartDimension,
307
+ showVisualizationSelector: showVisualizationSelector,
308
+ sandwichFunctionName: sandwichFunctionName,
309
+ alignFunctionName: alignFunctionName,
310
+ setAlignFunctionName: setAlignFunctionName,
311
+ colorBy: colorBy,
312
+ setColorBy: setColorBy
313
+ });
314
+ $[61] = alignFunctionName;
315
+ $[62] = colorBy;
316
+ $[63] = curPathArrow;
317
+ $[64] = filtered;
318
+ $[65] = flamechartDimension;
319
+ $[66] = groupBy;
320
+ $[67] = hasProfileSource;
321
+ $[68] = onDownloadPProf;
322
+ $[69] = pprofDownloading;
323
+ $[70] = preferencesModal;
324
+ $[71] = profileSource;
325
+ $[72] = profileViewExternalSubActions;
326
+ $[73] = queryClient;
327
+ $[74] = sandwichFunctionName;
328
+ $[75] = setAlignFunctionName;
329
+ $[76] = setColorBy;
330
+ $[77] = setCurPathArrow;
331
+ $[78] = setFlamechartDimension;
332
+ $[79] = setGroupByLabels;
333
+ $[80] = showVisualizationSelector;
334
+ $[81] = t14;
335
+ $[82] = t16;
336
+ $[83] = toggleGroupBy;
337
+ $[84] = total;
338
+ $[85] = t17;
339
+ } else {
340
+ t17 = $[85];
341
+ }
342
+ var t18;
343
+ if ($[86] !== colorMappings || $[87] !== compareMode || $[88] !== flamegraphData.metadataLoading || $[89] !== isColorStackLegendEnabled) {
344
+ t18 = isColorStackLegendEnabled && /*#__PURE__*/_jsx(ColorStackLegend, {
345
+ compareMode: compareMode,
346
+ mappings: colorMappings,
347
+ loading: flamegraphData.metadataLoading
348
+ });
349
+ $[86] = colorMappings;
350
+ $[87] = compareMode;
351
+ $[88] = flamegraphData.metadataLoading;
352
+ $[89] = isColorStackLegendEnabled;
353
+ $[90] = t18;
354
+ } else {
355
+ t18 = $[90];
356
+ }
357
+ var t19;
358
+ if ($[91] !== actionButtons || $[92] !== getDashboardItemByType) {
359
+ t19 = /*#__PURE__*/_jsx(DashboardLayout, {
360
+ getDashboardItemByType: getDashboardItemByType,
361
+ actionButtons: actionButtons
362
+ });
363
+ $[91] = actionButtons;
364
+ $[92] = getDashboardItemByType;
365
+ $[93] = t19;
366
+ } else {
367
+ t19 = $[93];
368
+ }
369
+ var t20;
370
+ if ($[94] !== ref || $[95] !== t19) {
371
+ t20 = /*#__PURE__*/_jsx("div", {
372
+ className: "w-full",
373
+ ref: ref,
374
+ children: t19
375
+ });
376
+ $[94] = ref;
377
+ $[95] = t19;
378
+ $[96] = t20;
379
+ } else {
380
+ t20 = $[96];
381
+ }
382
+ var t21;
383
+ if ($[97] !== t13 || $[98] !== t17 || $[99] !== t18 || $[100] !== t20) {
384
+ t21 = /*#__PURE__*/_jsxs(DashboardProvider, {
385
+ children: [t13, t17, t18, t20]
386
+ });
387
+ $[97] = t13;
388
+ $[98] = t17;
389
+ $[99] = t18;
390
+ $[100] = t20;
391
+ $[101] = t21;
392
+ } else {
393
+ t21 = $[101];
394
+ }
395
+ var t22;
396
+ if ($[102] !== t11 || $[103] !== t21) {
397
+ t22 = /*#__PURE__*/_jsx(KeyDownProvider, {
398
+ children: /*#__PURE__*/_jsx(ProfileViewContextProvider, {
399
+ value: t11,
400
+ children: t21
401
+ })
402
+ });
403
+ $[102] = t11;
404
+ $[103] = t21;
405
+ $[104] = t22;
406
+ } else {
407
+ t22 = $[104];
408
+ }
409
+ return t22;
410
+ };
@@ -1,13 +1 @@
1
- // Copyright 2022 The Parca Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- export {};
1
+ export {};
@@ -10,12 +10,13 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
+
13
14
  import { scaleLinear } from 'd3';
14
- export const getColorRange = (isDarkMode) => {
15
- const maxColor = getNewSpanColor(isDarkMode);
16
- const minColor = scaleLinear([isDarkMode ? 'black' : 'white', maxColor])(0.3);
17
- return [minColor, maxColor];
18
- };
19
- export const getNewSpanColor = (isDarkMode) => {
20
- return isDarkMode ? '#4F46E5' : '#4338CA'; // Example colors - adjust as needed
15
+ export var getColorRange = function getColorRange(isDarkMode) {
16
+ var maxColor = getNewSpanColor(isDarkMode);
17
+ var minColor = scaleLinear([isDarkMode ? 'black' : 'white', maxColor])(0.3);
18
+ return [minColor, maxColor];
21
19
  };
20
+ export var getNewSpanColor = function getNewSpanColor(isDarkMode) {
21
+ return isDarkMode ? '#4F46E5' : '#4338CA'; // Example colors - adjust as needed
22
+ };