@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/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.380",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@headlessui/react": "^1.7.19",
|
|
7
7
|
"@iconify/react": "^4.0.0",
|
|
8
|
-
"@parca/client": "
|
|
9
|
-
"@parca/components": "
|
|
10
|
-
"@parca/dynamicsize": "
|
|
11
|
-
"@parca/hooks": "
|
|
12
|
-
"@parca/icons": "
|
|
13
|
-
"@parca/parser": "
|
|
14
|
-
"@parca/store": "
|
|
15
|
-
"@parca/utilities": "
|
|
8
|
+
"@parca/client": "0.16.115",
|
|
9
|
+
"@parca/components": "0.16.279",
|
|
10
|
+
"@parca/dynamicsize": "0.16.65",
|
|
11
|
+
"@parca/hooks": "0.0.58",
|
|
12
|
+
"@parca/icons": "0.16.69",
|
|
13
|
+
"@parca/parser": "0.16.74",
|
|
14
|
+
"@parca/store": "0.16.147",
|
|
15
|
+
"@parca/utilities": "0.0.75",
|
|
16
16
|
"@popperjs/core": "^2.11.8",
|
|
17
17
|
"@protobuf-ts/runtime-rpc": "^2.5.0",
|
|
18
18
|
"@tanstack/react-query": "^4.0.5",
|
|
19
|
-
"@tanstack/react-table": "^8.
|
|
19
|
+
"@tanstack/react-table": "^8.17.3",
|
|
20
20
|
"@tanstack/table-core": "^8.16.0",
|
|
21
21
|
"@types/d3": "^7.4.3",
|
|
22
22
|
"@types/d3-scale": "^4.0.8",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"access": "public",
|
|
72
72
|
"registry": "https://registry.npmjs.org/"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "ba26a71d9219936074772245779aa66ab39bed6e"
|
|
75
75
|
}
|
|
@@ -67,6 +67,8 @@ const GraphTooltipArrowContent = ({
|
|
|
67
67
|
locationAddress,
|
|
68
68
|
cumulativeText,
|
|
69
69
|
cumulativePerSecondText,
|
|
70
|
+
flatText,
|
|
71
|
+
flatPerSecondText,
|
|
70
72
|
diffText,
|
|
71
73
|
diff,
|
|
72
74
|
row: rowNumber,
|
|
@@ -93,9 +95,15 @@ const GraphTooltipArrowContent = ({
|
|
|
93
95
|
</div>
|
|
94
96
|
<table className="my-2 w-full table-fixed pr-0 text-gray-700 dark:text-gray-300">
|
|
95
97
|
<tbody>
|
|
98
|
+
<tr>
|
|
99
|
+
<td className="w-1/4">Cumulative</td>
|
|
100
|
+
<td className="w-3/4">
|
|
101
|
+
<div>{cumulativeText}</div>
|
|
102
|
+
</td>
|
|
103
|
+
</tr>
|
|
96
104
|
{profileType?.delta ?? false ? (
|
|
97
105
|
<tr>
|
|
98
|
-
<td className="w-1/4"
|
|
106
|
+
<td className="w-1/4"></td>
|
|
99
107
|
<td className="w-3/4">
|
|
100
108
|
<div>{cumulativePerSecondText}</div>
|
|
101
109
|
</td>
|
|
@@ -104,16 +112,25 @@ const GraphTooltipArrowContent = ({
|
|
|
104
112
|
<></>
|
|
105
113
|
)}
|
|
106
114
|
<tr>
|
|
107
|
-
<td className="w-1/4">
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<div>{cumulativeText}</div>
|
|
115
|
+
<td className="w-1/4 pt-2">Flat</td>
|
|
116
|
+
<td className="w-3/4 pt-2">
|
|
117
|
+
<div>{flatText}</div>
|
|
111
118
|
</td>
|
|
112
119
|
</tr>
|
|
113
|
-
{
|
|
120
|
+
{profileType?.delta ?? false ? (
|
|
114
121
|
<tr>
|
|
115
|
-
<td className="w-1/4"
|
|
122
|
+
<td className="w-1/4"></td>
|
|
116
123
|
<td className="w-3/4">
|
|
124
|
+
<div>{flatPerSecondText}</div>
|
|
125
|
+
</td>
|
|
126
|
+
</tr>
|
|
127
|
+
) : (
|
|
128
|
+
<></>
|
|
129
|
+
)}
|
|
130
|
+
{diff !== 0n && (
|
|
131
|
+
<tr>
|
|
132
|
+
<td className="w-1/4 pt-2">Diff</td>
|
|
133
|
+
<td className="w-3/4 pt-2">
|
|
117
134
|
<div>{diffText}</div>
|
|
118
135
|
</td>
|
|
119
136
|
</tr>
|
|
@@ -169,8 +186,8 @@ const TooltipMetaInfo = ({
|
|
|
169
186
|
return (
|
|
170
187
|
<>
|
|
171
188
|
<tr>
|
|
172
|
-
<td className="w-1/4">File</td>
|
|
173
|
-
<td className="w-3/4 break-all">
|
|
189
|
+
<td className="w-1/4 pt-2">File</td>
|
|
190
|
+
<td className="w-3/4 pt-2 break-all">
|
|
174
191
|
{functionFilename === '' ? (
|
|
175
192
|
<NoData />
|
|
176
193
|
) : (
|
|
@@ -21,6 +21,8 @@ import {
|
|
|
21
21
|
FIELD_CUMULATIVE_PER_SECOND,
|
|
22
22
|
FIELD_DIFF,
|
|
23
23
|
FIELD_DIFF_PER_SECOND,
|
|
24
|
+
FIELD_FLAT,
|
|
25
|
+
FIELD_FLAT_PER_SECOND,
|
|
24
26
|
FIELD_LOCATION_ADDRESS,
|
|
25
27
|
} from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
26
28
|
import {
|
|
@@ -43,6 +45,8 @@ interface GraphTooltipData {
|
|
|
43
45
|
locationAddress: bigint;
|
|
44
46
|
cumulativeText: string;
|
|
45
47
|
cumulativePerSecondText: string;
|
|
48
|
+
flatText: string;
|
|
49
|
+
flatPerSecondText: string;
|
|
46
50
|
diffText: string;
|
|
47
51
|
diff: bigint;
|
|
48
52
|
row: number;
|
|
@@ -70,6 +74,14 @@ export const useGraphTooltip = ({
|
|
|
70
74
|
table.getChild(FIELD_CUMULATIVE_PER_SECOND)?.get(row) !== null
|
|
71
75
|
? table.getChild(FIELD_CUMULATIVE_PER_SECOND)?.get(row)
|
|
72
76
|
: 0;
|
|
77
|
+
const flat: bigint =
|
|
78
|
+
table.getChild(FIELD_FLAT)?.get(row) !== null
|
|
79
|
+
? BigInt(table.getChild(FIELD_FLAT)?.get(row))
|
|
80
|
+
: 0n;
|
|
81
|
+
const flatPerSecond: number =
|
|
82
|
+
table.getChild(FIELD_FLAT_PER_SECOND)?.get(row) !== null
|
|
83
|
+
? table.getChild(FIELD_FLAT_PER_SECOND)?.get(row)
|
|
84
|
+
: 0;
|
|
73
85
|
const diff: bigint =
|
|
74
86
|
table.getChild(FIELD_DIFF)?.get(row) !== null
|
|
75
87
|
? BigInt(table.getChild(FIELD_DIFF)?.get(row))
|
|
@@ -111,6 +123,11 @@ export const useGraphTooltip = ({
|
|
|
111
123
|
cumulativePerSecond,
|
|
112
124
|
profileType?.periodUnit ?? 'CPU Cores'
|
|
113
125
|
),
|
|
126
|
+
flatText: getTextForCumulative(flat, totalUnfiltered, total, profileType.periodUnit ?? ''),
|
|
127
|
+
flatPerSecondText: getTextForCumulativePerSecond(
|
|
128
|
+
flatPerSecond,
|
|
129
|
+
profileType?.periodUnit ?? 'CPU Cores'
|
|
130
|
+
),
|
|
114
131
|
diffText,
|
|
115
132
|
diff,
|
|
116
133
|
row,
|
|
@@ -57,6 +57,8 @@ export const FIELD_CHILDREN = 'children';
|
|
|
57
57
|
export const FIELD_LABELS = 'labels';
|
|
58
58
|
export const FIELD_CUMULATIVE = 'cumulative';
|
|
59
59
|
export const FIELD_CUMULATIVE_PER_SECOND = 'cumulative_per_second';
|
|
60
|
+
export const FIELD_FLAT = 'flat';
|
|
61
|
+
export const FIELD_FLAT_PER_SECOND = 'flat_per_second';
|
|
60
62
|
export const FIELD_DIFF = 'diff';
|
|
61
63
|
export const FIELD_DIFF_PER_SECOND = 'diff_per_second';
|
|
62
64
|
|
package/src/ProfileSource.tsx
CHANGED
|
@@ -108,12 +108,19 @@ export class MergedProfileSelection implements ProfileSelection {
|
|
|
108
108
|
mergeTo: number;
|
|
109
109
|
query: Query;
|
|
110
110
|
filterQuery: string | undefined;
|
|
111
|
+
profileSource: ProfileSource;
|
|
111
112
|
|
|
112
113
|
constructor(mergeFrom: number, mergeTo: number, query: Query, filterQuery?: string) {
|
|
113
114
|
this.mergeFrom = mergeFrom;
|
|
114
115
|
this.mergeTo = mergeTo;
|
|
115
116
|
this.query = query;
|
|
116
117
|
this.filterQuery = filterQuery;
|
|
118
|
+
this.profileSource = new MergedProfileSource(
|
|
119
|
+
this.mergeFrom,
|
|
120
|
+
this.mergeTo,
|
|
121
|
+
this.query,
|
|
122
|
+
this.filterQuery
|
|
123
|
+
);
|
|
117
124
|
}
|
|
118
125
|
|
|
119
126
|
ProfileName(): string {
|
|
@@ -135,7 +142,7 @@ export class MergedProfileSelection implements ProfileSelection {
|
|
|
135
142
|
}
|
|
136
143
|
|
|
137
144
|
ProfileSource(): ProfileSource {
|
|
138
|
-
return
|
|
145
|
+
return this.profileSource;
|
|
139
146
|
}
|
|
140
147
|
}
|
|
141
148
|
|
|
@@ -143,11 +150,13 @@ export class ProfileDiffSource implements ProfileSource {
|
|
|
143
150
|
a: ProfileSource;
|
|
144
151
|
b: ProfileSource;
|
|
145
152
|
filterQuery: string | undefined;
|
|
153
|
+
profileType: ProfileType;
|
|
146
154
|
|
|
147
155
|
constructor(a: ProfileSource, b: ProfileSource, filterQuery?: string) {
|
|
148
156
|
this.a = a;
|
|
149
157
|
this.b = b;
|
|
150
158
|
this.filterQuery = filterQuery;
|
|
159
|
+
this.profileType = a.ProfileType();
|
|
151
160
|
}
|
|
152
161
|
|
|
153
162
|
DiffSelection(): ProfileDiffSelection {
|
|
@@ -171,7 +180,7 @@ export class ProfileDiffSource implements ProfileSource {
|
|
|
171
180
|
}
|
|
172
181
|
|
|
173
182
|
ProfileType(): ProfileType {
|
|
174
|
-
return this.
|
|
183
|
+
return this.profileType;
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
Describe(): JSX.Element {
|
|
@@ -199,12 +208,14 @@ export class MergedProfileSource implements ProfileSource {
|
|
|
199
208
|
mergeTo: number;
|
|
200
209
|
query: Query;
|
|
201
210
|
filterQuery: string | undefined;
|
|
211
|
+
profileType: ProfileType;
|
|
202
212
|
|
|
203
213
|
constructor(mergeFrom: number, mergeTo: number, query: Query, filterQuery?: string) {
|
|
204
214
|
this.mergeFrom = mergeFrom;
|
|
205
215
|
this.mergeTo = mergeTo;
|
|
206
216
|
this.query = query;
|
|
207
217
|
this.filterQuery = filterQuery;
|
|
218
|
+
this.profileType = ProfileType.fromString(Query.parse(this.query.toString()).profileName());
|
|
208
219
|
}
|
|
209
220
|
|
|
210
221
|
DiffSelection(): ProfileDiffSelection {
|
|
@@ -239,7 +250,7 @@ export class MergedProfileSource implements ProfileSource {
|
|
|
239
250
|
}
|
|
240
251
|
|
|
241
252
|
ProfileType(): ProfileType {
|
|
242
|
-
return
|
|
253
|
+
return this.profileType;
|
|
243
254
|
}
|
|
244
255
|
|
|
245
256
|
stringMatchers(): string[] {
|
|
@@ -15,16 +15,16 @@ import {Fragment} from 'react';
|
|
|
15
15
|
|
|
16
16
|
import {Menu, Transition} from '@headlessui/react';
|
|
17
17
|
import {Icon} from '@iconify/react';
|
|
18
|
-
import {type VisibilityState} from '@tanstack/react-table';
|
|
18
|
+
import {type ColumnDef, type VisibilityState} from '@tanstack/react-table';
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import type {Row} from './';
|
|
21
21
|
|
|
22
22
|
const ColumnsVisibility = ({
|
|
23
23
|
columns,
|
|
24
24
|
visibility,
|
|
25
25
|
setVisibility,
|
|
26
26
|
}: {
|
|
27
|
-
columns: ColumnDef
|
|
27
|
+
columns: Array<ColumnDef<Row>>;
|
|
28
28
|
visibility: VisibilityState;
|
|
29
29
|
setVisibility: (id: string, visible: boolean) => void;
|
|
30
30
|
}): React.JSX.Element => {
|
|
@@ -69,7 +69,7 @@ const ColumnsVisibility = ({
|
|
|
69
69
|
htmlFor={col.id}
|
|
70
70
|
className="font-medium text-gray-900 dark:text-gray-200"
|
|
71
71
|
>
|
|
72
|
-
{col.header}
|
|
72
|
+
{col.header as string}
|
|
73
73
|
</label>
|
|
74
74
|
</div>
|
|
75
75
|
</div>
|