@parca/profile 0.16.249 → 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,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.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
+
6
10
  ## [0.16.249](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.248...@parca/profile@0.16.249) (2023-09-06)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -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.249",
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": "05cf63fe3be4153289f20f8c92b1a82add88339c"
52
+ "gitHead": "b13f14408040abd2230c059e8944fcbea6391704"
53
53
  }
@@ -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
  };