@parca/profile 0.19.16 → 0.19.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/GraphTooltipArrow/Content.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/ExpandOnHoverValue.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltip/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltip/index.js +2 -2
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +2 -2
- package/dist/MatchersInput/SuggestionItem.d.ts.map +1 -1
- package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
- package/dist/MatchersInput/index.d.ts.map +1 -1
- package/dist/MetricsCircle/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsContextMenu/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsInfoPanel/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/index.d.ts.map +1 -1
- package/dist/MetricsGraph/index.d.ts.map +1 -1
- package/dist/MetricsGraph/useMetricsGraphDimensions.d.ts.map +1 -1
- package/dist/MetricsGraphStrips/AreaGraph/index.d.ts.map +1 -1
- package/dist/MetricsGraphStrips/index.d.ts.map +1 -1
- package/dist/MetricsSeries/index.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerSingle.d.ts.map +1 -1
- package/dist/ProfileExplorer/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/ContextMenuWrapper.d.ts +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts → ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.d.ts} +8 -8
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.js → ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js} +14 -14
- package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/MemoizedTooltip.js +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -0
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/index.d.ts +7 -7
- package/dist/ProfileFlameGraph/FlameGraphArrow/index.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/index.js +38 -12
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.d.ts.map +1 -0
- package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.d.ts.map +1 -0
- package/dist/ProfileFlameGraph/FlameGraphArrow/utils.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph → ProfileFlameGraph}/index.d.ts +8 -8
- package/dist/ProfileFlameGraph/index.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph → ProfileFlameGraph}/index.js +33 -33
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileSelector/CompareButton.d.ts.map +1 -1
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
- package/dist/ProfileSelector/useAutoQuerySelector.js +1 -1
- package/dist/ProfileSource.d.ts.map +1 -1
- package/dist/ProfileTypeSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +1 -1
- package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
- package/dist/ProfileView/components/ColorStackLegend.js +2 -2
- package/dist/ProfileView/components/DashboardItems/index.d.ts +1 -1
- package/dist/ProfileView/components/DashboardItems/index.d.ts.map +1 -1
- package/dist/ProfileView/components/DashboardItems/index.js +7 -7
- package/dist/ProfileView/components/DashboardLayout/index.d.ts +1 -1
- package/dist/ProfileView/components/DashboardLayout/index.d.ts.map +1 -1
- package/dist/ProfileView/components/DiffLegend.js +1 -1
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts.map +1 -1
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +1 -1
- package/dist/ProfileView/components/ShareButton/ResultBox.d.ts.map +1 -1
- package/dist/ProfileView/components/ShareButton/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +1 -1
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.d.ts +5 -5
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +4 -4
- package/dist/ProfileView/components/ViewSelector/Dropdown.d.ts +2 -1
- package/dist/ProfileView/components/ViewSelector/Dropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/Dropdown.js +2 -2
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +12 -8
- package/dist/ProfileView/components/VisualizationContainer/index.d.ts +1 -1
- package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
- package/dist/ProfileView/components/VisualizationPanel.d.ts +1 -1
- package/dist/ProfileView/components/VisualizationPanel.d.ts.map +1 -1
- package/dist/ProfileView/components/VisualizationPanel.js +1 -1
- package/dist/ProfileView/context/ProfileViewContext.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useProfileMetadata.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useProfileMetadata.js +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.d.ts +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.js +1 -1
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +3 -3
- package/dist/ProfileView/types/visualization.d.ts +1 -1
- package/dist/ProfileView/types/visualization.d.ts.map +1 -1
- package/dist/ProfileView/utils/colorUtils.d.ts.map +1 -1
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +10 -10
- package/dist/Sandwich/components/CalleesSection.d.ts +1 -1
- package/dist/Sandwich/components/CalleesSection.d.ts.map +1 -1
- package/dist/Sandwich/components/CalleesSection.js +3 -3
- package/dist/Sandwich/components/CallersSection.d.ts +1 -1
- package/dist/Sandwich/components/CallersSection.d.ts.map +1 -1
- package/dist/Sandwich/components/CallersSection.js +3 -3
- package/dist/Sandwich/index.d.ts.map +1 -1
- package/dist/Sandwich/index.js +3 -5
- package/dist/Sandwich/utils/processRowData.d.ts +1 -1
- package/dist/Sandwich/utils/processRowData.d.ts.map +1 -1
- package/dist/SimpleMatchers/index.d.ts.map +1 -1
- package/dist/SourceView/Highlighter.d.ts.map +1 -1
- package/dist/SourceView/LineNo.d.ts.map +1 -1
- package/dist/SourceView/lang-detector/index.d.ts.map +1 -1
- package/dist/Table/ColorCell.d.ts.map +1 -1
- package/dist/Table/ColumnsVisibility.d.ts.map +1 -1
- package/dist/Table/MoreDropdown.d.ts.map +1 -1
- package/dist/Table/TableContextMenu.d.ts.map +1 -1
- package/dist/Table/hooks/useColorManagement.js +1 -1
- package/dist/Table/index.js +2 -2
- package/dist/Table/utils/functions.d.ts +1 -1
- package/dist/Table/utils/functions.d.ts.map +1 -1
- package/dist/TimelineGuide/index.d.ts.map +1 -1
- package/dist/TopTable/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/useDelayedLoader.d.ts.map +1 -1
- package/dist/useGrpcQuery/index.d.ts.map +1 -1
- package/dist/useQuery.d.ts.map +1 -1
- package/dist/useSumBy.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/GraphTooltipArrow/useGraphTooltip/index.ts +2 -2
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +2 -2
- package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/ContextMenuWrapper.tsx +1 -1
- package/src/{ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.tsx → ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.tsx} +27 -30
- package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/MemoizedTooltip.tsx +1 -1
- package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/index.tsx +55 -23
- package/src/{ProfileIcicleGraph/benchmarks/ProfileIcicleGraph-10M.benchmark.tsx → ProfileFlameGraph/benchmarks/ProfileFlameGraph-10M.benchmark.tsx} +2 -2
- package/src/{ProfileIcicleGraph/benchmarks/ProfileIcicleGraph-1M.benchmark.tsx → ProfileFlameGraph/benchmarks/ProfileFlameGraph-1M.benchmark.tsx} +2 -2
- package/src/{ProfileIcicleGraph/benchmarks/ProfileIcicleGraph-20M.benchmark.tsx → ProfileFlameGraph/benchmarks/ProfileFlameGraph-20M.benchmark.tsx} +2 -2
- package/src/{ProfileIcicleGraph → ProfileFlameGraph}/index.tsx +57 -57
- package/src/ProfileSelector/useAutoQuerySelector.ts +1 -1
- package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +1 -1
- package/src/ProfileView/components/ColorStackLegend.tsx +2 -2
- package/src/ProfileView/components/DashboardItems/index.tsx +8 -8
- package/src/ProfileView/components/DashboardLayout/index.tsx +1 -1
- package/src/ProfileView/components/DiffLegend.tsx +3 -3
- package/src/ProfileView/components/GroupByLabelsDropdown/index.tsx +1 -1
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +1 -1
- package/src/ProfileView/components/Toolbars/index.tsx +7 -7
- package/src/ProfileView/components/ViewSelector/Dropdown.tsx +8 -1
- package/src/ProfileView/components/ViewSelector/index.tsx +12 -7
- package/src/ProfileView/components/VisualizationContainer/index.tsx +1 -1
- package/src/ProfileView/components/VisualizationPanel.tsx +4 -4
- package/src/ProfileView/hooks/useProfileMetadata.ts +1 -1
- package/src/ProfileView/hooks/useVisualizationState.ts +2 -2
- package/src/ProfileView/index.tsx +4 -4
- package/src/ProfileView/types/visualization.ts +2 -2
- package/src/ProfileViewWithData.tsx +10 -10
- package/src/Sandwich/components/CalleesSection.tsx +4 -4
- package/src/Sandwich/components/CallersSection.tsx +5 -5
- package/src/Sandwich/index.tsx +10 -4
- package/src/Sandwich/utils/processRowData.ts +1 -1
- package/src/Table/hooks/useColorManagement.ts +1 -1
- package/src/Table/index.tsx +2 -2
- package/src/Table/utils/functions.ts +1 -1
- package/src/index.tsx +2 -2
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/TextWithEllipsis.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/TooltipContext.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/useMappingList.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/useNodeColor.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/utils.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/index.d.ts.map +0 -1
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/ContextMenu.d.ts +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/ContextMenu.js +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/ContextMenuWrapper.js +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/MemoizedTooltip.d.ts +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/TextWithEllipsis.d.ts +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/TextWithEllipsis.js +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/TooltipContext.d.ts +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/TooltipContext.js +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/useMappingList.d.ts +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/useMappingList.js +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/useNodeColor.d.ts +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/useNodeColor.js +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/utils.d.ts +0 -0
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/utils.js +0 -0
- /package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/ContextMenu.tsx +0 -0
- /package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/TextWithEllipsis.tsx +0 -0
- /package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/TooltipContext.tsx +0 -0
- /package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/useMappingList.ts +0 -0
- /package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/useNodeColor.ts +0 -0
- /package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/utils.ts +0 -0
- /package/src/{ProfileIcicleGraph → ProfileFlameGraph}/benchmarks/benchdata/populateData.js +0 -0
|
@@ -21,8 +21,6 @@ import {isSearchMatch} from '@parca/utilities';
|
|
|
21
21
|
|
|
22
22
|
import 'react-contexify/dist/ReactContexify.css';
|
|
23
23
|
|
|
24
|
-
import {USER_PREFERENCES} from '@parca/hooks';
|
|
25
|
-
|
|
26
24
|
import {ProfileSource} from '../../ProfileSource';
|
|
27
25
|
import TextWithEllipsis from './TextWithEllipsis';
|
|
28
26
|
import {
|
|
@@ -32,7 +30,6 @@ import {
|
|
|
32
30
|
FIELD_FUNCTION_FILE_NAME,
|
|
33
31
|
FIELD_FUNCTION_NAME,
|
|
34
32
|
FIELD_MAPPING_FILE,
|
|
35
|
-
FIELD_PARENT,
|
|
36
33
|
FIELD_TIMESTAMP,
|
|
37
34
|
FIELD_VALUE_OFFSET,
|
|
38
35
|
} from './index';
|
|
@@ -45,7 +42,7 @@ export interface colorByColors {
|
|
|
45
42
|
[key: string]: string;
|
|
46
43
|
}
|
|
47
44
|
|
|
48
|
-
export interface
|
|
45
|
+
export interface FlameNodeProps {
|
|
49
46
|
height: number;
|
|
50
47
|
totalWidth: number;
|
|
51
48
|
table: Table<any>;
|
|
@@ -59,30 +56,30 @@ export interface IcicleNodeProps {
|
|
|
59
56
|
colorForSimilarNodes: string;
|
|
60
57
|
selectedRow: number;
|
|
61
58
|
onClick: () => void;
|
|
62
|
-
|
|
59
|
+
isFlameChart: boolean;
|
|
63
60
|
profileSource: ProfileSource;
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
isRenderedAsFlamegraph?: boolean;
|
|
62
|
+
isInSandwichView?: boolean;
|
|
66
63
|
maxDepth?: number;
|
|
67
64
|
effectiveDepth?: number;
|
|
68
65
|
tooltipId?: string;
|
|
69
66
|
|
|
70
|
-
// Hovering row must only ever be used for highlighting similar nodes, otherwise it will cause performance issues as it causes the full
|
|
67
|
+
// Hovering row must only ever be used for highlighting similar nodes, otherwise it will cause performance issues as it causes the full flamegraph to get rerendered every time the hovering row changes.
|
|
71
68
|
hoveringRow?: number;
|
|
72
69
|
setHoveringRow: (row: number | undefined) => void;
|
|
73
70
|
}
|
|
74
71
|
|
|
75
|
-
export const
|
|
72
|
+
export const flameRectStyles = {
|
|
76
73
|
cursor: 'pointer',
|
|
77
74
|
transition: 'opacity .15s linear',
|
|
78
75
|
};
|
|
79
|
-
export const
|
|
76
|
+
export const fadedFlameRectStyles = {
|
|
80
77
|
cursor: 'pointer',
|
|
81
78
|
transition: 'opacity .15s linear',
|
|
82
79
|
opacity: '0.5',
|
|
83
80
|
};
|
|
84
81
|
|
|
85
|
-
export const
|
|
82
|
+
export const FlameNode = React.memo(function FlameNodeNoMemo({
|
|
86
83
|
table,
|
|
87
84
|
row,
|
|
88
85
|
colors,
|
|
@@ -98,14 +95,14 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
|
|
|
98
95
|
onContextMenu,
|
|
99
96
|
hoveringRow,
|
|
100
97
|
setHoveringRow,
|
|
101
|
-
|
|
98
|
+
isFlameChart,
|
|
102
99
|
profileSource,
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
isRenderedAsFlamegraph = false,
|
|
101
|
+
isInSandwichView = false,
|
|
105
102
|
maxDepth = 0,
|
|
106
103
|
effectiveDepth,
|
|
107
104
|
tooltipId = 'default',
|
|
108
|
-
}:
|
|
105
|
+
}: FlameNodeProps): React.JSX.Element {
|
|
109
106
|
// get the columns to read from
|
|
110
107
|
const mappingColumn = table.getChild(FIELD_MAPPING_FILE);
|
|
111
108
|
const functionNameColumn = table.getChild(FIELD_FUNCTION_NAME);
|
|
@@ -181,8 +178,8 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
|
|
|
181
178
|
return <></>;
|
|
182
179
|
}
|
|
183
180
|
|
|
184
|
-
if (row === 0 && (
|
|
185
|
-
// The root node is not rendered in the
|
|
181
|
+
if (row === 0 && (isFlameChart || isInSandwichView)) {
|
|
182
|
+
// The root node is not rendered in the flame chart or sandwich view, so we return null.
|
|
186
183
|
return <></>;
|
|
187
184
|
}
|
|
188
185
|
|
|
@@ -190,7 +187,7 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
|
|
|
190
187
|
const tsBounds = boundsFromProfileSource(profileSource);
|
|
191
188
|
const total = cumulativeColumn?.get(selectedRow);
|
|
192
189
|
const totalRatio = cumulative > total ? 1 : Number(cumulative) / Number(total);
|
|
193
|
-
const width: number =
|
|
190
|
+
const width: number = isFlameChart
|
|
194
191
|
? (Number(cumulative) / (Number(tsBounds[1]) - Number(tsBounds[0]))) * totalWidth
|
|
195
192
|
: totalRatio * totalWidth;
|
|
196
193
|
|
|
@@ -200,12 +197,12 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
|
|
|
200
197
|
|
|
201
198
|
const selectedDepth = depthColumn?.get(selectedRow);
|
|
202
199
|
const styles =
|
|
203
|
-
selectedDepth !== undefined && selectedDepth > depth ?
|
|
200
|
+
selectedDepth !== undefined && selectedDepth > depth ? fadedFlameRectStyles : flameRectStyles;
|
|
204
201
|
|
|
205
202
|
const onMouseEnter = (): void => {
|
|
206
203
|
setHoveringRow(row);
|
|
207
204
|
window.dispatchEvent(
|
|
208
|
-
new CustomEvent(`
|
|
205
|
+
new CustomEvent(`flame-tooltip-update-${tooltipId}`, {
|
|
209
206
|
detail: {row},
|
|
210
207
|
})
|
|
211
208
|
);
|
|
@@ -214,7 +211,7 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
|
|
|
214
211
|
const onMouseLeave = (): void => {
|
|
215
212
|
setHoveringRow(undefined);
|
|
216
213
|
window.dispatchEvent(
|
|
217
|
-
new CustomEvent(`
|
|
214
|
+
new CustomEvent(`flame-tooltip-update-${tooltipId}`, {
|
|
218
215
|
detail: {row: null},
|
|
219
216
|
})
|
|
220
217
|
);
|
|
@@ -226,25 +223,25 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
|
|
|
226
223
|
|
|
227
224
|
const ts = tsColumn !== null ? Number(tsColumn.get(row)) : 0;
|
|
228
225
|
const x =
|
|
229
|
-
|
|
226
|
+
isFlameChart && tsColumn !== null
|
|
230
227
|
? ((ts - Number(tsBounds[0])) / (Number(tsBounds[1]) - Number(tsBounds[0]))) * totalWidth
|
|
231
228
|
: selectedDepth > depth
|
|
232
229
|
? 0
|
|
233
230
|
: ((Number(valueOffset) - Number(selectionOffset)) / Number(total)) * totalWidth;
|
|
234
231
|
|
|
235
232
|
const calculateY = (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
233
|
+
isRenderedAsFlamegraph: boolean,
|
|
234
|
+
isInSandwichView: boolean,
|
|
235
|
+
isFlameChart: boolean,
|
|
239
236
|
maxDepth: number,
|
|
240
237
|
depth: number,
|
|
241
238
|
height: number
|
|
242
239
|
): number => {
|
|
243
|
-
if (
|
|
240
|
+
if (isRenderedAsFlamegraph) {
|
|
244
241
|
return (maxDepth - depth) * height; // Flamegraph is inverted
|
|
245
242
|
}
|
|
246
243
|
|
|
247
|
-
if (
|
|
244
|
+
if (isFlameChart || isInSandwichView) {
|
|
248
245
|
return (depth - 1) * height;
|
|
249
246
|
}
|
|
250
247
|
|
|
@@ -252,9 +249,9 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
|
|
|
252
249
|
};
|
|
253
250
|
|
|
254
251
|
const y = calculateY(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
252
|
+
isRenderedAsFlamegraph,
|
|
253
|
+
isInSandwichView,
|
|
254
|
+
isFlameChart,
|
|
258
255
|
effectiveDepth ?? maxDepth,
|
|
259
256
|
depth,
|
|
260
257
|
height
|
|
@@ -38,7 +38,7 @@ export const MemoizedTooltip = memo(function MemoizedTooltip({
|
|
|
38
38
|
setTooltipRow(event.detail.row);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const eventName = `
|
|
41
|
+
const eventName = `flame-tooltip-update-${tooltipId}`;
|
|
42
42
|
|
|
43
43
|
// Delay to ensure all DOM updates and React renders are complete
|
|
44
44
|
// This fixes the race condition in sandwich view
|
package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileFlameGraph/FlameGraphArrow}/index.tsx
RENAMED
|
@@ -25,7 +25,7 @@ import {Dictionary, Table, Vector, tableFromIPC} from 'apache-arrow';
|
|
|
25
25
|
import {useContextMenu} from 'react-contexify';
|
|
26
26
|
|
|
27
27
|
import {FlamegraphArrow} from '@parca/client';
|
|
28
|
-
import {useURLState} from '@parca/components';
|
|
28
|
+
import {useParcaContext, useURLState} from '@parca/components';
|
|
29
29
|
import {USER_PREFERENCES, useCurrentColorProfile, useUserPreference} from '@parca/hooks';
|
|
30
30
|
import {ProfileType} from '@parca/parser';
|
|
31
31
|
import {getColorForFeature, selectDarkMode, useAppSelector} from '@parca/store';
|
|
@@ -34,7 +34,7 @@ import {getLastItem, type ColorConfig} from '@parca/utilities';
|
|
|
34
34
|
import {ProfileSource} from '../../ProfileSource';
|
|
35
35
|
import {useProfileViewContext} from '../../ProfileView/context/ProfileViewContext';
|
|
36
36
|
import ContextMenuWrapper, {ContextMenuWrapperRef} from './ContextMenuWrapper';
|
|
37
|
-
import {
|
|
37
|
+
import {FlameNode, RowHeight, colorByColors} from './FlameGraphNodes';
|
|
38
38
|
import {MemoizedTooltip} from './MemoizedTooltip';
|
|
39
39
|
import {TooltipProvider} from './TooltipContext';
|
|
40
40
|
import {useFilenamesList} from './useMappingList';
|
|
@@ -69,7 +69,7 @@ export const FIELD_PARENT = 'parent';
|
|
|
69
69
|
export const FIELD_DEPTH = 'depth';
|
|
70
70
|
export const FIELD_VALUE_OFFSET = 'value_offset';
|
|
71
71
|
|
|
72
|
-
interface
|
|
72
|
+
interface FlameGraphArrowProps {
|
|
73
73
|
arrow: FlamegraphArrow;
|
|
74
74
|
total: bigint;
|
|
75
75
|
filtered: bigint;
|
|
@@ -81,9 +81,9 @@ interface IcicleGraphArrowProps {
|
|
|
81
81
|
isHalfScreen: boolean;
|
|
82
82
|
mappingsListFromMetadata: string[];
|
|
83
83
|
compareAbsolute: boolean;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
isFlameChart?: boolean;
|
|
85
|
+
isRenderedAsFlamegraph?: boolean;
|
|
86
|
+
isInSandwichView?: boolean;
|
|
87
87
|
tooltipId?: string;
|
|
88
88
|
maxFrameCount?: number;
|
|
89
89
|
isExpanded?: boolean;
|
|
@@ -130,7 +130,7 @@ function getMaxDepth(depthColumn: Vector<any> | null): number {
|
|
|
130
130
|
return max;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
export const
|
|
133
|
+
export const FlameGraphArrow = memo(function FlameGraphArrow({
|
|
134
134
|
arrow,
|
|
135
135
|
total,
|
|
136
136
|
filtered,
|
|
@@ -141,27 +141,59 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
|
|
|
141
141
|
profileSource,
|
|
142
142
|
mappingsListFromMetadata,
|
|
143
143
|
compareAbsolute,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
isFlameChart = false,
|
|
145
|
+
isRenderedAsFlamegraph = false,
|
|
146
|
+
isInSandwichView = false,
|
|
147
147
|
tooltipId = 'default',
|
|
148
148
|
maxFrameCount,
|
|
149
149
|
isExpanded = false,
|
|
150
|
-
}:
|
|
150
|
+
}: FlameGraphArrowProps): React.JSX.Element {
|
|
151
151
|
const [highlightSimilarStacksPreference] = useUserPreference<boolean>(
|
|
152
152
|
USER_PREFERENCES.HIGHLIGHT_SIMILAR_STACKS.key
|
|
153
153
|
);
|
|
154
154
|
const [hoveringRow, setHoveringRow] = useState<number | undefined>(undefined);
|
|
155
155
|
const [dockedMetainfo] = useUserPreference<boolean>(USER_PREFERENCES.GRAPH_METAINFO_DOCKED.key);
|
|
156
156
|
const isDarkMode = useAppSelector(selectDarkMode);
|
|
157
|
+
const {perf} = useParcaContext();
|
|
157
158
|
|
|
158
159
|
const table: Table<any> = useMemo(() => {
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
const result = tableFromIPC(arrow.record);
|
|
161
|
+
|
|
162
|
+
if (perf?.setMeasurement != null) {
|
|
163
|
+
perf.setMeasurement('flamegraph.node_count', result.numRows);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return result;
|
|
167
|
+
}, [arrow, perf]);
|
|
161
168
|
const svg = useRef(null);
|
|
169
|
+
const renderStartTime = useRef<number>(0);
|
|
162
170
|
|
|
163
171
|
const [svgElement, setSvgElement] = useState<SVGSVGElement | null>(null);
|
|
164
172
|
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
if (perf?.markInteraction != null) {
|
|
175
|
+
renderStartTime.current = performance.now();
|
|
176
|
+
}
|
|
177
|
+
}, [table, width, curPath, perf]);
|
|
178
|
+
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
if (perf?.setMeasurement != null && renderStartTime.current > 0) {
|
|
181
|
+
const measureRenderTime = (): void => {
|
|
182
|
+
const renderTime = performance.now() - renderStartTime.current;
|
|
183
|
+
if (perf?.setMeasurement != null) {
|
|
184
|
+
perf.setMeasurement('flamegraph.render_time', renderTime);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (renderTime > 500 && perf.captureMessage != null) {
|
|
188
|
+
perf.captureMessage(`Slow flamegraph render: ${renderTime.toFixed(0)}ms`, 'warning');
|
|
189
|
+
}
|
|
190
|
+
renderStartTime.current = 0;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
requestAnimationFrame(measureRenderTime);
|
|
194
|
+
}
|
|
195
|
+
}, [table, width, curPath, perf]);
|
|
196
|
+
|
|
165
197
|
useEffect(() => {
|
|
166
198
|
setSvgElement(svg.current);
|
|
167
199
|
}, [tooltipId]);
|
|
@@ -226,7 +258,7 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
|
|
|
226
258
|
|
|
227
259
|
const colorByColors: colorByColors = colorByList[colorByValue as ColorByKey];
|
|
228
260
|
|
|
229
|
-
const MENU_ID = '
|
|
261
|
+
const MENU_ID = 'flame-graph-context-menu';
|
|
230
262
|
const contextMenuRef = useRef<ContextMenuWrapperRef>(null);
|
|
231
263
|
const {show, hideAll} = useContextMenu({
|
|
232
264
|
id: MENU_ID,
|
|
@@ -286,7 +318,7 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
|
|
|
286
318
|
// Use deferred value to prevent UI blocking when expanding frames
|
|
287
319
|
const deferredEffectiveDepth = useDeferredValue(effectiveDepth);
|
|
288
320
|
|
|
289
|
-
const height =
|
|
321
|
+
const height = isInSandwichView
|
|
290
322
|
? deferredEffectiveDepth * RowHeight
|
|
291
323
|
: (deferredEffectiveDepth + 1) * RowHeight;
|
|
292
324
|
|
|
@@ -338,7 +370,7 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
|
|
|
338
370
|
hideBinary={hideBinary}
|
|
339
371
|
unit={arrow.unit}
|
|
340
372
|
profileType={profileType}
|
|
341
|
-
|
|
373
|
+
isInSandwichView={isInSandwichView}
|
|
342
374
|
/>
|
|
343
375
|
<MemoizedTooltip contextElement={svgElement} dockedMetainfo={dockedMetainfo} />
|
|
344
376
|
<svg
|
|
@@ -349,7 +381,7 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
|
|
|
349
381
|
ref={svg}
|
|
350
382
|
>
|
|
351
383
|
{Array.from({length: table.numRows}, (_, row) => (
|
|
352
|
-
<
|
|
384
|
+
<FlameNode
|
|
353
385
|
key={row}
|
|
354
386
|
table={table}
|
|
355
387
|
row={row} // root is always row 0 in the arrow record
|
|
@@ -363,8 +395,8 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
|
|
|
363
395
|
colorForSimilarNodes={colorForSimilarNodes}
|
|
364
396
|
selectedRow={selectedRow}
|
|
365
397
|
onClick={() => {
|
|
366
|
-
if (
|
|
367
|
-
// We don't want to expand in
|
|
398
|
+
if (isFlameChart) {
|
|
399
|
+
// We don't want to expand in flame charts.
|
|
368
400
|
return;
|
|
369
401
|
}
|
|
370
402
|
handleRowClick(row);
|
|
@@ -372,10 +404,10 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
|
|
|
372
404
|
onContextMenu={displayMenu}
|
|
373
405
|
hoveringRow={highlightSimilarStacksPreference ? hoveringRow : undefined}
|
|
374
406
|
setHoveringRow={highlightSimilarStacksPreference ? setHoveringRow : noop}
|
|
375
|
-
|
|
407
|
+
isFlameChart={isFlameChart}
|
|
376
408
|
profileSource={profileSource}
|
|
377
|
-
|
|
378
|
-
|
|
409
|
+
isRenderedAsFlamegraph={isRenderedAsFlamegraph}
|
|
410
|
+
isInSandwichView={isInSandwichView}
|
|
379
411
|
maxDepth={maxDepth}
|
|
380
412
|
effectiveDepth={deferredEffectiveDepth}
|
|
381
413
|
tooltipId={tooltipId}
|
|
@@ -387,4 +419,4 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
|
|
|
387
419
|
);
|
|
388
420
|
});
|
|
389
421
|
|
|
390
|
-
export default
|
|
422
|
+
export default FlameGraphArrow;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import
|
|
15
|
+
import ProfileFlameGraph from '..';
|
|
16
16
|
import {Provider} from 'react-redux';
|
|
17
17
|
import {createStore} from '@parca/store';
|
|
18
18
|
import parca10mGraphData from './benchdata/parca-10m.json';
|
|
@@ -26,7 +26,7 @@ export default function ({callback = () => {}}): React.ReactElement {
|
|
|
26
26
|
return (
|
|
27
27
|
<div ref={callback}>
|
|
28
28
|
<Provider store={reduxStore}>
|
|
29
|
-
<
|
|
29
|
+
<ProfileFlameGraph
|
|
30
30
|
graph={parca10mGraph}
|
|
31
31
|
sampleUnit={parca10mGraph.unit}
|
|
32
32
|
curPath={[]}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import
|
|
15
|
+
import ProfileFlameGraph from '../';
|
|
16
16
|
import {Provider} from 'react-redux';
|
|
17
17
|
import {createStore} from '@parca/store';
|
|
18
18
|
import {Flamegraph} from '@parca/client';
|
|
@@ -26,7 +26,7 @@ export default function ({callback = () => {}}): React.ReactElement {
|
|
|
26
26
|
return (
|
|
27
27
|
<div ref={callback}>
|
|
28
28
|
<Provider store={reduxStore}>
|
|
29
|
-
<
|
|
29
|
+
<ProfileFlameGraph
|
|
30
30
|
graph={parca1mGraph}
|
|
31
31
|
sampleUnit={parca1mGraph.unit}
|
|
32
32
|
curPath={[]}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import
|
|
15
|
+
import ProfileFlameGraph from '..';
|
|
16
16
|
import {Provider} from 'react-redux';
|
|
17
17
|
import {createStore} from '@parca/store';
|
|
18
18
|
import parca20mGraphData from './benchdata/parca-20m.json';
|
|
@@ -26,7 +26,7 @@ export default function ({callback = () => {}}): React.ReactElement {
|
|
|
26
26
|
return (
|
|
27
27
|
<div ref={callback}>
|
|
28
28
|
<Provider store={reduxStore}>
|
|
29
|
-
<
|
|
29
|
+
<ProfileFlameGraph
|
|
30
30
|
graph={parca20mGraph}
|
|
31
31
|
sampleUnit={parca20mGraph.unit}
|
|
32
32
|
curPath={[]}
|