@parca/profile 0.16.378 → 0.16.380
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 +8 -0
- package/dist/GraphTooltipArrow/Content.js +3 -3
- package/dist/GraphTooltipArrow/useGraphTooltip/index.d.ts +2 -0
- package/dist/GraphTooltipArrow/useGraphTooltip/index.js +9 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts +2 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.js +2 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/utils.js +1 -1
- package/dist/ProfileSource.d.ts +3 -0
- package/dist/ProfileSource.js +6 -3
- package/dist/Table/ColumnsVisibility.d.ts +3 -3
- package/dist/Table/index.d.ts +22 -11
- package/dist/Table/index.js +276 -77
- package/dist/Table/utils/topAndBottomExpandedRowModel.d.ts +3 -0
- package/dist/Table/utils/topAndBottomExpandedRowModel.js +62 -0
- package/dist/styles.css +1 -1
- package/package.json +11 -11
- package/src/GraphTooltipArrow/Content.tsx +26 -9
- package/src/GraphTooltipArrow/useGraphTooltip/index.ts +17 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/index.tsx +2 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/utils.ts +1 -1
- package/src/ProfileSource.tsx +14 -3
- package/src/Table/ColumnsVisibility.tsx +4 -4
- package/src/Table/index.tsx +432 -94
- package/src/Table/utils/topAndBottomExpandedRowModel.tsx +89 -0
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.380](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.379...@parca/profile@0.16.380) (2024-06-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## 0.16.379 (2024-06-03)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.16.378](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.377...@parca/profile@0.16.378) (2024-05-31)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -20,18 +20,18 @@ const GraphTooltipArrowContent = ({ table, profileType, total, totalUnfiltered,
|
|
|
20
20
|
if (graphTooltipData === null) {
|
|
21
21
|
return _jsx(_Fragment, {});
|
|
22
22
|
}
|
|
23
|
-
const { name, locationAddress, cumulativeText, cumulativePerSecondText, diffText, diff, row: rowNumber, } = graphTooltipData;
|
|
23
|
+
const { name, locationAddress, cumulativeText, cumulativePerSecondText, flatText, flatPerSecondText, diffText, diff, row: rowNumber, } = graphTooltipData;
|
|
24
24
|
return (_jsx("div", { className: `flex text-sm ${isFixed ? 'w-full' : ''}`, children: _jsx("div", { className: `m-auto w-full ${isFixed ? 'w-full' : ''}`, children: _jsxs("div", { className: "min-h-52 flex w-[500px] flex-col justify-between rounded-lg border border-gray-300 bg-gray-50 p-3 shadow-lg dark:border-gray-500 dark:bg-gray-900", children: [_jsx("div", { className: "flex flex-row", children: _jsxs("div", { className: "mx-2", children: [_jsx("div", { className: "flex h-10 items-start justify-between gap-4 break-all font-semibold", children: row === 0 ? (_jsx("p", { children: "root" })) : (_jsx("p", { children: name !== ''
|
|
25
25
|
? name
|
|
26
26
|
: locationAddress !== 0n
|
|
27
27
|
? hexifyAddress(locationAddress)
|
|
28
|
-
: 'unknown' })) }), _jsx("table", { className: "my-2 w-full table-fixed pr-0 text-gray-700 dark:text-gray-300", children: _jsxs("tbody", { children: [(profileType?.delta ?? false) ? (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4"
|
|
28
|
+
: 'unknown' })) }), _jsx("table", { className: "my-2 w-full table-fixed pr-0 text-gray-700 dark:text-gray-300", children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Cumulative" }), _jsx("td", { className: "w-3/4", children: _jsx("div", { children: cumulativeText }) })] }), (profileType?.delta ?? false) ? (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4" }), _jsx("td", { className: "w-3/4", children: _jsx("div", { children: cumulativePerSecondText }) })] })) : (_jsx(_Fragment, {})), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Flat" }), _jsx("td", { className: "w-3/4 pt-2", children: _jsx("div", { children: flatText }) })] }), (profileType?.delta ?? false) ? (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4" }), _jsx("td", { className: "w-3/4", children: _jsx("div", { children: flatPerSecondText }) })] })) : (_jsx(_Fragment, {})), diff !== 0n && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Diff" }), _jsx("td", { className: "w-3/4 pt-2", children: _jsx("div", { children: diffText }) })] })), _jsx(TooltipMetaInfo, { table: table, row: rowNumber, navigateTo: navigateTo })] }) })] }) }), _jsxs("div", { className: "flex w-full items-center gap-1 text-xs text-gray-500", children: [_jsx(Icon, { icon: "iconoir:mouse-button-right" }), _jsx("div", { children: "Right click to show context menu" })] })] }) }) }));
|
|
29
29
|
};
|
|
30
30
|
const TooltipMetaInfo = ({ table, row, navigateTo, }) => {
|
|
31
31
|
const { labelPairs, functionFilename, file, locationAddress, mappingFile, mappingBuildID, inlined, } = useGraphTooltipMetaInfo({ table, row, navigateTo });
|
|
32
32
|
const labels = labelPairs.map((l) => (_jsx("span", { className: "mr-3 inline-block rounded-lg bg-gray-200 px-2 py-1 text-xs font-bold text-gray-700 dark:bg-gray-700 dark:text-gray-400", children: `${l[0]}="${l[1]}"` }, l[0])));
|
|
33
33
|
const isMappingBuildIDAvailable = mappingBuildID !== null && mappingBuildID !== '';
|
|
34
34
|
const inlinedText = inlined === null ? 'merged' : inlined ? 'yes' : 'no';
|
|
35
|
-
return (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "File" }), _jsx("td", { className: "w-3/4 break-all", children: functionFilename === '' ? (_jsx(NoData, {})) : (_jsx("div", { className: "flex gap-4", children: _jsx("div", { className: "whitespace-nowrap text-left", children: _jsx(ExpandOnHover, { value: file, displayValue: truncateStringReverse(file, 30) }) }) })) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Address" }), _jsx("td", { className: "w-3/4 break-all", children: locationAddress === 0n ? _jsx(NoData, {}) : _jsx("div", { children: hexifyAddress(locationAddress) }) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Inlined" }), _jsx("td", { className: "w-3/4 break-all", children: inlinedText })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Binary" }), _jsx("td", { className: "w-3/4 break-all", children: (mappingFile != null ? getLastItem(mappingFile) : null) ?? _jsx(NoData, {}) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Build Id" }), _jsx("td", { className: "w-3/4 break-all", children: isMappingBuildIDAvailable ? _jsx("div", { children: truncateString(mappingBuildID, 28) }) : _jsx(NoData, {}) })] }), labelPairs.length > 0 && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Labels" }), _jsx("td", { className: "w-3/4 break-all", children: labels })] }))] }));
|
|
35
|
+
return (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "File" }), _jsx("td", { className: "w-3/4 pt-2 break-all", children: functionFilename === '' ? (_jsx(NoData, {})) : (_jsx("div", { className: "flex gap-4", children: _jsx("div", { className: "whitespace-nowrap text-left", children: _jsx(ExpandOnHover, { value: file, displayValue: truncateStringReverse(file, 30) }) }) })) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Address" }), _jsx("td", { className: "w-3/4 break-all", children: locationAddress === 0n ? _jsx(NoData, {}) : _jsx("div", { children: hexifyAddress(locationAddress) }) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Inlined" }), _jsx("td", { className: "w-3/4 break-all", children: inlinedText })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Binary" }), _jsx("td", { className: "w-3/4 break-all", children: (mappingFile != null ? getLastItem(mappingFile) : null) ?? _jsx(NoData, {}) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Build Id" }), _jsx("td", { className: "w-3/4 break-all", children: isMappingBuildIDAvailable ? _jsx("div", { children: truncateString(mappingBuildID, 28) }) : _jsx(NoData, {}) })] }), labelPairs.length > 0 && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Labels" }), _jsx("td", { className: "w-3/4 break-all", children: labels })] }))] }));
|
|
36
36
|
};
|
|
37
37
|
export default GraphTooltipArrowContent;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { divide, valueFormatter } from '@parca/utilities';
|
|
14
|
-
import { FIELD_CUMULATIVE, FIELD_CUMULATIVE_PER_SECOND, FIELD_DIFF, FIELD_DIFF_PER_SECOND, FIELD_LOCATION_ADDRESS, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
14
|
+
import { FIELD_CUMULATIVE, FIELD_CUMULATIVE_PER_SECOND, FIELD_DIFF, FIELD_DIFF_PER_SECOND, FIELD_FLAT, FIELD_FLAT_PER_SECOND, FIELD_LOCATION_ADDRESS, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
15
15
|
import { getTextForCumulative, getTextForCumulativePerSecond, nodeLabel, } from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
|
|
16
16
|
export const useGraphTooltip = ({ table, profileType, total, totalUnfiltered, row, level, }) => {
|
|
17
17
|
if (row === null || profileType === undefined) {
|
|
@@ -24,6 +24,12 @@ export const useGraphTooltip = ({ table, profileType, total, totalUnfiltered, ro
|
|
|
24
24
|
const cumulativePerSecond = table.getChild(FIELD_CUMULATIVE_PER_SECOND)?.get(row) !== null
|
|
25
25
|
? table.getChild(FIELD_CUMULATIVE_PER_SECOND)?.get(row)
|
|
26
26
|
: 0;
|
|
27
|
+
const flat = table.getChild(FIELD_FLAT)?.get(row) !== null
|
|
28
|
+
? BigInt(table.getChild(FIELD_FLAT)?.get(row))
|
|
29
|
+
: 0n;
|
|
30
|
+
const flatPerSecond = table.getChild(FIELD_FLAT_PER_SECOND)?.get(row) !== null
|
|
31
|
+
? table.getChild(FIELD_FLAT_PER_SECOND)?.get(row)
|
|
32
|
+
: 0;
|
|
27
33
|
const diff = table.getChild(FIELD_DIFF)?.get(row) !== null
|
|
28
34
|
? BigInt(table.getChild(FIELD_DIFF)?.get(row))
|
|
29
35
|
: 0n;
|
|
@@ -53,6 +59,8 @@ export const useGraphTooltip = ({ table, profileType, total, totalUnfiltered, ro
|
|
|
53
59
|
locationAddress,
|
|
54
60
|
cumulativeText: getTextForCumulative(cumulative, totalUnfiltered, total, profileType?.periodUnit ?? ''),
|
|
55
61
|
cumulativePerSecondText: getTextForCumulativePerSecond(cumulativePerSecond, profileType?.periodUnit ?? 'CPU Cores'),
|
|
62
|
+
flatText: getTextForCumulative(flat, totalUnfiltered, total, profileType.periodUnit ?? ''),
|
|
63
|
+
flatPerSecondText: getTextForCumulativePerSecond(flatPerSecond, profileType?.periodUnit ?? 'CPU Cores'),
|
|
56
64
|
diffText,
|
|
57
65
|
diff,
|
|
58
66
|
row,
|
|
@@ -17,6 +17,8 @@ export declare const FIELD_CHILDREN = "children";
|
|
|
17
17
|
export declare const FIELD_LABELS = "labels";
|
|
18
18
|
export declare const FIELD_CUMULATIVE = "cumulative";
|
|
19
19
|
export declare const FIELD_CUMULATIVE_PER_SECOND = "cumulative_per_second";
|
|
20
|
+
export declare const FIELD_FLAT = "flat";
|
|
21
|
+
export declare const FIELD_FLAT_PER_SECOND = "flat_per_second";
|
|
20
22
|
export declare const FIELD_DIFF = "diff";
|
|
21
23
|
export declare const FIELD_DIFF_PER_SECOND = "diff_per_second";
|
|
22
24
|
interface IcicleGraphArrowProps {
|
|
@@ -39,6 +39,8 @@ export const FIELD_CHILDREN = 'children';
|
|
|
39
39
|
export const FIELD_LABELS = 'labels';
|
|
40
40
|
export const FIELD_CUMULATIVE = 'cumulative';
|
|
41
41
|
export const FIELD_CUMULATIVE_PER_SECOND = 'cumulative_per_second';
|
|
42
|
+
export const FIELD_FLAT = 'flat';
|
|
43
|
+
export const FIELD_FLAT_PER_SECOND = 'flat_per_second';
|
|
42
44
|
export const FIELD_DIFF = 'diff';
|
|
43
45
|
export const FIELD_DIFF_PER_SECOND = 'diff_per_second';
|
|
44
46
|
export const getMappingColors = (mappingsList, isDarkMode, currentColorProfile) => {
|
|
@@ -58,7 +58,7 @@ export const getTextForCumulative = (hoveringNodeCumulative, totalUnfiltered, to
|
|
|
58
58
|
(${(100 * divide(hoveringNodeCumulative, totalUnfiltered)).toFixed(2)}%${filtered})`;
|
|
59
59
|
};
|
|
60
60
|
export const getTextForCumulativePerSecond = (hoveringNodeCumulative, unit) => {
|
|
61
|
-
return `${valueFormatter(hoveringNodeCumulative, unit === 'nanoseconds' ? 'CPU Cores' : unit, 5)}`;
|
|
61
|
+
return `${valueFormatter(hoveringNodeCumulative, unit === 'nanoseconds' ? 'CPU Cores' : unit, 5)}/s`;
|
|
62
62
|
};
|
|
63
63
|
export const arrowToString = (buffer) => {
|
|
64
64
|
if (buffer == null || typeof buffer === 'string') {
|
package/dist/ProfileSource.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare class MergedProfileSelection implements ProfileSelection {
|
|
|
30
30
|
mergeTo: number;
|
|
31
31
|
query: Query;
|
|
32
32
|
filterQuery: string | undefined;
|
|
33
|
+
profileSource: ProfileSource;
|
|
33
34
|
constructor(mergeFrom: number, mergeTo: number, query: Query, filterQuery?: string);
|
|
34
35
|
ProfileName(): string;
|
|
35
36
|
HistoryParams(): {
|
|
@@ -42,6 +43,7 @@ export declare class ProfileDiffSource implements ProfileSource {
|
|
|
42
43
|
a: ProfileSource;
|
|
43
44
|
b: ProfileSource;
|
|
44
45
|
filterQuery: string | undefined;
|
|
46
|
+
profileType: ProfileType;
|
|
45
47
|
constructor(a: ProfileSource, b: ProfileSource, filterQuery?: string);
|
|
46
48
|
DiffSelection(): ProfileDiffSelection;
|
|
47
49
|
QueryRequest(): QueryRequest;
|
|
@@ -54,6 +56,7 @@ export declare class MergedProfileSource implements ProfileSource {
|
|
|
54
56
|
mergeTo: number;
|
|
55
57
|
query: Query;
|
|
56
58
|
filterQuery: string | undefined;
|
|
59
|
+
profileType: ProfileType;
|
|
57
60
|
constructor(mergeFrom: number, mergeTo: number, query: Query, filterQuery?: string);
|
|
58
61
|
DiffSelection(): ProfileDiffSelection;
|
|
59
62
|
QueryRequest(): QueryRequest;
|
package/dist/ProfileSource.js
CHANGED
|
@@ -67,6 +67,7 @@ export class MergedProfileSelection {
|
|
|
67
67
|
this.mergeTo = mergeTo;
|
|
68
68
|
this.query = query;
|
|
69
69
|
this.filterQuery = filterQuery;
|
|
70
|
+
this.profileSource = new MergedProfileSource(this.mergeFrom, this.mergeTo, this.query, this.filterQuery);
|
|
70
71
|
}
|
|
71
72
|
ProfileName() {
|
|
72
73
|
return this.query.profileName();
|
|
@@ -84,7 +85,7 @@ export class MergedProfileSelection {
|
|
|
84
85
|
return 'merge';
|
|
85
86
|
}
|
|
86
87
|
ProfileSource() {
|
|
87
|
-
return
|
|
88
|
+
return this.profileSource;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
export class ProfileDiffSource {
|
|
@@ -92,6 +93,7 @@ export class ProfileDiffSource {
|
|
|
92
93
|
this.a = a;
|
|
93
94
|
this.b = b;
|
|
94
95
|
this.filterQuery = filterQuery;
|
|
96
|
+
this.profileType = a.ProfileType();
|
|
95
97
|
}
|
|
96
98
|
DiffSelection() {
|
|
97
99
|
throw new Error('Method not implemented.');
|
|
@@ -112,7 +114,7 @@ export class ProfileDiffSource {
|
|
|
112
114
|
};
|
|
113
115
|
}
|
|
114
116
|
ProfileType() {
|
|
115
|
-
return this.
|
|
117
|
+
return this.profileType;
|
|
116
118
|
}
|
|
117
119
|
Describe() {
|
|
118
120
|
return (_jsx(_Fragment, { children: _jsx("p", { children: "Browse the comparison" }) }));
|
|
@@ -132,6 +134,7 @@ export class MergedProfileSource {
|
|
|
132
134
|
this.mergeTo = mergeTo;
|
|
133
135
|
this.query = query;
|
|
134
136
|
this.filterQuery = filterQuery;
|
|
137
|
+
this.profileType = ProfileType.fromString(Query.parse(this.query.toString()).profileName());
|
|
135
138
|
}
|
|
136
139
|
DiffSelection() {
|
|
137
140
|
return {
|
|
@@ -163,7 +166,7 @@ export class MergedProfileSource {
|
|
|
163
166
|
};
|
|
164
167
|
}
|
|
165
168
|
ProfileType() {
|
|
166
|
-
return
|
|
169
|
+
return this.profileType;
|
|
167
170
|
}
|
|
168
171
|
stringMatchers() {
|
|
169
172
|
return this.query.matchers
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type VisibilityState } from '@tanstack/react-table';
|
|
2
|
-
import {
|
|
1
|
+
import { type ColumnDef, type VisibilityState } from '@tanstack/react-table';
|
|
2
|
+
import type { Row } from './';
|
|
3
3
|
declare const ColumnsVisibility: ({ columns, visibility, setVisibility, }: {
|
|
4
|
-
columns: ColumnDef
|
|
4
|
+
columns: Array<ColumnDef<Row>>;
|
|
5
5
|
visibility: VisibilityState;
|
|
6
6
|
setVisibility: (id: string, visible: boolean) => void;
|
|
7
7
|
}) => React.JSX.Element;
|
package/dist/Table/index.d.ts
CHANGED
|
@@ -2,18 +2,29 @@ import React from 'react';
|
|
|
2
2
|
import { Vector } from 'apache-arrow';
|
|
3
3
|
import { ProfileType } from '@parca/parser';
|
|
4
4
|
import { type NavigateFunction } from '@parca/utilities';
|
|
5
|
-
export interface
|
|
6
|
-
id:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
export interface DataRow {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
flat: bigint;
|
|
9
|
+
flatDiff: bigint;
|
|
10
|
+
cumulative: bigint;
|
|
11
|
+
cumulativeDiff: bigint;
|
|
12
|
+
mappingFile: string;
|
|
13
|
+
functionSystemName: string;
|
|
14
|
+
functionFileName: string;
|
|
15
|
+
callers?: DataRow[];
|
|
16
|
+
callees?: DataRow[];
|
|
17
|
+
subRows?: Row[];
|
|
18
|
+
isTopSubRow?: boolean;
|
|
19
|
+
isBottomSubRow?: boolean;
|
|
16
20
|
}
|
|
21
|
+
interface DummyRow {
|
|
22
|
+
size: number;
|
|
23
|
+
message?: string;
|
|
24
|
+
isTopSubRow?: boolean;
|
|
25
|
+
isBottomSubRow?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export type Row = DataRow | DummyRow;
|
|
17
28
|
interface TableProps {
|
|
18
29
|
data?: Uint8Array;
|
|
19
30
|
total: bigint;
|