@parca/profile 0.19.54 → 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 CHANGED
@@ -3,6 +3,14 @@
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
+
10
+ ## [0.19.55](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.54...@parca/profile@0.19.55) (2025-09-16)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.19.54](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.53...@parca/profile@0.19.54) (2025-09-16)
7
15
 
8
16
  **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,CAAC;AAKnC,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAelD,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CA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CAAC,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,eAAe;;;CAG3B,CAAC;AACF,eAAO,MAAM,oBAAoB;;;;CAIhC,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) !== null ? BigInt(cumulativeColumn?.get(row)) : 0n;
47
- const diff = diffColumn?.get(row) !== null ? BigInt(diffColumn?.get(row)) : null;
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,EAsFhC,CAAC"}
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) !== null ? BigInt(cumulativeColumn?.get(selectedRow)) : 0n;
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) !== null ? Number(cumulativeColumn?.get(row)) : 0;
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/ProfileSelector/index.tsx"],"names":[],"mappings":"AAaA,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mBtB,oBAAoB,KAAG,GAAG,CAAC,OAiO7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -15,6 +15,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
15
15
  import { DateTimeRange, IconButton, useGrpcMetadata, useParcaContext, useURLState, } from '@parca/components';
16
16
  import { CloseIcon } from '@parca/icons';
17
17
  import { Query } from '@parca/parser';
18
+ import { TEST_IDS, testId } from '@parca/test-utils';
18
19
  import { useLabelNames } from '../MatchersInput/index';
19
20
  import { useMetricsGraphDimensions } from '../MetricsGraph/useMetricsGraphDimensions';
20
21
  import { UtilizationLabelsProvider } from '../contexts/UtilizationLabelsContext';
@@ -142,7 +143,7 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
142
143
  queryExpressionString === '{}';
143
144
  const queryBrowserRef = useRef(null);
144
145
  const sumByRef = useRef(null);
145
- return (_jsx(UtilizationLabelsProvider, { value: { ...utilizationLabels }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 flex", children: [_jsx(QueryControls, { showProfileTypeSelector: showProfileTypeSelector, showSumBySelector: showSumBySelector, disableExplorativeQuerying: disableExplorativeQuerying, profileTypesData: profileTypesData, profileTypesLoading: profileTypesLoading, selectedProfileName: selectedProfileName, setProfileName: setProfileName, setMatchersString: setMatchersString, setQueryExpression: setQueryExpression, query: query, queryBrowserRef: queryBrowserRef, timeRangeSelection: timeRangeSelection, setTimeRangeSelection: setTimeRangeSelection, searchDisabled: searchDisabled, queryBrowserMode: queryBrowserMode, setQueryBrowserMode: setQueryBrowserMode, advancedModeForQueryBrowser: advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser: setAdvancedModeForQueryBrowser, queryClient: queryClient, sumByRef: sumByRef, labels: labels, sumBySelection: sumBySelection ?? [], sumBySelectionLoading: sumBySelectionLoading, setUserSumBySelection: setUserSumBySelection, profileType: profileType, profileTypesError: error, viewComponent: viewComponent }), comparing && (_jsx("div", { children: _jsx(IconButton, { onClick: () => closeProfile(), icon: _jsx(CloseIcon, {}) }) }))] }), _jsx(MetricsGraphSection, { showMetricsGraph: showMetricsGraph, setDisplayHideMetricsGraphButton: setDisplayHideMetricsGraphButton, heightStyle: utilizationMetrics !== undefined && utilizationMetrics?.length > 0
146
+ return (_jsx(UtilizationLabelsProvider, { value: { ...utilizationLabels }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 flex", children: [_jsx(QueryControls, { showProfileTypeSelector: showProfileTypeSelector, showSumBySelector: showSumBySelector, disableExplorativeQuerying: disableExplorativeQuerying, profileTypesData: profileTypesData, profileTypesLoading: profileTypesLoading, selectedProfileName: selectedProfileName, setProfileName: setProfileName, setMatchersString: setMatchersString, setQueryExpression: setQueryExpression, query: query, queryBrowserRef: queryBrowserRef, timeRangeSelection: timeRangeSelection, setTimeRangeSelection: setTimeRangeSelection, searchDisabled: searchDisabled, queryBrowserMode: queryBrowserMode, setQueryBrowserMode: setQueryBrowserMode, advancedModeForQueryBrowser: advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser: setAdvancedModeForQueryBrowser, queryClient: queryClient, sumByRef: sumByRef, labels: labels, sumBySelection: sumBySelection ?? [], sumBySelectionLoading: sumBySelectionLoading, setUserSumBySelection: setUserSumBySelection, profileType: profileType, profileTypesError: error, viewComponent: viewComponent }), comparing && (_jsx("div", { children: _jsx(IconButton, { onClick: () => closeProfile(), icon: _jsx(CloseIcon, {}), ...testId(TEST_IDS.COMPARE_CLOSE_BUTTON) }) }))] }), _jsx(MetricsGraphSection, { showMetricsGraph: showMetricsGraph, setDisplayHideMetricsGraphButton: setDisplayHideMetricsGraphButton, heightStyle: utilizationMetrics !== undefined && utilizationMetrics?.length > 0
146
147
  ? 'auto'
147
148
  : heightStyle, querySelection: querySelection, profileSelection: profileSelection, comparing: comparing, sumBy: querySelection.sumBy ?? defaultSumBy ?? [], defaultSumByLoading: defaultSumByLoading, queryClient: queryClient, queryExpressionString: queryExpressionString, setTimeRangeSelection: setTimeRangeSelection, selectQuery: selectQuery, selectProfile: selectProfile, query: query, setQueryExpression: setQueryExpression, setNewQueryExpression: setNewQueryExpression, utilizationMetrics: utilizationMetrics, utilizationMetricsLoading: utilizationMetricsLoading, onUtilizationSeriesSelect: onUtilizationSeriesSelect })] }) }));
