@parca/profile 0.16.248 → 0.16.250

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.250](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.249...@parca/profile@0.16.250) (2023-09-07)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.249](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.248...@parca/profile@0.16.249) (2023-09-06)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.248](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.247...@parca/profile@0.16.248) (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 };
@@ -17,6 +17,13 @@ import { tableFromIPC } from 'apache-arrow';
17
17
  import { Button, Table as TableComponent, useURLState } from '@parca/components';
18
18
  import { getLastItem, isSearchMatch, parseParams, valueFormatter, } from '@parca/utilities';
19
19
  import { hexifyAddress } from '../utils';
20
+ const FIELD_MAPPING_FILE = 'mapping_file';
21
+ const FIELD_LOCATION_ADDRESS = 'location_address';
22
+ const FIELD_FUNCTION_NAME = 'function_name';
23
+ const FIELD_FLAT = 'flat';
24
+ const FIELD_FLAT_DIFF = 'flat_diff';
25
+ const FIELD_CUMULATIVE = 'cumulative';
26
+ const FIELD_CUMULATIVE_DIFF = 'cumulative_diff';
20
27
  const columnHelper = createColumnHelper();
21
28
  export const Table = React.memo(function Table({ data, sampleUnit: unit, navigateTo, loading, currentSearchString, setActionButtons, }) {
22
29
  const router = parseParams(window?.location.search);
@@ -134,10 +141,10 @@ export const Table = React.memo(function Table({ data, sampleUnit: unit, navigat
134
141
  if (data === undefined)
135
142
  return _jsx("div", { className: "mx-auto text-center", children: "Profile has no samples" });
136
143
  const table = tableFromIPC(data);
137
- const flatColumn = table.getChild('flat');
138
- const flatDiffColumn = table.getChild('flat_diff');
139
- const cumulativeColumn = table.getChild('cumulative');
140
- const cumulativeDiffColumn = table.getChild('cumulative_diff');
144
+ const flatColumn = table.getChild(FIELD_FLAT);
145
+ const flatDiffColumn = table.getChild(FIELD_FLAT_DIFF);
146
+ const cumulativeColumn = table.getChild(FIELD_CUMULATIVE);
147
+ const cumulativeDiffColumn = table.getChild(FIELD_CUMULATIVE_DIFF);
141
148
  if (table.numRows === 0)
142
149
  return _jsx("div", { className: "mx-auto text-center", children: "Profile has no samples" });
143
150
  const rows = [];
@@ -164,7 +171,7 @@ const addPlusSign = (num) => {
164
171
  return `+${num}`;
165
172
  };
166
173
  export const RowName = (table, row) => {
167
- const mappingFileColumn = table.getChild('mapping_file');
174
+ const mappingFileColumn = table.getChild(FIELD_MAPPING_FILE);
168
175
  if (mappingFileColumn === null) {
169
176
  console.error('mapping_file column not found');
170
177
  return '';
@@ -175,11 +182,11 @@ export const RowName = (table, row) => {
175
182
  if (mappingFile != null && mappingFileColumn.data.length > 1) {
176
183
  mapping = `[${getLastItem(mappingFile) ?? ''}]`;
177
184
  }
178
- const functionName = table.getChild('function_name')?.get(row) ?? '';
185
+ const functionName = table.getChild(FIELD_FUNCTION_NAME)?.get(row) ?? '';
179
186
  if (functionName !== null && functionName !== '') {
180
187
  return `${mapping} ${functionName}`;
181
188
  }
182
- const address = table.getChild('location_address')?.get(row) ?? 0;
189
+ const address = table.getChild(FIELD_LOCATION_ADDRESS)?.get(row) ?? 0;
183
190
  return hexifyAddress(address);
184
191
  };
185
192
  export default Table;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.248",
3
+ "version": "0.16.250",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.86",
@@ -49,5 +49,5 @@
49
49
  "access": "public",
50
50
  "registry": "https://registry.npmjs.org/"
51
51
  },
52
- "gitHead": "4e814a1223712dee92ea404b87363eac778fa499"
52
+ "gitHead": "b13f14408040abd2230c059e8944fcbea6391704"
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 === '') {
@@ -27,6 +27,14 @@ import {
27
27
 
28
28
  import {hexifyAddress} from '../utils';
29
29
 
30
+ const FIELD_MAPPING_FILE = 'mapping_file';
31
+ const FIELD_LOCATION_ADDRESS = 'location_address';
32
+ const FIELD_FUNCTION_NAME = 'function_name';
33
+ const FIELD_FLAT = 'flat';
34
+ const FIELD_FLAT_DIFF = 'flat_diff';
35
+ const FIELD_CUMULATIVE = 'cumulative';
36
+ const FIELD_CUMULATIVE_DIFF = 'cumulative_diff';
37
+
30
38
  const columnHelper = createColumnHelper<row>();
31
39
 
32
40
  interface row {
@@ -211,10 +219,10 @@ export const Table = React.memo(function Table({
211
219
  if (data === undefined) return <div className="mx-auto text-center">Profile has no samples</div>;
212
220
 
213
221
  const table = tableFromIPC(data);
214
- const flatColumn = table.getChild('flat');
215
- const flatDiffColumn = table.getChild('flat_diff');
216
- const cumulativeColumn = table.getChild('cumulative');
217
- const cumulativeDiffColumn = table.getChild('cumulative_diff');
222
+ const flatColumn = table.getChild(FIELD_FLAT);
223
+ const flatDiffColumn = table.getChild(FIELD_FLAT_DIFF);
224
+ const cumulativeColumn = table.getChild(FIELD_CUMULATIVE);
225
+ const cumulativeDiffColumn = table.getChild(FIELD_CUMULATIVE_DIFF);
218
226
 
219
227
  if (table.numRows === 0) return <div className="mx-auto text-center">Profile has no samples</div>;
220
228
 
@@ -261,7 +269,7 @@ const addPlusSign = (num: string): string => {
261
269
  };
262
270
 
263
271
  export const RowName = (table: ArrowTable, row: number): string => {
264
- const mappingFileColumn = table.getChild('mapping_file');
272
+ const mappingFileColumn = table.getChild(FIELD_MAPPING_FILE);
265
273
  if (mappingFileColumn === null) {
266
274
  console.error('mapping_file column not found');
267
275
  return '';
@@ -273,12 +281,12 @@ export const RowName = (table: ArrowTable, row: number): string => {
273
281
  if (mappingFile != null && mappingFileColumn.data.length > 1) {
274
282
  mapping = `[${getLastItem(mappingFile) ?? ''}]`;
275
283
  }
276
- const functionName: string | null = table.getChild('function_name')?.get(row) ?? '';
284
+ const functionName: string | null = table.getChild(FIELD_FUNCTION_NAME)?.get(row) ?? '';
277
285
  if (functionName !== null && functionName !== '') {
278
286
  return `${mapping} ${functionName}`;
279
287
  }
280
288
 
281
- const address: bigint = table.getChild('location_address')?.get(row) ?? 0;
289
+ const address: bigint = table.getChild(FIELD_LOCATION_ADDRESS)?.get(row) ?? 0;
282
290
 
283
291
  return hexifyAddress(address);
284
292
  };