@parca/profile 0.16.247 → 0.16.249

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.16.249](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.248...@parca/profile@0.16.249) (2023-09-06)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.248](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.247...@parca/profile@0.16.248) (2023-09-05)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## 0.16.247 (2023-09-05)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -34,8 +34,8 @@ const GraphTooltipArrowContent = ({ table, unit, total, totalUnfiltered, row, le
34
34
  return _jsx(_Fragment, {});
35
35
  }
36
36
  const locationAddress = table.getChild(FIELD_LOCATION_ADDRESS)?.get(row) ?? 0n;
37
- const cumulative = table.getChild(FIELD_CUMULATIVE)?.get(row) ?? 0n;
38
- const diff = table.getChild(FIELD_DIFF)?.get(row) ?? 0n;
37
+ const cumulative = BigInt(table.getChild(FIELD_CUMULATIVE)?.get(row)) ?? 0n;
38
+ const diff = BigInt(table.getChild(FIELD_DIFF)?.get(row)) ?? 0n;
39
39
  const onCopy = () => {
40
40
  setIsCopied(true);
41
41
  if (timeoutHandle !== null) {
@@ -32,8 +32,8 @@ export const IcicleGraphNodes = React.memo(function IcicleGraphNodesNoMemo({ tab
32
32
  let childrenCumulative = BigInt(0);
33
33
  const childrenElements = [];
34
34
  childRows.forEach((child, i) => {
35
- const xStart = Math.floor(xScale(childrenCumulative));
36
- const c = cumulatives?.get(child);
35
+ const xStart = Math.floor(xScale(BigInt(childrenCumulative)));
36
+ const c = BigInt(cumulatives?.get(child));
37
37
  childrenCumulative += c;
38
38
  childrenElements.push(_jsx(IcicleNode, { table: table, row: child, mappingColors: mappingColors, x: xStart, y: 0, totalWidth: totalWidth, height: RowHeight, path: path, setCurPath: setCurPath, setHoveringRow: setHoveringRow, setHoveringLevel: setHoveringLevel, level: level, curPath: curPath, total: total, xScale: xScale, sortBy: sortBy, searchString: searchString, darkMode: darkMode, compareMode: compareMode }, `node-${level}-${i}`));
39
39
  });
@@ -58,8 +58,8 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({ table, row, map
58
58
  // get the actual values from the columns
59
59
  const mappingFile = arrowToString(mappingColumn?.get(row));
60
60
  const functionName = arrowToString(functionNameColumn?.get(row));
61
- const cumulative = cumulativeColumn?.get(row);
62
- const diff = diffColumn?.get(row);
61
+ const cumulative = BigInt(cumulativeColumn?.get(row));
62
+ const diff = BigInt(diffColumn?.get(row));
63
63
  const childRows = Array.from(table.getChild(FIELD_CHILDREN)?.get(row) ?? []);
64
64
  // TODO: Maybe it's better to pass down the sorter function as prop instead of figuring this out here.
65
65
  switch (sortBy) {
@@ -125,11 +125,11 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({ table, row, map
125
125
  const nextLevel = level + 1;
126
126
  const nextCurPath = curPath.length === 0 ? [] : curPath.slice(1);
127
127
  const newXScale = nextCurPath.length === 0 && curPath.length === 1
128
- ? scaleLinear([0n, cumulative], [0, totalWidth])
128
+ ? scaleLinear([0n, BigInt(cumulative)], [0, totalWidth])
129
129
  : xScale;
130
130
  const width = nextCurPath.length > 0 || (nextCurPath.length === 0 && curPath.length === 1)
131
131
  ? totalWidth
132
- : xScale(cumulative);
132
+ : xScale(BigInt(cumulative));
133
133
  const { isHighlightEnabled = false, isHighlighted = false } = useMemo(() => {
134
134
  if (searchString === undefined || searchString === '') {
135
135
  return { isHighlightEnabled: false };
@@ -14,7 +14,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { useEffect, useMemo, useState } from 'react';
15
15
  import { QueryRequest_ReportType } from '@parca/client';
16
16
  import { useGrpcMetadata, useParcaContext, useURLState } from '@parca/components';
17
- import { USER_PREFERENCES, useUIFeatureFlag, useUserPreference } from '@parca/hooks';
18
17
  import { saveAsBlob } from '@parca/utilities';
19
18
  import { FIELD_FUNCTION_NAME } from './ProfileIcicleGraph/IcicleGraphArrow';
20
19
  import { ProfileView } from './ProfileView';
@@ -26,26 +25,18 @@ export const ProfileViewWithData = ({ queryClient, profileSource, navigateTo, })
26
25
  const [sourceBuildID] = useURLState({ param: 'source_buildid', navigateTo });
27
26
  const [sourceFilename] = useURLState({ param: 'source_filename', navigateTo });
28
27
  const [groupBy = [FIELD_FUNCTION_NAME]] = useURLState({ param: 'group_by', navigateTo });
29
- const [enableTrimming] = useUserPreference(USER_PREFERENCES.ENABLE_GRAPH_TRIMMING.key);
30
- const [arrowFlamegraphEnabled] = useUIFeatureFlag('flamegraph-arrow');
31
28
  const [pprofDownloading, setPprofDownloading] = useState(false);
32
29
  const nodeTrimThreshold = useMemo(() => {
33
- if (!enableTrimming) {
34
- return 0;
35
- }
36
30
  let width =
37
31
  // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
38
32
  window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
39
33
  // subtract the padding
40
34
  width = width - 12 - 16 - 12;
41
35
  return (1 / width) * 100;
42
- }, [enableTrimming]);
43
- const reportType = arrowFlamegraphEnabled
44
- ? QueryRequest_ReportType.FLAMEGRAPH_ARROW
45
- : QueryRequest_ReportType.FLAMEGRAPH_TABLE;
36
+ }, []);
46
37
  // make sure we get a string[]
47
38
  const groupByParam = typeof groupBy === 'string' ? [groupBy] : groupBy;
48
- const { isLoading: flamegraphLoading, response: flamegraphResponse, error: flamegraphError, } = useQuery(queryClient, profileSource, reportType, {
39
+ const { isLoading: flamegraphLoading, response: flamegraphResponse, error: flamegraphError, } = useQuery(queryClient, profileSource, QueryRequest_ReportType.FLAMEGRAPH_ARROW, {
49
40
  skip: !dashboardItems.includes('icicle'),
50
41
  nodeTrimThreshold,
51
42
  groupBy: groupByParam,
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.247",
3
+ "version": "0.16.249",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.86",
7
- "@parca/components": "^0.16.188",
7
+ "@parca/components": "^0.16.189",
8
8
  "@parca/dynamicsize": "^0.16.54",
9
9
  "@parca/hooks": "^0.0.21",
10
10
  "@parca/parser": "^0.16.55",
@@ -49,5 +49,5 @@
49
49
  "access": "public",
50
50
  "registry": "https://registry.npmjs.org/"
51
51
  },
52
- "gitHead": "2f5852cd7556864b911a69c2d5341cc4f0bb02be"
52
+ "gitHead": "05cf63fe3be4153289f20f8c92b1a82add88339c"
53
53
  }
@@ -74,8 +74,8 @@ const GraphTooltipArrowContent = ({
74
74
  }
75
75
 
76
76
  const locationAddress: bigint = table.getChild(FIELD_LOCATION_ADDRESS)?.get(row) ?? 0n;
77
- const cumulative: bigint = table.getChild(FIELD_CUMULATIVE)?.get(row) ?? 0n;
78
- const diff: bigint = table.getChild(FIELD_DIFF)?.get(row) ?? 0n;
77
+ const cumulative: bigint = BigInt(table.getChild(FIELD_CUMULATIVE)?.get(row)) ?? 0n;
78
+ const diff: bigint = BigInt(table.getChild(FIELD_DIFF)?.get(row)) ?? 0n;
79
79
 
80
80
  const onCopy = (): void => {
81
81
  setIsCopied(true);
@@ -88,8 +88,8 @@ export const IcicleGraphNodes = React.memo(function IcicleGraphNodesNoMemo({
88
88
  let childrenCumulative = BigInt(0);
89
89
  const childrenElements: ReactNode[] = [];
90
90
  childRows.forEach((child, i) => {
91
- const xStart = Math.floor(xScale(childrenCumulative));
92
- const c: bigint = cumulatives?.get(child);
91
+ const xStart = Math.floor(xScale(BigInt(childrenCumulative)));
92
+ const c = BigInt(cumulatives?.get(child));
93
93
  childrenCumulative += c;
94
94
 
95
95
  childrenElements.push(
@@ -190,8 +190,8 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
190
190
  // get the actual values from the columns
191
191
  const mappingFile: string | null = arrowToString(mappingColumn?.get(row));
192
192
  const functionName: string | null = arrowToString(functionNameColumn?.get(row));
193
- const cumulative: bigint = cumulativeColumn?.get(row);
194
- const diff: bigint | null = diffColumn?.get(row);
193
+ const cumulative = BigInt(cumulativeColumn?.get(row));
194
+ const diff: bigint | null = BigInt(diffColumn?.get(row));
195
195
  const childRows: number[] = Array.from(table.getChild(FIELD_CHILDREN)?.get(row) ?? []);
196
196
 
197
197
  // TODO: Maybe it's better to pass down the sorter function as prop instead of figuring this out here.
@@ -260,13 +260,13 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
260
260
  const nextCurPath = curPath.length === 0 ? [] : curPath.slice(1);
261
261
  const newXScale =
262
262
  nextCurPath.length === 0 && curPath.length === 1
263
- ? scaleLinear([0n, cumulative], [0, totalWidth])
263
+ ? scaleLinear([0n, BigInt(cumulative)], [0, totalWidth])
264
264
  : xScale;
265
265
 
266
266
  const width: number =
267
267
  nextCurPath.length > 0 || (nextCurPath.length === 0 && curPath.length === 1)
268
268
  ? totalWidth
269
- : xScale(cumulative);
269
+ : xScale(BigInt(cumulative));
270
270
 
271
271
  const {isHighlightEnabled = false, isHighlighted = false} = useMemo(() => {
272
272
  if (searchString === undefined || searchString === '') {
@@ -15,7 +15,6 @@ import {useEffect, useMemo, useState} from 'react';
15
15
 
16
16
  import {QueryRequest_ReportType, QueryServiceClient} from '@parca/client';
17
17
  import {useGrpcMetadata, useParcaContext, useURLState} from '@parca/components';
18
- import {USER_PREFERENCES, useUIFeatureFlag, useUserPreference} from '@parca/hooks';
19
18
  import {saveAsBlob, type NavigateFunction} from '@parca/utilities';
20
19
 
21
20
  import {FIELD_FUNCTION_NAME} from './ProfileIcicleGraph/IcicleGraphArrow';
@@ -44,26 +43,16 @@ export const ProfileViewWithData = ({
44
43
  ];
45
44
  const [groupBy = [FIELD_FUNCTION_NAME]] = useURLState({param: 'group_by', navigateTo});
46
45
 
47
- const [enableTrimming] = useUserPreference<boolean>(USER_PREFERENCES.ENABLE_GRAPH_TRIMMING.key);
48
- const [arrowFlamegraphEnabled] = useUIFeatureFlag('flamegraph-arrow');
49
46
  const [pprofDownloading, setPprofDownloading] = useState<boolean>(false);
50
47
 
51
48
  const nodeTrimThreshold = useMemo(() => {
52
- if (!enableTrimming) {
53
- return 0;
54
- }
55
-
56
49
  let width =
57
50
  // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
58
51
  window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
59
52
  // subtract the padding
60
53
  width = width - 12 - 16 - 12;
61
54
  return (1 / width) * 100;
62
- }, [enableTrimming]);
63
-
64
- const reportType = arrowFlamegraphEnabled
65
- ? QueryRequest_ReportType.FLAMEGRAPH_ARROW
66
- : QueryRequest_ReportType.FLAMEGRAPH_TABLE;
55
+ }, []);
67
56
 
68
57
  // make sure we get a string[]
69
58
  const groupByParam: string[] = typeof groupBy === 'string' ? [groupBy] : groupBy;
@@ -72,7 +61,7 @@ export const ProfileViewWithData = ({
72
61
  isLoading: flamegraphLoading,
73
62
  response: flamegraphResponse,
74
63
  error: flamegraphError,
75
- } = useQuery(queryClient, profileSource, reportType, {
64
+ } = useQuery(queryClient, profileSource, QueryRequest_ReportType.FLAMEGRAPH_ARROW, {
76
65
  skip: !dashboardItems.includes('icicle'),
77
66
  nodeTrimThreshold,
78
67
  groupBy: groupByParam,