148
149
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/InvertCallStack/index.tsx"],"names":[],"mappings":"AAiBA,QAAA,MAAM,eAAe,QAAO,GAAG,CAAC,OAkB/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
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
- 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: () => setInvertStack(isInvert ? '' : 'true'), 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
+ 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,19 +1,19 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.19.54",
3
+ "version": "0.19.56",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@floating-ui/react": "^0.27.12",
7
7
  "@headlessui/react": "^1.7.19",
8
8
  "@iconify/react": "^4.0.0",
9
9
  "@parca/client": "0.17.5",
10
- "@parca/components": "0.16.371",
10
+ "@parca/components": "0.16.372",
11
11
  "@parca/dynamicsize": "0.16.67",
12
12
  "@parca/hooks": "0.0.102",
13
13
  "@parca/icons": "0.16.74",
14
14
  "@parca/parser": "0.16.81",
15
15
  "@parca/store": "0.16.186",
16
- "@parca/test-utils": "0.0.13",
16
+ "@parca/test-utils": "0.0.14",
17
17
  "@parca/utilities": "0.0.109",
18
18
  "@popperjs/core": "^2.11.8",
19
19
  "@protobuf-ts/runtime-rpc": "^2.5.0",
@@ -79,5 +79,5 @@
79
79
  "access": "public",
80
80
  "registry": "https://registry.npmjs.org/"
81
81
  },
82
- "gitHead": "842199b0933536a1d704de0fbcac61f8b365d41e"
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
- cumulativeColumn?.get(row) !== null ? BigInt(cumulativeColumn?.get(row)) : 0n;
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}-${viewport.containerHeight}-${selectedRow}-${effectiveDepth}-${width}`;
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) !== null ? BigInt(cumulativeColumn?.get(selectedRow)) : 0n;
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) !== null ? Number(cumulativeColumn?.get(row)) : 0;
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
@@ -25,6 +25,7 @@ import {
25
25
  } from '@parca/components';
26
26
  import {CloseIcon} from '@parca/icons';
27
27
  import {Query} from '@parca/parser';
28
+ import {TEST_IDS, testId} from '@parca/test-utils';
28
29
  import {type NavigateFunction} from '@parca/utilities';
29
30
 
30
31
  import {ProfileSelection} from '..';
@@ -331,7 +332,11 @@ const ProfileSelector = ({
331
332
  />
332
333
  {comparing && (
333
334
  <div>
334
- <IconButton onClick={() => closeProfile()} icon={<CloseIcon />} />
335
+ <IconButton
336
+ onClick={() => closeProfile()}
337
+ icon={<CloseIcon />}
338
+ {...testId(TEST_IDS.COMPARE_CLOSE_BUTTON)}
339
+ />
335
340
  </div>
336
341
  )}
337
342
  </div>
@@ -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={() => setInvertStack(isInvert ? '' : 'true')}
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" />