@parca/profile 0.19.55 → 0.19.56
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 +4 -0
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +2 -2
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +3 -3
- package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
- package/dist/ProfileView/components/InvertCallStack/index.js +7 -1
- package/package.json +2 -2
- package/src/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.tsx +2 -3
- package/src/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.ts +5 -3
- package/src/ProfileView/components/InvertCallStack/index.tsx +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.19.56](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.55...@parca/profile@0.19.56) (2025-09-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.19.55](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.54...@parca/profile@0.19.55) (2025-09-16)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlameGraphNodes.d.ts","sourceRoot":"","sources":["../../../src/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAErC,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAA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AIhC,CAAC;AAEF,eAAO,MAAM,SAAS,4CA6NrB,CAAC"}
|
|
@@ -43,8 +43,8 @@ export const FlameNode = React.memo(function FlameNodeNoMemo({ table, row, color
|
|
|
43
43
|
const binaries = useAppSelector(selectBinaries);
|
|
44
44
|
const mappingFile = arrowToString(mappingColumn?.get(row));
|
|
45
45
|
const functionName = arrowToString(functionNameColumn?.get(row));
|
|
46
|
-
const cumulative = cumulativeColumn?.get(row)
|
|
47
|
-
const diff = diffColumn?.get(row)
|
|
46
|
+
const cumulative = cumulativeColumn?.get(row) != null ? BigInt(cumulativeColumn?.get(row)) : 0n;
|
|
47
|
+
const diff = diffColumn?.get(row) != null ? BigInt(diffColumn?.get(row)) : null;
|
|
48
48
|
const filename = arrowToString(filenameColumn?.get(row));
|
|
49
49
|
const depth = depthColumn?.get(row) ?? 0;
|
|
50
50
|
const valueOffset = valueOffsetColumn?.get(row) !== null && valueOffsetColumn?.get(row) !== undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVisibleNodes.d.ts","sourceRoot":"","sources":["../../../src/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAInC,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAiClD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,iEAO7B,qBAAqB,KAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"useVisibleNodes.d.ts","sourceRoot":"","sources":["../../../src/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAInC,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAiClD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,iEAO7B,qBAAqB,KAAG,MAAM,EAwFhC,CAAC"}
|
|
@@ -55,7 +55,7 @@ export const useVisibleNodes = ({ table, viewport, total, width, selectedRow, ef
|
|
|
55
55
|
const lastResultRef = useRef({ key: '', result: [] });
|
|
56
56
|
return useMemo(() => {
|
|
57
57
|
// Create a stable key for memoization to prevent unnecessary recalculations
|
|
58
|
-
const memoKey = `${viewport.scrollTop}-${viewport.containerHeight}-${selectedRow}-${effectiveDepth}-${width}`;
|
|
58
|
+
const memoKey = `${viewport.scrollTop}-${viewport.containerHeight}-${selectedRow}-${effectiveDepth}-${width}-${Number(total)}-${table.numRows}`;
|
|
59
59
|
// Return cached result if viewport hasn't meaningfully changed
|
|
60
60
|
if (lastResultRef.current.key === memoKey) {
|
|
61
61
|
return lastResultRef.current.result;
|
|
@@ -75,7 +75,7 @@ export const useVisibleNodes = ({ table, viewport, total, width, selectedRow, ef
|
|
|
75
75
|
valueOffsetColumn?.get(selectedRow) !== undefined
|
|
76
76
|
? BigInt(valueOffsetColumn?.get(selectedRow))
|
|
77
77
|
: 0n;
|
|
78
|
-
const selectionCumulative = cumulativeColumn?.get(selectedRow)
|
|
78
|
+
const selectionCumulative = cumulativeColumn?.get(selectedRow) != null ? BigInt(cumulativeColumn?.get(selectedRow)) : 0n;
|
|
79
79
|
const totalNumber = Number(total);
|
|
80
80
|
const selectionOffsetNumber = Number(selectionOffset);
|
|
81
81
|
const selectionCumulativeNumber = Number(selectionCumulative);
|
|
@@ -87,7 +87,7 @@ export const useVisibleNodes = ({ table, viewport, total, width, selectedRow, ef
|
|
|
87
87
|
}
|
|
88
88
|
const rowsAtDepth = depthBuckets[depth];
|
|
89
89
|
for (const row of rowsAtDepth) {
|
|
90
|
-
const cumulative = cumulativeColumn?.get(row)
|
|
90
|
+
const cumulative = cumulativeColumn?.get(row) != null ? Number(cumulativeColumn?.get(row)) : 0;
|
|
91
91
|
const valueOffset = valueOffsetColumn?.get(row) !== null && valueOffsetColumn?.get(row) !== undefined
|
|
92
92
|
? Number(valueOffsetColumn?.get(row))
|
|
93
93
|
: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/InvertCallStack/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/InvertCallStack/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,eAAe,QAAO,GAAG,CAAC,OAyB/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -13,9 +13,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { Icon } from '@iconify/react';
|
|
15
15
|
import { Button, useURLState } from '@parca/components';
|
|
16
|
+
import { useResetFlameGraphState } from '../../hooks/useResetFlameGraphState';
|
|
16
17
|
const InvertCallStack = () => {
|
|
17
18
|
const [invertStack = '', setInvertStack] = useURLState('invert_call_stack');
|
|
18
19
|
const isInvert = invertStack === 'true';
|
|
19
|
-
|
|
20
|
+
const resetFlameGraphState = useResetFlameGraphState();
|
|
21
|
+
const handleSetInvert = (value) => {
|
|
22
|
+
setInvertStack(value ? 'true' : '');
|
|
23
|
+
resetFlameGraphState();
|
|
24
|
+
};
|
|
25
|
+
return (_jsxs("div", { className: "flex flex-col", children: [_jsx("label", { className: "text-sm", children: "\u00A0" }), _jsxs(Button, { variant: "neutral", className: "flex items-center gap-2 whitespace-nowrap", onClick: () => handleSetInvert(!isInvert), id: "h-invert-call-stack", children: [_jsx(Icon, { icon: isInvert ? 'ph:sort-ascending' : 'ph:sort-descending', className: "h-4 w-4" }), isInvert ? 'Original' : 'Invert', " Call Stack"] })] }));
|
|
20
26
|
};
|
|
21
27
|
export default InvertCallStack;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.56",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@floating-ui/react": "^0.27.12",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"access": "public",
|
|
80
80
|
"registry": "https://registry.npmjs.org/"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "dbcf3191c529c532ac3d6a573c40678942ec80a7"
|
|
83
83
|
}
|
|
@@ -116,9 +116,8 @@ export const FlameNode = React.memo(
|
|
|
116
116
|
|
|
117
117
|
const mappingFile: string | null = arrowToString(mappingColumn?.get(row));
|
|
118
118
|
const functionName: string | null = arrowToString(functionNameColumn?.get(row));
|
|
119
|
-
const cumulative =
|
|
120
|
-
|
|
121
|
-
const diff: bigint | null = diffColumn?.get(row) !== null ? BigInt(diffColumn?.get(row)) : null;
|
|
119
|
+
const cumulative = cumulativeColumn?.get(row) != null ? BigInt(cumulativeColumn?.get(row)) : 0n;
|
|
120
|
+
const diff: bigint | null = diffColumn?.get(row) != null ? BigInt(diffColumn?.get(row)) : null;
|
|
122
121
|
const filename: string | null = arrowToString(filenameColumn?.get(row));
|
|
123
122
|
const depth: number = depthColumn?.get(row) ?? 0;
|
|
124
123
|
|
|
@@ -87,7 +87,9 @@ export const useVisibleNodes = ({
|
|
|
87
87
|
|
|
88
88
|
return useMemo(() => {
|
|
89
89
|
// Create a stable key for memoization to prevent unnecessary recalculations
|
|
90
|
-
const memoKey = `${viewport.scrollTop}-${
|
|
90
|
+
const memoKey = `${viewport.scrollTop}-${
|
|
91
|
+
viewport.containerHeight
|
|
92
|
+
}-${selectedRow}-${effectiveDepth}-${width}-${Number(total)}-${table.numRows}`;
|
|
91
93
|
|
|
92
94
|
// Return cached result if viewport hasn't meaningfully changed
|
|
93
95
|
if (lastResultRef.current.key === memoKey) {
|
|
@@ -117,7 +119,7 @@ export const useVisibleNodes = ({
|
|
|
117
119
|
? BigInt(valueOffsetColumn?.get(selectedRow))
|
|
118
120
|
: 0n;
|
|
119
121
|
const selectionCumulative =
|
|
120
|
-
cumulativeColumn?.get(selectedRow)
|
|
122
|
+
cumulativeColumn?.get(selectedRow) != null ? BigInt(cumulativeColumn?.get(selectedRow)) : 0n;
|
|
121
123
|
|
|
122
124
|
const totalNumber = Number(total);
|
|
123
125
|
const selectionOffsetNumber = Number(selectionOffset);
|
|
@@ -134,7 +136,7 @@ export const useVisibleNodes = ({
|
|
|
134
136
|
|
|
135
137
|
for (const row of rowsAtDepth) {
|
|
136
138
|
const cumulative =
|
|
137
|
-
cumulativeColumn?.get(row)
|
|
139
|
+
cumulativeColumn?.get(row) != null ? Number(cumulativeColumn?.get(row)) : 0;
|
|
138
140
|
|
|
139
141
|
const valueOffset =
|
|
140
142
|
valueOffsetColumn?.get(row) !== null && valueOffsetColumn?.get(row) !== undefined
|
|
@@ -15,9 +15,18 @@ import {Icon} from '@iconify/react';
|
|
|
15
15
|
|
|
16
16
|
import {Button, useURLState} from '@parca/components';
|
|
17
17
|
|
|
18
|
+
import {useResetFlameGraphState} from '../../hooks/useResetFlameGraphState';
|
|
19
|
+
|
|
18
20
|
const InvertCallStack = (): JSX.Element => {
|
|
19
21
|
const [invertStack = '', setInvertStack] = useURLState('invert_call_stack');
|
|
20
22
|
const isInvert = invertStack === 'true';
|
|
23
|
+
const resetFlameGraphState = useResetFlameGraphState();
|
|
24
|
+
|
|
25
|
+
const handleSetInvert = (value: boolean): void => {
|
|
26
|
+
setInvertStack(value ? 'true' : '');
|
|
27
|
+
|
|
28
|
+
resetFlameGraphState();
|
|
29
|
+
};
|
|
21
30
|
|
|
22
31
|
return (
|
|
23
32
|
<div className="flex flex-col">
|
|
@@ -25,7 +34,7 @@ const InvertCallStack = (): JSX.Element => {
|
|
|
25
34
|
<Button
|
|
26
35
|
variant="neutral"
|
|
27
36
|
className="flex items-center gap-2 whitespace-nowrap"
|
|
28
|
-
onClick={() =>
|
|
37
|
+
onClick={() => handleSetInvert(!isInvert)}
|
|
29
38
|
id="h-invert-call-stack"
|
|
30
39
|
>
|
|
31
40
|
<Icon icon={isInvert ? 'ph:sort-ascending' : 'ph:sort-descending'} className="h-4 w-4" />
|