@parca/profile 0.19.8 → 0.19.9

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,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.9](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.8...@parca/profile@0.19.9) (2025-06-25)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.19.8](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.7...@parca/profile@0.19.8) (2025-06-25)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -1 +1 @@
1
- {"version":3,"file":"MetricsGraphSection.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/MetricsGraphSection.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAQ,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAyB,gBAAgB,EAAC,MAAM,IAAI,CAAC;AAI5D,OAAO,EAAC,cAAc,EAAE,KAAK,kBAAkB,IAAI,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAE1F,UAAU,wBAAwB;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gCAAgC,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,kBAAkB,CAAC;IAChC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,kBAAkB,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,KAAK,CAAC;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,iBAAiB,EAAE,MAAM,CAAC;QAC1B,IAAI,EAAE,sBAAsB,EAAE,CAAC;KAChC,CAAC,CAAC;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KAAK,IAAI,CAAC;CACnF;AAED,wBAAgB,mBAAmB,CAAC,EAClC,gBAAgB,EAChB,gCAAgC,EAChC,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,GAC1B,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAmMxC"}
1
+ {"version":3,"file":"MetricsGraphSection.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/MetricsGraphSection.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAQ,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,m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M,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KAAK,IAAI,CAAC;CACnF;AAED,wBAAgB,mBAAmB,CAAC,EAClC,gBAAgB,EAChB,gCAAgC,EAChC,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,GAC1B,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAsMxC"}
@@ -17,7 +17,9 @@ import { MergedProfileSelection } from '..';
17
17
  import UtilizationMetricsGraph from '../MetricsGraph/UtilizationMetrics';
18
18
  import AreaChart from '../MetricsGraph/UtilizationMetrics/Throughput';
19
19
  import ProfileMetricsGraph, { ProfileMetricsEmptyState } from '../ProfileMetricsGraph';
