@parca/profile 0.16.415 → 0.16.417
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/Callgraph/index.js +3 -2
- package/dist/GraphTooltipArrow/Content.d.ts +1 -3
- package/dist/GraphTooltipArrow/Content.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/Content.js +4 -4
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +2 -2
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts +1 -3
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +6 -16
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +3 -3
- package/dist/ProfileExplorer/ProfileExplorerSingle.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +1 -1
- package/dist/ProfileExplorer/index.d.ts.map +1 -1
- package/dist/ProfileExplorer/index.js +1 -7
- package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.d.ts +1 -3
- package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.js +2 -2
- package/dist/ProfileIcicleGraph/IcicleGraph/index.d.ts +0 -2
- package/dist/ProfileIcicleGraph/IcicleGraph/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraph/index.js +4 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.d.ts +1 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.js +8 -20
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts +1 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.js +2 -2
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts +1 -2
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.js +6 -9
- package/dist/ProfileIcicleGraph/index.d.ts +1 -3
- package/dist/ProfileIcicleGraph/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/index.js +20 -48
- package/dist/ProfileMetricsGraph/index.js +1 -2
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +19 -2
- package/dist/ProfileView/FilterByFunctionButton.d.ts +1 -4
- package/dist/ProfileView/FilterByFunctionButton.d.ts.map +1 -1
- package/dist/ProfileView/FilterByFunctionButton.js +12 -3
- package/dist/ProfileView/ViewSelector.d.ts +1 -3
- package/dist/ProfileView/ViewSelector.d.ts.map +1 -1
- package/dist/ProfileView/ViewSelector.js +3 -4
- package/dist/ProfileView/VisualizationPanel.d.ts +0 -2
- package/dist/ProfileView/VisualizationPanel.d.ts.map +1 -1
- package/dist/ProfileView/VisualizationPanel.js +2 -2
- package/dist/ProfileView/index.d.ts +1 -5
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +11 -18
- package/dist/ProfileViewWithData.d.ts +1 -3
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +15 -12
- package/dist/SourceView/index.js +1 -1
- package/dist/SourceView/useSelectedLineRange.js +1 -1
- package/dist/Table/index.d.ts +1 -2
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +9 -25
- package/dist/TopTable/index.d.ts.map +1 -1
- package/dist/TopTable/index.js +3 -7
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/styles.css +1 -1
- package/package.json +7 -7
- package/src/Callgraph/index.tsx +3 -3
- package/src/GraphTooltipArrow/Content.tsx +4 -14
- package/src/GraphTooltipArrow/DockedGraphTooltip/index.tsx +2 -2
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +6 -22
- package/src/ProfileExplorer/ProfileExplorerCompare.tsx +2 -3
- package/src/ProfileExplorer/ProfileExplorerSingle.tsx +1 -5
- package/src/ProfileExplorer/index.tsx +0 -8
- package/src/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.tsx +2 -4
- package/src/ProfileIcicleGraph/IcicleGraph/index.tsx +5 -8
- package/src/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.tsx +8 -27
- package/src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx +2 -4
- package/src/ProfileIcicleGraph/IcicleGraphArrow/index.tsx +4 -17
- package/src/ProfileIcicleGraph/index.tsx +19 -67
- package/src/ProfileMetricsGraph/index.tsx +2 -2
- package/src/ProfileSelector/index.tsx +23 -2
- package/src/ProfileView/FilterByFunctionButton.tsx +15 -9
- package/src/ProfileView/ViewSelector.tsx +6 -7
- package/src/ProfileView/VisualizationPanel.tsx +1 -9
- package/src/ProfileView/index.tsx +8 -23
- package/src/ProfileViewWithData.tsx +15 -18
- package/src/SourceView/index.tsx +1 -1
- package/src/SourceView/useSelectedLineRange.ts +2 -2
- package/src/Table/index.tsx +10 -41
- package/src/TopTable/index.tsx +3 -8
- package/src/index.tsx +4 -0
|
@@ -15,7 +15,7 @@ import {useEffect, useMemo, useState} from 'react';
|
|
|
15
15
|
|
|
16
16
|
import {QueryRequest_ReportType, QueryServiceClient} from '@parca/client';
|
|
17
17
|
import {useGrpcMetadata, useParcaContext, useURLState} from '@parca/components';
|
|
18
|
-
import {saveAsBlob
|
|
18
|
+
import {saveAsBlob} from '@parca/utilities';
|
|
19
19
|
|
|
20
20
|
import {FIELD_FUNCTION_NAME} from './ProfileIcicleGraph/IcicleGraphArrow';
|
|
21
21
|
import {ProfileSource} from './ProfileSource';
|
|
@@ -26,26 +26,27 @@ import {downloadPprof} from './utils';
|
|
|
26
26
|
interface ProfileViewWithDataProps {
|
|
27
27
|
queryClient: QueryServiceClient;
|
|
28
28
|
profileSource: ProfileSource;
|
|
29
|
-
navigateTo?: NavigateFunction;
|
|
30
29
|
compare?: boolean;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
export const ProfileViewWithData = ({
|
|
34
33
|
queryClient,
|
|
35
34
|
profileSource,
|
|
36
|
-
navigateTo,
|
|
37
35
|
}: ProfileViewWithDataProps): JSX.Element => {
|
|
38
36
|
const metadata = useGrpcMetadata();
|
|
39
|
-
const [dashboardItems = [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
];
|
|
44
|
-
const [groupBy = [
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
const [dashboardItems] = useURLState<string[]>('dashboard_items', {
|
|
38
|
+
alwaysReturnArray: true,
|
|
39
|
+
});
|
|
40
|
+
const [sourceBuildID] = useURLState<string>('source_buildid');
|
|
41
|
+
const [sourceFilename] = useURLState<string>('source_filename');
|
|
42
|
+
const [groupBy] = useURLState<string[]>('group_by', {
|
|
43
|
+
defaultValue: [FIELD_FUNCTION_NAME],
|
|
44
|
+
alwaysReturnArray: true,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const [invertStack] = useURLState('invert_call_stack');
|
|
47
48
|
const invertCallStack = invertStack === 'true';
|
|
48
|
-
const [binaryFrameFilterStr] = useURLState(
|
|
49
|
+
const [binaryFrameFilterStr] = useURLState<string[] | string>('binary_frame_filter');
|
|
49
50
|
|
|
50
51
|
const binaryFrameFilter: string[] =
|
|
51
52
|
typeof binaryFrameFilterStr === 'string'
|
|
@@ -63,9 +64,6 @@ export const ProfileViewWithData = ({
|
|
|
63
64
|
return (1 / width) * 100;
|
|
64
65
|
}, []);
|
|
65
66
|
|
|
66
|
-
// make sure we get a string[]
|
|
67
|
-
const groupByParam: string[] = typeof groupBy === 'string' ? [groupBy] : groupBy;
|
|
68
|
-
|
|
69
67
|
const {
|
|
70
68
|
isLoading: flamegraphLoading,
|
|
71
69
|
response: flamegraphResponse,
|
|
@@ -73,7 +71,7 @@ export const ProfileViewWithData = ({
|
|
|
73
71
|
} = useQuery(queryClient, profileSource, QueryRequest_ReportType.FLAMEGRAPH_ARROW, {
|
|
74
72
|
skip: !dashboardItems.includes('icicle'),
|
|
75
73
|
nodeTrimThreshold,
|
|
76
|
-
groupBy
|
|
74
|
+
groupBy,
|
|
77
75
|
invertCallStack,
|
|
78
76
|
binaryFrameFilter,
|
|
79
77
|
});
|
|
@@ -85,7 +83,7 @@ export const ProfileViewWithData = ({
|
|
|
85
83
|
{
|
|
86
84
|
skip: !dashboardItems.includes('icicle'),
|
|
87
85
|
nodeTrimThreshold,
|
|
88
|
-
groupBy
|
|
86
|
+
groupBy,
|
|
89
87
|
invertCallStack,
|
|
90
88
|
binaryFrameFilter: undefined,
|
|
91
89
|
}
|
|
@@ -237,7 +235,6 @@ export const ProfileViewWithData = ({
|
|
|
237
235
|
}}
|
|
238
236
|
profileSource={profileSource}
|
|
239
237
|
queryClient={queryClient}
|
|
240
|
-
navigateTo={navigateTo}
|
|
241
238
|
onDownloadPProf={() => void downloadPProfClick()}
|
|
242
239
|
pprofDownloading={pprofDownloading}
|
|
243
240
|
/>
|
package/src/SourceView/index.tsx
CHANGED
|
@@ -42,7 +42,7 @@ export const SourceView = React.memo(function SourceView({
|
|
|
42
42
|
filtered,
|
|
43
43
|
setActionButtons,
|
|
44
44
|
}: SourceViewProps): JSX.Element {
|
|
45
|
-
const [sourceFileName] = useURLState(
|
|
45
|
+
const [sourceFileName] = useURLState<string | undefined>('source_filename');
|
|
46
46
|
const {isDarkMode, sourceViewContextMenuItems = []} = useParcaContext();
|
|
47
47
|
|
|
48
48
|
const sourceCode = useMemo(() => {
|
|
@@ -22,12 +22,12 @@ interface LineRange {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const useLineRange = (): LineRange => {
|
|
25
|
-
const [sourceLine, setSourceLine] = useURLState(
|
|
25
|
+
const [sourceLine, setSourceLine] = useURLState<string | undefined>('source_line');
|
|
26
26
|
const [startLine, endLine] = useMemo(() => {
|
|
27
27
|
if (sourceLine == null) {
|
|
28
28
|
return [-1, -1];
|
|
29
29
|
}
|
|
30
|
-
const [start, end] =
|
|
30
|
+
const [start, end] = sourceLine.split('-');
|
|
31
31
|
|
|
32
32
|
if (end === undefined) {
|
|
33
33
|
return [parseInt(start, 10), parseInt(start, 10)];
|
package/src/Table/index.tsx
CHANGED
|
@@ -34,13 +34,7 @@ import {
|
|
|
34
34
|
} from '@parca/components';
|
|
35
35
|
import {type RowRendererProps} from '@parca/components/dist/Table';
|
|
36
36
|
import {ProfileType} from '@parca/parser';
|
|
37
|
-
import {
|
|
38
|
-
getLastItem,
|
|
39
|
-
isSearchMatch,
|
|
40
|
-
parseParams,
|
|
41
|
-
valueFormatter,
|
|
42
|
-
type NavigateFunction,
|
|
43
|
-
} from '@parca/utilities';
|
|
37
|
+
import {getLastItem, isSearchMatch, valueFormatter} from '@parca/utilities';
|
|
44
38
|
|
|
45
39
|
import {useProfileViewContext} from '../ProfileView/ProfileViewContext';
|
|
46
40
|
import {hexifyAddress} from '../utils';
|
|
@@ -96,9 +90,9 @@ interface TableProps {
|
|
|
96
90
|
total: bigint;
|
|
97
91
|
filtered: bigint;
|
|
98
92
|
profileType?: ProfileType;
|
|
99
|
-
navigateTo?: NavigateFunction;
|
|
100
93
|
loading: boolean;
|
|
101
94
|
currentSearchString?: string;
|
|
95
|
+
setSearchString?: (searchString: string) => void;
|
|
102
96
|
setActionButtons?: (buttons: React.JSX.Element) => void;
|
|
103
97
|
isHalfScreen: boolean;
|
|
104
98
|
unit?: string;
|
|
@@ -295,29 +289,22 @@ export const Table = React.memo(function Table({
|
|
|
295
289
|
total,
|
|
296
290
|
filtered,
|
|
297
291
|
profileType,
|
|
298
|
-
navigateTo,
|
|
299
292
|
loading,
|
|
300
293
|
currentSearchString,
|
|
294
|
+
setSearchString = () => {},
|
|
301
295
|
setActionButtons,
|
|
302
296
|
isHalfScreen,
|
|
303
297
|
unit,
|
|
304
298
|
}: TableProps): React.JSX.Element {
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
299
|
+
const [dashboardItems] = useURLState<string[]>('dashboard_items', {
|
|
300
|
+
alwaysReturnArray: true,
|
|
301
|
+
});
|
|
308
302
|
const {isDarkMode} = useParcaContext();
|
|
309
303
|
const [expanded, setExpanded] = useState<ExpandedState>({});
|
|
310
304
|
const [scrollToIndex, setScrollToIndex] = useState<number | undefined>(undefined);
|
|
311
305
|
|
|
312
306
|
const {compareMode} = useProfileViewContext();
|
|
313
307
|
|
|
314
|
-
const dashboardItems = useMemo(() => {
|
|
315
|
-
if (rawDashboardItems !== undefined) {
|
|
316
|
-
return rawDashboardItems as string[];
|
|
317
|
-
}
|
|
318
|
-
return ['icicle'];
|
|
319
|
-
}, [rawDashboardItems]);
|
|
320
|
-
|
|
321
308
|
const percentageString = (value: bigint | number, total: bigint | number): string => {
|
|
322
309
|
if (total === 0n) {
|
|
323
310
|
return '0%';
|
|
@@ -486,18 +473,9 @@ export const Table = React.memo(function Table({
|
|
|
486
473
|
|
|
487
474
|
const selectSpan = useCallback(
|
|
488
475
|
(span: string): void => {
|
|
489
|
-
|
|
490
|
-
navigateTo(
|
|
491
|
-
'/',
|
|
492
|
-
{
|
|
493
|
-
...router,
|
|
494
|
-
...{search_string: span.trim()},
|
|
495
|
-
},
|
|
496
|
-
{replace: true}
|
|
497
|
-
);
|
|
498
|
-
}
|
|
476
|
+
setSearchString(span.trim());
|
|
499
477
|
},
|
|
500
|
-
[
|
|
478
|
+
[setSearchString]
|
|
501
479
|
);
|
|
502
480
|
|
|
503
481
|
const onRowClick = useCallback(
|
|
@@ -563,17 +541,8 @@ export const Table = React.memo(function Table({
|
|
|
563
541
|
}, [currentSearchString]);
|
|
564
542
|
|
|
565
543
|
const clearSelection = useCallback((): void => {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
'/',
|
|
569
|
-
{
|
|
570
|
-
...router,
|
|
571
|
-
...{search_string: filterByFunctionInput ?? ''},
|
|
572
|
-
},
|
|
573
|
-
{replace: true}
|
|
574
|
-
);
|
|
575
|
-
}
|
|
576
|
-
}, [navigateTo, router, filterByFunctionInput]);
|
|
544
|
+
setSearchString('');
|
|
545
|
+
}, [setSearchString]);
|
|
577
546
|
|
|
578
547
|
useEffect(() => {
|
|
579
548
|
setActionButtons?.(
|
package/src/TopTable/index.tsx
CHANGED
|
@@ -72,17 +72,12 @@ export const TopTable = React.memo(function TopTable({
|
|
|
72
72
|
setActionButtons,
|
|
73
73
|
}: TopTableProps): JSX.Element {
|
|
74
74
|
const router = parseParams(window?.location.search);
|
|
75
|
-
const [
|
|
75
|
+
const [dashboardItems] = useURLState<string[]>('dashboard_items', {
|
|
76
|
+
alwaysReturnArray: true,
|
|
77
|
+
});
|
|
76
78
|
|
|
77
79
|
const {compareMode} = useProfileViewContext();
|
|
78
80
|
|
|
79
|
-
const dashboardItems = useMemo(() => {
|
|
80
|
-
if (rawDashboardItems !== undefined) {
|
|
81
|
-
return rawDashboardItems as string[];
|
|
82
|
-
}
|
|
83
|
-
return ['icicle'];
|
|
84
|
-
}, [rawDashboardItems]);
|
|
85
|
-
|
|
86
81
|
const columns = useMemo(() => {
|
|
87
82
|
const cols: Array<ColumnDef<TopNode, any>> = [
|
|
88
83
|
columnHelper.accessor('meta', {
|
package/src/index.tsx
CHANGED
|
@@ -25,6 +25,10 @@ export * from './ProfileTypeSelector';
|
|
|
25
25
|
export * from './SourceView';
|
|
26
26
|
export {default as Callgraph} from './Callgraph';
|
|
27
27
|
|
|
28
|
+
export const DEFAULT_PROFILE_EXPLORER_PARAM_VALUES = {
|
|
29
|
+
dashboard_items: 'icicle',
|
|
30
|
+
};
|
|
31
|
+
|
|
28
32
|
export type {CallgraphProps};
|
|
29
33
|
|
|
30
34
|
export {ProfileExplorer, ProfileTypeSelector, getExpressionAsAString};
|