@parca/profile 0.16.249 → 0.16.251
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.251](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.250...@parca/profile@0.16.251) (2023-09-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.16.250](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.249...@parca/profile@0.16.250) (2023-09-07)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.16.249](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.248...@parca/profile@0.16.249) (2023-09-06)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -101,11 +101,13 @@ const groupByOptions = [
|
|
|
101
101
|
value: FIELD_FUNCTION_NAME,
|
|
102
102
|
label: 'Function Name',
|
|
103
103
|
description: 'Stacktraces are grouped by function names.',
|
|
104
|
+
disabled: true,
|
|
104
105
|
},
|
|
105
106
|
{
|
|
106
107
|
value: FIELD_LABELS,
|
|
107
108
|
label: 'Labels',
|
|
108
109
|
description: 'Stacktraces are grouped by pprof labels.',
|
|
110
|
+
disabled: false,
|
|
109
111
|
},
|
|
110
112
|
];
|
|
111
113
|
const GroupByDropdown = ({ groupBy, toggleGroupBy, }) => {
|
|
@@ -114,9 +116,7 @@ const GroupByDropdown = ({ groupBy, toggleGroupBy, }) => {
|
|
|
114
116
|
: groupBy.length === 1
|
|
115
117
|
? groupByOptions.find(option => option.value === groupBy[0])?.label
|
|
116
118
|
: 'Multiple';
|
|
117
|
-
return (_jsxs("div", { children: [_jsx("label", { className: "text-sm", children: "Group" }), _jsxs(Menu, { as: "div", className: "relative text-left", children: [_jsx("div", { children: _jsxs(Menu.Button, { className: "relative w-full cursor-default rounded-md border bg-
|
|
118
|
-
toggleGroupBy(value);
|
|
119
|
-
} }) }), _jsxs("div", { className: "ml-3 text-sm leading-6", children: [_jsx("label", { htmlFor: value, className: "font-medium text-gray-900", children: label }), _jsx("p", { className: "text-gray-500", children: description })] })] }, value))) }) }) }) }) })] })] }));
|
|
119
|
+
return (_jsxs("div", { children: [_jsx("label", { className: "text-sm", children: "Group" }), _jsxs(Menu, { as: "div", className: "relative text-left", children: [_jsx("div", { children: _jsxs(Menu.Button, { className: "relative w-full cursor-default rounded-md border bg-white py-2 pl-3 pr-10 text-left text-sm shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-900 sm:text-sm", children: [_jsx("span", { className: "ml-3 block overflow-x-hidden text-ellipsis", children: label }), _jsx("span", { className: "pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2 text-gray-400", children: _jsx(Icon, { icon: "heroicons:chevron-down-20-solid", "aria-hidden": "true" }) })] }) }), _jsx(Transition, { as: Fragment, leave: "transition ease-in duration-100", leaveFrom: "opacity-100", leaveTo: "opacity-0", children: _jsx(Menu.Items, { className: "absolute left-0 z-10 mt-1 min-w-[400px] overflow-auto rounded-md bg-gray-50 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:border-gray-600 dark:bg-gray-900 dark:ring-white dark:ring-opacity-20 sm:text-sm", children: _jsx("div", { className: "p-4", children: _jsx("fieldset", { children: _jsx("div", { className: "space-y-5", children: groupByOptions.map(({ value, label, description, disabled }) => (_jsxs("div", { className: "relative flex items-start", children: [_jsx("div", { className: "flex h-6 items-center", children: _jsx("input", { id: value, name: value, type: "checkbox", disabled: disabled, className: "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", checked: groupBy.includes(value), onChange: () => toggleGroupBy(value) }) }), _jsxs("div", { className: "ml-3 text-sm leading-6", children: [_jsx("label", { htmlFor: value, className: "font-medium text-gray-900", children: label }), _jsx("p", { className: "text-gray-500", children: description })] })] }, value))) }) }) }) }) })] })] }));
|
|
120
120
|
};
|
|
121
121
|
const SortBySelect = ({ sortBy, setSortBy, compareMode, }) => {
|
|
122
122
|
return (_jsxs("div", { children: [_jsx("label", { className: "text-sm", children: "Sort" }), _jsx(Select, { items: [
|
package/dist/Table/index.js
CHANGED
|
@@ -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(
|
|
138
|
-
const flatDiffColumn = table.getChild(
|
|
139
|
-
const cumulativeColumn = table.getChild(
|
|
140
|
-
const cumulativeDiffColumn = table.getChild(
|
|
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(
|
|
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(
|
|
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(
|
|
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.
|
|
3
|
+
"version": "0.16.251",
|
|
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": "
|
|
52
|
+
"gitHead": "3b18ce674f11d5d194c7c3f1940f1dffdfde6fa3"
|
|
53
53
|
}
|
|
@@ -244,11 +244,13 @@ const groupByOptions = [
|
|
|
244
244
|
value: FIELD_FUNCTION_NAME,
|
|
245
245
|
label: 'Function Name',
|
|
246
246
|
description: 'Stacktraces are grouped by function names.',
|
|
247
|
+
disabled: true,
|
|
247
248
|
},
|
|
248
249
|
{
|
|
249
250
|
value: FIELD_LABELS,
|
|
250
251
|
label: 'Labels',
|
|
251
252
|
description: 'Stacktraces are grouped by pprof labels.',
|
|
253
|
+
disabled: false,
|
|
252
254
|
},
|
|
253
255
|
];
|
|
254
256
|
|
|
@@ -271,7 +273,7 @@ const GroupByDropdown = ({
|
|
|
271
273
|
<label className="text-sm">Group</label>
|
|
272
274
|
<Menu as="div" className="relative text-left">
|
|
273
275
|
<div>
|
|
274
|
-
<Menu.Button className="relative w-full cursor-default rounded-md border bg-
|
|
276
|
+
<Menu.Button className="relative w-full cursor-default rounded-md border bg-white py-2 pl-3 pr-10 text-left text-sm shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-900 sm:text-sm">
|
|
275
277
|
<span className="ml-3 block overflow-x-hidden text-ellipsis">{label}</span>
|
|
276
278
|
<span className="pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2 text-gray-400">
|
|
277
279
|
<Icon icon="heroicons:chevron-down-20-solid" aria-hidden="true" />
|
|
@@ -289,18 +291,17 @@ const GroupByDropdown = ({
|
|
|
289
291
|
<div className="p-4">
|
|
290
292
|
<fieldset>
|
|
291
293
|
<div className="space-y-5">
|
|
292
|
-
{groupByOptions.map(({value, label, description}) => (
|
|
294
|
+
{groupByOptions.map(({value, label, description, disabled}) => (
|
|
293
295
|
<div key={value} className="relative flex items-start">
|
|
294
296
|
<div className="flex h-6 items-center">
|
|
295
297
|
<input
|
|
296
298
|
id={value}
|
|
297
299
|
name={value}
|
|
298
300
|
type="checkbox"
|
|
301
|
+
disabled={disabled}
|
|
299
302
|
className="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600"
|
|
300
303
|
checked={groupBy.includes(value)}
|
|
301
|
-
onChange={() =>
|
|
302
|
-
toggleGroupBy(value);
|
|
303
|
-
}}
|
|
304
|
+
onChange={() => toggleGroupBy(value)}
|
|
304
305
|
/>
|
|
305
306
|
</div>
|
|
306
307
|
<div className="ml-3 text-sm leading-6">
|
package/src/Table/index.tsx
CHANGED
|
@@ -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(
|
|
215
|
-
const flatDiffColumn = table.getChild(
|
|
216
|
-
const cumulativeColumn = table.getChild(
|
|
217
|
-
const cumulativeDiffColumn = table.getChild(
|
|
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(
|
|
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(
|
|
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(
|
|
289
|
+
const address: bigint = table.getChild(FIELD_LOCATION_ADDRESS)?.get(row) ?? 0;
|
|
282
290
|
|
|
283
291
|
return hexifyAddress(address);
|
|
284
292
|
};
|