20
+ import { useResetStateOnSeriesChange } from '../ProfileView/hooks/useResetStateOnSeriesChange';
20
21
  export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGraphButton, heightStyle, querySelection, profileSelection, comparing, sumBy, defaultSumByLoading, queryClient, queryExpressionString, setTimeRangeSelection, selectQuery, selectProfile, query, setNewQueryExpression, utilizationMetrics, utilizationMetricsLoading, onUtilizationSeriesSelect, }) {
22
+ const resetStateOnSeriesChange = useResetStateOnSeriesChange();
21
23
  const handleTimeRangeChange = (range) => {
22
24
  const from = range.getFromMs();
23
25
  const to = range.getToMs();
@@ -74,6 +76,7 @@ export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGra
74
76
  const durationInMilliseconds = duration / 1000000; // duration is in nanoseconds
75
77
  const mergeFrom = timestamp;
76
78
  const mergeTo = query.profileType().delta ? mergeFrom + durationInMilliseconds : mergeFrom;
79
+ resetStateOnSeriesChange(); // reset some state when a new series is selected
77
80
  selectProfile(new MergedProfileSelection(mergeFrom, mergeTo, query));
78
81
  };
79
82
  const UtilizationGraphToShow = ({ utilizationMetrics, }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"useResetStateOnProfileTypeChange.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,gCAAgC,QAAO,CAAC,MAAM,IAAI,CA0B9D,CAAC"}
1
+ {"version":3,"file":"useResetStateOnProfileTypeChange.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,gCAAgC,QAAO,CAAC,MAAM,IAAI,CA8B9D,CAAC"}
@@ -17,6 +17,7 @@ export const useResetStateOnProfileTypeChange = () => {
17
17
  const [excludeFunction, setExcludeFunction] = useURLState('exclude_function');
18
18
  const [searchString, setSearchString] = useURLState('search_string');
19
19
  const [curPath, setCurPath] = useURLState('cur_path');
20
+ const [sandwichFunctionName, setSandwichFunctionName] = useURLState('sandwich_function_name');
20
21
  return () => {
21
22
  setTimeout(() => {
22
23
  if (groupBy !== undefined) {
@@ -34,6 +35,9 @@ export const useResetStateOnProfileTypeChange = () => {
34
35
  if (curPath !== undefined) {
35
36
  setCurPath(undefined);
36
37
  }
38
+ if (sandwichFunctionName !== undefined) {
39
+ setSandwichFunctionName(undefined);
40
+ }
37
41
  });
38
42
  };
39
43
  };
@@ -0,0 +1,2 @@
1
+ export declare const useResetStateOnSeriesChange: () => (() => void);
2
+ //# sourceMappingURL=useResetStateOnSeriesChange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResetStateOnSeriesChange.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetStateOnSeriesChange.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,2BAA2B,QAAO,CAAC,MAAM,IAAI,CAczD,CAAC"}
@@ -0,0 +1,27 @@
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
+ import { useURLState } from '@parca/components';
14
+ export const useResetStateOnSeriesChange = () => {
15
+ const [curPath, setCurPath] = useURLState('cur_path');
16
+ const [sandwichFunctionName, setSandwichFunctionName] = useURLState('sandwich_function_name');
17
+ return () => {
18
+ setTimeout(() => {
19
+ if (curPath !== undefined) {
20
+ setCurPath(undefined);
21
+ }
22
+ if (sandwichFunctionName !== undefined) {
23
+ setSandwichFunctionName(undefined);
24
+ }
25
+ });
26
+ };
27
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"TableSection.d.ts","sourceRoot":"","sources":["../../../src/Sandwich/components/TableSection.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,SAAS,EAAE,KAAK,GAAG,IAAI,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAIzE,OAAO,EAAC,KAAK,GAAG,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,OAAO,EAAa,MAAM,6BAA6B,CAAC;AAE5E,UAAU,iBAAiB;IACzB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,cAAc,EAAE,KAAK,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IACnD,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,kBAAkB,EAAE,CAAC,GAAG,EAAE,GAAG,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,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,OAAO,EACP,cAAc,EACd,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,EACN,oBAAoB,GACrB,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAqBjC"}
@@ -2,6 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Table as TableComponent } from '@parca/components';
3
3
  import { ROW_HEIGHT } from '../../Table/utils/functions';
4
4
  export function TableSection({ rows, columns, initialSorting, selectedRow, onRowClick, shouldHighlightRow, enableHighlighting, columnVisibility, height, sandwichFunctionName, }) {
5
- console.log(height);
6
5
  return (_jsx("div", { style: { height: height !== undefined ? `${height}px` : '80vh' }, className: `font-robotoMono w-full cursor-pointer ${selectedRow != null && sandwichFunctionName !== undefined ? 'w-[50%]' : ''}`, children: _jsx(TableComponent, { data: rows, columns: columns, initialSorting: initialSorting, usePointerCursor: true, onRowClick: onRowClick, shouldHighlightRow: shouldHighlightRow, enableHighlighting: enableHighlighting, estimatedRowHeight: ROW_HEIGHT, columnVisibility: columnVisibility }) }));
7
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.19.8",
3
+ "version": "0.19.9",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@floating-ui/react": "^0.27.12",
@@ -78,5 +78,5 @@
78
78
  "access": "public",
79
79
  "registry": "https://registry.npmjs.org/"
80
80
  },
81
- "gitHead": "1a6da3c30760730db55896eb9b665cf3d41229b5"
81
+ "gitHead": "eec2086ebad74fb0fde457d493bcab748e7b62b2"
82
82
  }
@@ -21,6 +21,7 @@ import {MergedProfileSelection, ProfileSelection} from '..';
21
21
  import UtilizationMetricsGraph from '../MetricsGraph/UtilizationMetrics';
22
22
  import AreaChart from '../MetricsGraph/UtilizationMetrics/Throughput';
23
23
  import ProfileMetricsGraph, {ProfileMetricsEmptyState} from '../ProfileMetricsGraph';
24
+ import {useResetStateOnSeriesChange} from '../ProfileView/hooks/useResetStateOnSeriesChange';
24
25
  import {QuerySelection, type UtilizationMetrics as UtilizationMetricsType} from './index';
25
26
 
26
27
  interface MetricsGraphSectionProps {
@@ -69,6 +70,7 @@ export function MetricsGraphSection({
69
70
  utilizationMetricsLoading,
70
71
  onUtilizationSeriesSelect,
71
72
  }: MetricsGraphSectionProps): JSX.Element {
73
+ const resetStateOnSeriesChange = useResetStateOnSeriesChange();
72
74
  const handleTimeRangeChange = (range: DateTimeRange): void => {
73
75
  const from = range.getFromMs();
74
76
  const to = range.getToMs();
@@ -137,6 +139,8 @@ export function MetricsGraphSection({
137
139
  const durationInMilliseconds = duration / 1000000; // duration is in nanoseconds
138
140
  const mergeFrom = timestamp;
139
141
  const mergeTo = query.profileType().delta ? mergeFrom + durationInMilliseconds : mergeFrom;
142
+
143
+ resetStateOnSeriesChange(); // reset some state when a new series is selected
140
144
  selectProfile(new MergedProfileSelection(mergeFrom, mergeTo, query));
141
145
  };
142
146
 
@@ -19,6 +19,7 @@ export const useResetStateOnProfileTypeChange = (): (() => void) => {
19
19
  const [excludeFunction, setExcludeFunction] = useURLState('exclude_function');
20
20
  const [searchString, setSearchString] = useURLState('search_string');
21
21
  const [curPath, setCurPath] = useURLState('cur_path');
22
+ const [sandwichFunctionName, setSandwichFunctionName] = useURLState('sandwich_function_name');
22
23
 
23
24
  return () => {
24
25
  setTimeout(() => {
@@ -37,6 +38,9 @@ export const useResetStateOnProfileTypeChange = (): (() => void) => {
37
38
  if (curPath !== undefined) {
38
39
  setCurPath(undefined);
39
40
  }
41
+ if (sandwichFunctionName !== undefined) {
42
+ setSandwichFunctionName(undefined);
43
+ }
40
44
  });
41
45
  };
42
46
  };
@@ -0,0 +1,30 @@
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
+
14
+ import {useURLState} from '@parca/components';
15
+
16
+ export const useResetStateOnSeriesChange = (): (() => void) => {
17
+ const [curPath, setCurPath] = useURLState('cur_path');
18
+ const [sandwichFunctionName, setSandwichFunctionName] = useURLState('sandwich_function_name');
19
+
20
+ return () => {
21
+ setTimeout(() => {
22
+ if (curPath !== undefined) {
23
+ setCurPath(undefined);
24
+ }
25
+ if (sandwichFunctionName !== undefined) {
26
+ setSandwichFunctionName(undefined);
27
+ }
28
+ });
29
+ };
30
+ };
@@ -43,7 +43,6 @@ export function TableSection({
43
43
  height,
44
44
  sandwichFunctionName,
45
45
  }: TableSectionProps): JSX.Element {
46
- console.log(height);
47
46
  return (
48
47
  <div
49
48
  style={{height: height !== undefined ? `${height}px` : '80vh'}}