@parca/profile 0.19.112 → 0.19.114
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.d.ts +2 -2
- package/dist/GraphTooltipArrow/Content.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.d.ts +2 -2
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltip/index.d.ts +2 -2
- package/dist/GraphTooltipArrow/useGraphTooltip/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts +2 -2
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerSingle.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +9 -3
- package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.d.ts +31 -0
- package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.d.ts.map +1 -0
- package/dist/{MetricsGraphStrips/AreaGraph → ProfileFlameChart/SamplesStrips/SamplesGraph}/index.js +32 -60
- package/dist/{MetricsGraphStrips/MetricsGraphStrips.stories.d.ts → ProfileFlameChart/SamplesStrips/SamplesStrips.stories.d.ts} +4 -3
- package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.d.ts.map +1 -0
- package/dist/{MetricsGraphStrips/MetricsGraphStrips.stories.js → ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js} +5 -4
- package/dist/{MetricsGraphStrips → ProfileFlameChart/SamplesStrips}/index.d.ts +5 -4
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -0
- package/dist/ProfileFlameChart/SamplesStrips/index.js +141 -0
- package/dist/ProfileFlameChart/index.d.ts +20 -0
- package/dist/ProfileFlameChart/index.d.ts.map +1 -0
- package/dist/ProfileFlameChart/index.js +155 -0
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts +2 -2
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.d.ts +2 -2
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.d.ts +2 -2
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts +3 -3
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +3 -2
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.d.ts +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +16 -16
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.d.ts +2 -2
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/utils.d.ts +5 -5
- package/dist/ProfileFlameGraph/FlameGraphArrow/utils.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/index.js +0 -1
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.d.ts +2 -1
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +11 -21
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +13 -3
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +4 -0
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts +1 -0
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +2 -2
- package/dist/ProfileView/components/DashboardItems/index.d.ts +5 -4
- package/dist/ProfileView/components/DashboardItems/index.d.ts.map +1 -1
- package/dist/ProfileView/components/DashboardItems/index.js +4 -3
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts +2 -1
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts.map +1 -1
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +2 -2
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +1 -1
- package/dist/ProfileView/components/Toolbars/index.d.ts +2 -0
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +4 -2
- package/dist/ProfileView/hooks/useAutoSelectDimension.d.ts +16 -0
- package/dist/ProfileView/hooks/useAutoSelectDimension.d.ts.map +1 -0
- package/dist/ProfileView/hooks/useAutoSelectDimension.js +75 -0
- package/dist/ProfileView/hooks/useProfileMetadata.d.ts +2 -2
- package/dist/ProfileView/hooks/useProfileMetadata.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useProfileMetadata.js +6 -2
- package/dist/ProfileView/hooks/useVisualizationState.d.ts +2 -0
- package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.js +8 -0
- package/dist/ProfileView/index.d.ts +1 -1
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +7 -4
- package/dist/ProfileView/types/visualization.d.ts +15 -3
- package/dist/ProfileView/types/visualization.d.ts.map +1 -1
- package/dist/ProfileViewWithData.d.ts +2 -1
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +41 -29
- package/dist/Sandwich/components/CallersSection.d.ts.map +1 -1
- package/dist/Sandwich/components/CallersSection.js +5 -2
- package/dist/Sandwich/utils/processRowData.d.ts +1 -1
- package/dist/Sandwich/utils/processRowData.d.ts.map +1 -1
- package/dist/SourceView/index.js +3 -3
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +3 -2
- package/dist/Table/utils/functions.d.ts +3 -3
- package/dist/Table/utils/functions.d.ts.map +1 -1
- package/dist/Table/utils/functions.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/styles.css +1 -1
- package/dist/utils.d.ts +6 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +8 -0
- package/package.json +9 -8
- package/src/GraphTooltipArrow/Content.tsx +3 -3
- package/src/GraphTooltipArrow/DockedGraphTooltip/index.tsx +2 -2
- package/src/GraphTooltipArrow/useGraphTooltip/index.ts +2 -2
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +2 -2
- package/src/ProfileExplorer/ProfileExplorerSingle.tsx +14 -3
- package/src/{MetricsGraphStrips/AreaGraph → ProfileFlameChart/SamplesStrips/SamplesGraph}/index.tsx +77 -81
- package/src/{MetricsGraphStrips/MetricsGraphStrips.stories.tsx → ProfileFlameChart/SamplesStrips/SamplesStrips.stories.tsx} +7 -6
- package/src/ProfileFlameChart/SamplesStrips/index.tsx +301 -0
- package/src/ProfileFlameChart/index.tsx +305 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +2 -2
- package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.tsx +2 -2
- package/src/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.tsx +2 -2
- package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -3
- package/src/ProfileFlameGraph/FlameGraphArrow/index.tsx +4 -3
- package/src/ProfileFlameGraph/FlameGraphArrow/useMappingList.ts +19 -19
- package/src/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.ts +4 -6
- package/src/ProfileFlameGraph/FlameGraphArrow/utils.ts +6 -10
- package/src/ProfileFlameGraph/index.tsx +0 -1
- package/src/ProfileMetricsGraph/hooks/useQueryRange.ts +18 -26
- package/src/ProfileMetricsGraph/index.tsx +24 -2
- package/src/ProfileSelector/index.tsx +11 -0
- package/src/ProfileView/components/ActionButtons/GroupByDropdown.tsx +3 -0
- package/src/ProfileView/components/DashboardItems/index.tsx +19 -17
- package/src/ProfileView/components/GroupByLabelsDropdown/index.tsx +4 -2
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +1 -1
- package/src/ProfileView/components/Toolbars/index.tsx +18 -1
- package/src/ProfileView/hooks/useAutoSelectDimension.ts +90 -0
- package/src/ProfileView/hooks/useProfileMetadata.ts +8 -4
- package/src/ProfileView/hooks/useVisualizationState.ts +17 -0
- package/src/ProfileView/index.tsx +16 -2
- package/src/ProfileView/types/visualization.ts +17 -3
- package/src/ProfileViewWithData.tsx +80 -37
- package/src/Sandwich/components/CallersSection.tsx +6 -3
- package/src/Sandwich/utils/processRowData.ts +1 -1
- package/src/SourceView/index.tsx +3 -3
- package/src/Table/index.tsx +3 -3
- package/src/Table/utils/functions.ts +9 -9
- package/src/index.tsx +4 -0
- package/src/utils.ts +9 -0
- package/dist/MetricsGraphStrips/AreaGraph/Tooltip.d.ts +0 -10
- package/dist/MetricsGraphStrips/AreaGraph/Tooltip.d.ts.map +0 -1
- package/dist/MetricsGraphStrips/AreaGraph/Tooltip.js +0 -44
- package/dist/MetricsGraphStrips/AreaGraph/index.d.ts +0 -21
- package/dist/MetricsGraphStrips/AreaGraph/index.d.ts.map +0 -1
- package/dist/MetricsGraphStrips/MetricsGraphStrips.stories.d.ts.map +0 -1
- package/dist/MetricsGraphStrips/index.d.ts.map +0 -1
- package/dist/MetricsGraphStrips/index.js +0 -70
- package/src/MetricsGraphStrips/AreaGraph/Tooltip.tsx +0 -83
- package/src/MetricsGraphStrips/index.tsx +0 -142
|
@@ -2,13 +2,13 @@ import { ProfilerOnRenderCallback } from 'react';
|
|
|
2
2
|
import { QueryServiceClient } from '@parca/client';
|
|
3
3
|
import { CurrentPathFrame } from '../../../ProfileFlameGraph/FlameGraphArrow/utils';
|
|
4
4
|
import { ProfileSource } from '../../../ProfileSource';
|
|
5
|
-
import type { FlamegraphData, SandwichData, SourceData, TopTableData, VisualizationType } from '../../types/visualization';
|
|
5
|
+
import type { FlamegraphData, SamplesData, SandwichData, SourceData, TopTableData, VisualizationType } from '../../types/visualization';
|
|
6
6
|
interface GetDashboardItemProps {
|
|
7
7
|
type: VisualizationType;
|
|
8
8
|
isHalfScreen: boolean;
|
|
9
9
|
dimensions: DOMRect | undefined;
|
|
10
10
|
flamegraphData: FlamegraphData;
|
|
11
|
-
|
|
11
|
+
samplesData?: SamplesData;
|
|
12
12
|
topTableData?: TopTableData;
|
|
13
13
|
sandwichData: SandwichData;
|
|
14
14
|
sourceData?: SourceData;
|
|
@@ -20,8 +20,9 @@ interface GetDashboardItemProps {
|
|
|
20
20
|
perf?: {
|
|
21
21
|
onRender?: ProfilerOnRenderCallback;
|
|
22
22
|
};
|
|
23
|
-
queryClient
|
|
23
|
+
queryClient: QueryServiceClient;
|
|
24
|
+
onSwitchToOneMinute?: () => void;
|
|
24
25
|
}
|
|
25
|
-
export declare const getDashboardItem: ({ type, isHalfScreen, dimensions, flamegraphData,
|
|
26
|
+
export declare const getDashboardItem: ({ type, isHalfScreen, dimensions, flamegraphData, samplesData, topTableData, sourceData, sandwichData, profileSource, total, filtered, curPathArrow, setNewCurPathArrow, perf, queryClient, onSwitchToOneMinute, }: GetDashboardItemProps) => JSX.Element;
|
|
26
27
|
export {};
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/DashboardItems/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAW,wBA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,CAAC"}
|
|
@@ -13,11 +13,12 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { Profiler } from 'react';
|
|
15
15
|
import { ConditionalWrapper } from '@parca/components';
|
|
16
|
+
import ProfileFlameChart from '../../../ProfileFlameChart';
|
|
16
17
|
import ProfileFlameGraph from '../../../ProfileFlameGraph';
|
|
17
18
|
import Sandwich from '../../../Sandwich';
|
|
18
19
|
import { SourceView } from '../../../SourceView';
|
|
19
20
|
import { Table } from '../../../Table';
|
|
20
|
-
export const getDashboardItem = ({ type, isHalfScreen, dimensions, flamegraphData,
|
|
21
|
+
export const getDashboardItem = ({ type, isHalfScreen, dimensions, flamegraphData, samplesData, topTableData, sourceData, sandwichData, profileSource, total, filtered, curPathArrow, setNewCurPathArrow, perf, queryClient, onSwitchToOneMinute, }) => {
|
|
21
22
|
switch (type) {
|
|
22
23
|
case 'flamegraph':
|
|
23
24
|
return (_jsx(ConditionalWrapper, { condition: perf?.onRender != null, WrapperComponent: Profiler, wrapperProps: {
|
|
@@ -29,11 +30,11 @@ export const getDashboardItem = ({ type, isHalfScreen, dimensions, flamegraphDat
|
|
|
29
30
|
: dimensions.width - 16
|
|
30
31
|
: 0, metadataMappingFiles: flamegraphData.metadataMappingFiles, metadataLoading: flamegraphData.metadataLoading, profileSource: profileSource }) }));
|
|
31
32
|
case 'flamechart':
|
|
32
|
-
return (_jsx(
|
|
33
|
+
return (_jsx(ProfileFlameChart, { samplesData: samplesData, queryClient: queryClient, profileSource: profileSource, width: dimensions?.width !== undefined
|
|
33
34
|
? isHalfScreen
|
|
34
35
|
? (dimensions.width - 54) / 2
|
|
35
36
|
: dimensions.width - 16
|
|
36
|
-
: 0, metadataMappingFiles:
|
|
37
|
+
: 0, total: total, filtered: filtered, profileType: profileSource?.ProfileType(), isHalfScreen: isHalfScreen, metadataMappingFiles: flamegraphData.metadataMappingFiles, metadataLoading: flamegraphData.metadataLoading, onSwitchToOneMinute: onSwitchToOneMinute }));
|
|
37
38
|
case 'table':
|
|
38
39
|
return topTableData != null ? (_jsx(Table, { error: topTableData.error, total: total, filtered: filtered, loading: topTableData.loading, data: topTableData.arrow?.record, unit: topTableData.unit, profileType: profileSource?.ProfileType(), isHalfScreen: isHalfScreen, metadataMappingFiles: flamegraphData.metadataMappingFiles })) : (_jsx(_Fragment, {}));
|
|
39
40
|
case 'sandwich':
|
|
@@ -4,7 +4,8 @@ interface Props {
|
|
|
4
4
|
setGroupByLabels: (labels: string[]) => void;
|
|
5
5
|
metadataRefetch?: () => Promise<void>;
|
|
6
6
|
metadataLoading: boolean;
|
|
7
|
+
label?: string;
|
|
7
8
|
}
|
|
8
|
-
declare const GroupByLabelsDropdown: ({ labels, groupBy, setGroupByLabels, metadataRefetch, metadataLoading, }: Props) => JSX.Element;
|
|
9
|
+
declare const GroupByLabelsDropdown: ({ labels, groupBy, setGroupByLabels, metadataRefetch, metadataLoading, label, }: Props) => JSX.Element;
|
|
9
10
|
export default GroupByLabelsDropdown;
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/GroupByLabelsDropdown/index.tsx"],"names":[],"mappings":"AAuBA,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,eAAe,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/GroupByLabelsDropdown/index.tsx"],"names":[],"mappings":"AAuBA,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,qBAAqB,GAAI,iFAO5B,KAAK,KAAG,GAAG,CAAC,OAiFd,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -14,8 +14,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { TEST_IDS, testId } from '@parca/test-utils';
|
|
15
15
|
import { FIELD_LABELS } from '../../../ProfileFlameGraph/FlameGraphArrow';
|
|
16
16
|
import { SelectWithRefresh } from '../../../SelectWithRefresh';
|
|
17
|
-
const GroupByLabelsDropdown = ({ labels, groupBy, setGroupByLabels, metadataRefetch, metadataLoading, }) => {
|
|
18
|
-
return (_jsxs("div", { className: "flex flex-col relative", ...testId(TEST_IDS.GROUP_BY_CONTAINER), children: [_jsx("div", { className: "flex items-center justify-between", children: _jsx("label", { className: "text-sm", ...testId(TEST_IDS.GROUP_BY_LABEL), children:
|
|
17
|
+
const GroupByLabelsDropdown = ({ labels, groupBy, setGroupByLabels, metadataRefetch, metadataLoading, label = 'Group by', }) => {
|
|
18
|
+
return (_jsxs("div", { className: "flex flex-col relative", ...testId(TEST_IDS.GROUP_BY_CONTAINER), children: [_jsx("div", { className: "flex items-center justify-between", children: _jsx("label", { className: "text-sm", ...testId(TEST_IDS.GROUP_BY_LABEL), children: label }) }), _jsx(SelectWithRefresh, { isMulti: true, defaultMenuIsOpen: false, defaultValue: undefined, name: "labels", options: labels.map(label => ({ label, value: `${FIELD_LABELS}.${label}` })), className: "parca-select-container text-sm rounded-md bg-white", classNamePrefix: "parca-select", onRefresh: metadataRefetch, refreshTitle: "Refresh label names", refreshTestId: "group-by-refresh-button", menuTestId: TEST_IDS.GROUP_BY_SELECT_FLYOUT, value: (groupBy ?? [])
|
|
19
19
|
.filter(l => l.startsWith(FIELD_LABELS))
|
|
20
20
|
.map(l => ({ value: l, label: l.slice(FIELD_LABELS.length + 1) })), onChange: newValue => {
|
|
21
21
|
setGroupByLabels(newValue.map(option => option.value));
|
|
@@ -215,7 +215,7 @@ const MultiLevelDropdown = ({ onSelect, profileType, groupBy, toggleGroupBy, isT
|
|
|
215
215
|
icon: 'ph:eye-closed',
|
|
216
216
|
},
|
|
217
217
|
];
|
|
218
|
-
return (_jsx("div", { className: "relative inline-block text-left", id: "h-visualisation-toolbar-actions", ref: dropdownRef, children: _jsx(Menu, { children: ({ open, close }) => (_jsxs(_Fragment, { children: [_jsxs(Menu.Button, { className: "flex dark:bg-gray-900 dark:border-gray-600 justify-center w-full px-4 py-2 text-sm font-normal text-gray-600 dark:text-gray-200 bg-white rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 border border-gray-200 pr-[1.7rem]", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Icon, { icon: "pajamas:preferences", className: "w-4 h-4" }), _jsx("span", { children: "Preferences" })] }), _jsx("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400", children: _jsx(Icon, { icon: "heroicons:chevron-down-20-solid", "aria-hidden": "true" }) })] }), open && (_jsx(Menu.Items, { className: cx(isTableVizOnly ? 'w-64' : 'w-80', 'absolute z-
|
|
218
|
+
return (_jsx("div", { className: "relative inline-block text-left", id: "h-visualisation-toolbar-actions", ref: dropdownRef, children: _jsx(Menu, { children: ({ open, close }) => (_jsxs(_Fragment, { children: [_jsxs(Menu.Button, { className: "flex dark:bg-gray-900 dark:border-gray-600 justify-center w-full px-4 py-2 text-sm font-normal text-gray-600 dark:text-gray-200 bg-white rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 border border-gray-200 pr-[1.7rem]", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Icon, { icon: "pajamas:preferences", className: "w-4 h-4" }), _jsx("span", { children: "Preferences" })] }), _jsx("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400", children: _jsx(Icon, { icon: "heroicons:chevron-down-20-solid", "aria-hidden": "true" }) })] }), open && (_jsx(Menu.Items, { className: cx(isTableVizOnly ? 'w-64' : 'w-80', 'absolute z-50 mt-2 py-2 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none border dark:bg-gray-900 dark:border-gray-600', shouldOpenLeft ? 'right-0 origin-top-right' : 'left-0 origin-top-left'), children: menuItems
|
|
219
219
|
.filter(item => item.hide !== undefined && !item.hide)
|
|
220
220
|
.map((item, index) => (_jsx(MenuItem, { ...item, onSelect: onSelect, closeDropdown: close, activeValueForSortBy: storeSortBy, activeValueForColorBy: colorBy === undefined || colorBy === '' ? 'binary' : colorBy, activeValuesForLevel: groupBy, renderAsDiv: item.renderAsDiv }, index))) }))] })) }) }));
|
|
221
221
|
};
|
|
@@ -19,6 +19,8 @@ export interface VisualisationToolbarProps {
|
|
|
19
19
|
preferencesModal?: boolean;
|
|
20
20
|
profileViewExternalSubActions?: React.ReactNode;
|
|
21
21
|
setGroupByLabels: (labels: string[]) => void;
|
|
22
|
+
flamechartDimension: string[];
|
|
23
|
+
setFlamechartDimension: (labels: string[]) => void;
|
|
22
24
|
showVisualizationSelector?: boolean;
|
|
23
25
|
sandwichFunctionName?: string;
|
|
24
26
|
alignFunctionName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAG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C,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAQ9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAkBxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,8BAA8B,CAmBxE,CAAC;AAMF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAkH9D,CAAC"}
|
|
@@ -20,17 +20,19 @@ export const SandwichFlameGraphToolbar = ({ resetSandwichFunctionName, sandwichF
|
|
|
20
20
|
return (_jsx(_Fragment, { children: _jsx("div", { className: "flex w-full gap-2 items-end justify-between", children: _jsx(Button, { color: "neutral", onClick: () => resetSandwichFunctionName(), className: "w-auto", variant: "neutral", disabled: sandwichFunctionName === undefined || sandwichFunctionName.length === 0, children: "Reset view" }) }) }));
|
|
21
21
|
};
|
|
22
22
|
const Divider = () => (_jsx("div", { className: "border-t mt-4 border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4" }));
|
|
23
|
-
export const VisualisationToolbar = ({ groupBy, toggleGroupBy, setGroupByLabels, profileType, profileSource, queryClient, onDownloadPProf, pprofdownloading, profileViewExternalSubActions, curPath, setNewCurPath, total, filtered, showVisualizationSelector = true, alignFunctionName, setAlignFunctionName, colorBy, setColorBy, metadata: { labels: groupByLabels, refetch: metadataRefetch, loading: metadataLoading }, }) => {
|
|
23
|
+
export const VisualisationToolbar = ({ groupBy, toggleGroupBy, setGroupByLabels, flamechartDimension, setFlamechartDimension, profileType, profileSource, queryClient, onDownloadPProf, pprofdownloading, profileViewExternalSubActions, curPath, setNewCurPath, total, filtered, showVisualizationSelector = true, alignFunctionName, setAlignFunctionName, colorBy, setColorBy, metadata: { labels: groupByLabels, refetch: metadataRefetch, loading: metadataLoading }, }) => {
|
|
24
24
|
const { dashboardItems } = useDashboard();
|
|
25
25
|
const isTableViz = dashboardItems?.includes('table');
|
|
26
26
|
const isTableVizOnly = dashboardItems?.length === 1 && isTableViz;
|
|
27
27
|
const isGraphViz = dashboardItems?.includes('flamegraph');
|
|
28
28
|
const isGraphVizOnly = dashboardItems?.length === 1 && isGraphViz;
|
|
29
|
+
const isFlamechartViz = dashboardItems?.includes('flamechart');
|
|
30
|
+
const isFlamechartVizOnly = dashboardItems?.length === 1 && isFlamechartViz;
|
|
29
31
|
const req = profileSource?.QueryRequest();
|
|
30
32
|
if (req !== null && req !== undefined) {
|
|
31
33
|
req.groupBy = {
|
|
32
34
|
fields: groupBy ?? [],
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-start gap-2", children: [_jsxs("div", { className: "flex gap-2 items-start", children: [isGraphViz && (_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading }), _jsx(InvertCallStack, {})] })), _jsxs("div", { className: "flex mt-5", children: [_jsx(ProfileFilters, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] })] }), _jsxs("div", { className: "flex gap-2 mt-5", children: [_jsx(MultiLevelDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, profileType: profileType, onSelect: () => { }, isTableVizOnly: isTableVizOnly, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), _jsx(ShareButton, { profileSource: profileSource, queryClient: queryClient, queryRequest: req, onDownloadPProf: onDownloadPProf, pprofdownloading: pprofdownloading ?? false, profileViewExternalSubActions: profileViewExternalSubActions }), showVisualizationSelector ? _jsx(ViewSelector, { profileSource: profileSource }) : null] })] }), isGraphVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(FlameGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered })] }))] }));
|
|
37
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-start gap-2", children: [_jsxs("div", { className: "flex gap-2 items-start", children: [isGraphViz && (_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading }), _jsx(InvertCallStack, {})] })), isFlamechartViz && (_jsx(GroupByDropdown, { groupBy: flamechartDimension, labels: groupByLabels, setGroupByLabels: setFlamechartDimension, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading, label: "Samples group by" })), _jsxs("div", { className: "flex mt-5", children: [!isFlamechartVizOnly && _jsx(ProfileFilters, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] })] }), _jsxs("div", { className: "flex gap-2 mt-5", children: [_jsx(MultiLevelDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, profileType: profileType, onSelect: () => { }, isTableVizOnly: isTableVizOnly, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), _jsx(ShareButton, { profileSource: profileSource, queryClient: queryClient, queryRequest: req, onDownloadPProf: onDownloadPProf, pprofdownloading: pprofdownloading ?? false, profileViewExternalSubActions: profileViewExternalSubActions }), showVisualizationSelector ? _jsx(ViewSelector, { profileSource: profileSource }) : null] })] }), isGraphVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(FlameGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered })] }))] }));
|
|
36
38
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ProfileType } from '@parca/parser';
|
|
2
|
+
/**
|
|
3
|
+
* Auto-selects the best flamechart "group by" dimension on first load.
|
|
4
|
+
*
|
|
5
|
+
* For On-GPU profiles:
|
|
6
|
+
* - Selects all available from: ['node', 'gpu', 'stream']
|
|
7
|
+
*
|
|
8
|
+
* For On-CPU profiles:
|
|
9
|
+
* - Priority: cpu > cpuid > thread > thread_id
|
|
10
|
+
* - Adds 'node' alongside the primary dimension if available
|
|
11
|
+
*
|
|
12
|
+
* For all other profile types:
|
|
13
|
+
* - No auto-selection
|
|
14
|
+
*/
|
|
15
|
+
export declare const useAutoSelectDimension: (metadataLabels: string[] | undefined, flamechartDimension: string[] | undefined, setFlamechartDimension: (v: string[]) => void, profileType?: ProfileType) => void;
|
|
16
|
+
//# sourceMappingURL=useAutoSelectDimension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutoSelectDimension.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useAutoSelectDimension.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAwB1C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GACjC,gBAAgB,MAAM,EAAE,GAAG,SAAS,EACpC,qBAAqB,MAAM,EAAE,GAAG,SAAS,EACzC,wBAAwB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAC7C,cAAc,WAAW,KACxB,IAgCF,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { useEffect, useRef } from 'react';
|
|
14
|
+
import { wellKnownProfiles } from '../../ProfileTypeSelector';
|
|
15
|
+
const CPU_PREFERRED_DIMENSIONS = ['cpu', 'cpuid', 'thread', 'thread_id'];
|
|
16
|
+
const GPU_DIMENSIONS = ['node', 'gpu', 'stream'];
|
|
17
|
+
const getWellKnownProfileName = (profileType) => {
|
|
18
|
+
if (profileType == null)
|
|
19
|
+
return undefined;
|
|
20
|
+
const key = profileType.toString();
|
|
21
|
+
return wellKnownProfiles[key]?.name;
|
|
22
|
+
};
|
|
23
|
+
const isOnGpuProfile = (profileType) => {
|
|
24
|
+
const wellKnownName = getWellKnownProfileName(profileType);
|
|
25
|
+
return wellKnownName === 'On-GPU';
|
|
26
|
+
};
|
|
27
|
+
const isOnCpuProfile = (profileType) => {
|
|
28
|
+
const wellKnownName = getWellKnownProfileName(profileType);
|
|
29
|
+
return wellKnownName === 'On-CPU';
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Auto-selects the best flamechart "group by" dimension on first load.
|
|
33
|
+
*
|
|
34
|
+
* For On-GPU profiles:
|
|
35
|
+
* - Selects all available from: ['node', 'gpu', 'stream']
|
|
36
|
+
*
|
|
37
|
+
* For On-CPU profiles:
|
|
38
|
+
* - Priority: cpu > cpuid > thread > thread_id
|
|
39
|
+
* - Adds 'node' alongside the primary dimension if available
|
|
40
|
+
*
|
|
41
|
+
* For all other profile types:
|
|
42
|
+
* - No auto-selection
|
|
43
|
+
*/
|
|
44
|
+
export const useAutoSelectDimension = (metadataLabels, flamechartDimension, setFlamechartDimension, profileType) => {
|
|
45
|
+
const hasAutoSelected = useRef(false);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (hasAutoSelected.current)
|
|
48
|
+
return;
|
|
49
|
+
if (metadataLabels == null || metadataLabels.length === 0)
|
|
50
|
+
return;
|
|
51
|
+
if ((flamechartDimension ?? []).length > 0) {
|
|
52
|
+
hasAutoSelected.current = true;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (isOnGpuProfile(profileType)) {
|
|
56
|
+
const availableGpuDims = GPU_DIMENSIONS.filter(d => metadataLabels.includes(d));
|
|
57
|
+
if (availableGpuDims.length > 0) {
|
|
58
|
+
setFlamechartDimension(availableGpuDims.map(d => `labels.${d}`));
|
|
59
|
+
hasAutoSelected.current = true;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (isOnCpuProfile(profileType)) {
|
|
64
|
+
const hasNode = metadataLabels.includes('node');
|
|
65
|
+
for (const name of CPU_PREFERRED_DIMENSIONS) {
|
|
66
|
+
if (metadataLabels.includes(name)) {
|
|
67
|
+
const dims = hasNode ? ['node', name] : [name];
|
|
68
|
+
setFlamechartDimension(dims.map(d => `labels.${d}`));
|
|
69
|
+
hasAutoSelected.current = true;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, [metadataLabels, flamechartDimension, setFlamechartDimension, profileType]);
|
|
75
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Table
|
|
1
|
+
import { Table } from '@uwdata/flechette';
|
|
2
2
|
import { FlamegraphArrow } from '@parca/client';
|
|
3
3
|
interface UseProfileMetadataProps {
|
|
4
4
|
flamegraphArrow?: FlamegraphArrow;
|
|
@@ -7,7 +7,7 @@ interface UseProfileMetadataProps {
|
|
|
7
7
|
colorBy: string;
|
|
8
8
|
}
|
|
9
9
|
export declare const useProfileMetadata: ({ flamegraphArrow, metadataMappingFiles, metadataLoading, colorBy, }: UseProfileMetadataProps) => {
|
|
10
|
-
table:
|
|
10
|
+
table: Table | null;
|
|
11
11
|
mappingsList: string[];
|
|
12
12
|
filenamesList: string[];
|
|
13
13
|
colorMappings: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProfileMetadata.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useProfileMetadata.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"useProfileMetadata.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useProfileMetadata.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,KAAK,EAAe,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAO9C,UAAU,uBAAuB;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB,GAAI,sEAKhC,uBAAuB,KAAG;IAC3B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;CAqB1B,CAAC"}
|
|
@@ -11,11 +11,15 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { useMemo } from 'react';
|
|
14
|
-
import { tableFromIPC } from '
|
|
14
|
+
import { tableFromIPC } from '@uwdata/flechette';
|
|
15
15
|
import useMappingList, { useFilenamesList, } from '../../ProfileFlameGraph/FlameGraphArrow/useMappingList';
|
|
16
|
+
import { alignedUint8Array } from '../../utils';
|
|
16
17
|
export const useProfileMetadata = ({ flamegraphArrow, metadataMappingFiles, metadataLoading, colorBy, }) => {
|
|
17
18
|
const table = useMemo(() => {
|
|
18
|
-
|
|
19
|
+
if (flamegraphArrow === undefined) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return tableFromIPC(alignedUint8Array(flamegraphArrow.record), { useBigInt: true });
|
|
19
23
|
}, [flamegraphArrow]);
|
|
20
24
|
const mappingsList = useMappingList(metadataMappingFiles);
|
|
21
25
|
const filenamesList = useFilenamesList(table);
|
|
@@ -9,6 +9,8 @@ export declare const useVisualizationState: () => {
|
|
|
9
9
|
setGroupBy: (keys: string[]) => void;
|
|
10
10
|
toggleGroupBy: (key: string) => void;
|
|
11
11
|
setGroupByLabels: (labels: string[]) => void;
|
|
12
|
+
flamechartDimension: string[];
|
|
13
|
+
setFlamechartDimension: (labels: string[]) => void;
|
|
12
14
|
sandwichFunctionName: string | undefined;
|
|
13
15
|
setSandwichFunctionName: (sandwichFunctionName: string | undefined) => void;
|
|
14
16
|
resetSandwichFunctionName: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVisualizationState.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useVisualizationState.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAC,gBAAgB,EAAC,MAAM,+CAA+C,CAAC;AAG/E,eAAO,MAAM,qBAAqB,QAAO;IACvC,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,eAAe,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IACpD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,uBAAuB,EAAE,CAAC,oBAAoB,E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-35,6 +35,9 @@ export const useVisualizationState = () => {
|
|
|
35
35
|
alwaysReturnArray: true,
|
|
36
36
|
});
|
|
37
37
|
const [sandwichFunctionName, setSandwichFunctionName] = useURLState('sandwich_function_name');
|
|
38
|
+
const [flamechartDimension, setStoreFlamechartDimension] = useURLState('flamechart_dimension', {
|
|
39
|
+
alwaysReturnArray: true,
|
|
40
|
+
});
|
|
38
41
|
const resetFlameGraphState = useResetFlameGraphState();
|
|
39
42
|
const batchUpdates = useURLStateBatch();
|
|
40
43
|
const levelsOfProfiling = useMemo(() => [
|
|
@@ -66,6 +69,9 @@ export const useVisualizationState = () => {
|
|
|
66
69
|
resetFlameGraphState();
|
|
67
70
|
});
|
|
68
71
|
}, [groupBy, setGroupBy, resetFlameGraphState, batchUpdates]);
|
|
72
|
+
const setFlamechartDimension = useCallback((labels) => {
|
|
73
|
+
setStoreFlamechartDimension(labels.filter(l => l.startsWith(`${FIELD_LABELS}.`)));
|
|
74
|
+
}, [setStoreFlamechartDimension]);
|
|
69
75
|
const resetSandwichFunctionName = useCallback(() => {
|
|
70
76
|
setSandwichFunctionName(undefined);
|
|
71
77
|
}, [setSandwichFunctionName]);
|
|
@@ -87,6 +93,8 @@ export const useVisualizationState = () => {
|
|
|
87
93
|
setGroupBy,
|
|
88
94
|
toggleGroupBy,
|
|
89
95
|
setGroupByLabels,
|
|
96
|
+
flamechartDimension,
|
|
97
|
+
setFlamechartDimension,
|
|
90
98
|
sandwichFunctionName,
|
|
91
99
|
setSandwichFunctionName,
|
|
92
100
|
resetSandwichFunctionName,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProfileViewProps } from './types/visualization';
|
|
2
|
-
export declare const ProfileView: ({ total, filtered, flamegraphData,
|
|
2
|
+
export declare const ProfileView: ({ total, filtered, flamegraphData, samplesData, topTableData, sourceData, profileSource, queryClient, onDownloadPProf, pprofDownloading, compare, showVisualizationSelector, sandwichData, onSwitchToOneMinute, }: ProfileViewProps) => JSX.Element;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileView/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileView/index.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAC,gBAAgB,EAAoB,MAAM,uBAAuB,CAAC;AAE/E,eAAO,MAAM,WAAW,GAAI,mNAezB,gBAAgB,KAAG,GAAG,CAAC,OAkJzB,CAAC"}
|
|
@@ -21,12 +21,14 @@ import { ProfileHeader } from './components/ProfileHeader';
|
|
|
21
21
|
import { FlameGraphToolbar, SandwichFlameGraphToolbar, TableToolbar, VisualisationToolbar, } from './components/Toolbars';
|
|
22
22
|
import { DashboardProvider } from './context/DashboardContext';
|
|
23
23
|
import { ProfileViewContextProvider } from './context/ProfileViewContext';
|
|
24
|
+
import { useAutoSelectDimension } from './hooks/useAutoSelectDimension';
|
|
24
25
|
import { useProfileMetadata } from './hooks/useProfileMetadata';
|
|
25
26
|
import { useVisualizationState } from './hooks/useVisualizationState';
|
|
26
|
-
export const ProfileView = ({ total, filtered, flamegraphData,
|
|
27
|
+
export const ProfileView = ({ total, filtered, flamegraphData, samplesData, topTableData, sourceData, profileSource, queryClient, onDownloadPProf, pprofDownloading, compare, showVisualizationSelector, sandwichData, onSwitchToOneMinute, }) => {
|
|
27
28
|
const { timezone, perf, profileViewExternalMainActions, preferencesModal, profileViewExternalSubActions, } = useParcaContext();
|
|
28
29
|
const { ref, dimensions } = useContainerDimensions();
|
|
29
|
-
const { curPathArrow, setCurPathArrow, colorStackLegend, colorBy, setColorBy, groupBy, toggleGroupBy, setGroupByLabels, sandwichFunctionName, resetSandwichFunctionName, alignFunctionName, setAlignFunctionName, } = useVisualizationState();
|
|
30
|
+
const { curPathArrow, setCurPathArrow, colorStackLegend, colorBy, setColorBy, groupBy, toggleGroupBy, setGroupByLabels, flamechartDimension, setFlamechartDimension, sandwichFunctionName, resetSandwichFunctionName, alignFunctionName, setAlignFunctionName, } = useVisualizationState();
|
|
31
|
+
useAutoSelectDimension(flamegraphData.metadataLabels, flamechartDimension, setFlamechartDimension, profileSource?.ProfileType());
|
|
30
32
|
const { colorMappings } = useProfileMetadata({
|
|
31
33
|
flamegraphArrow: flamegraphData.arrow,
|
|
32
34
|
metadataMappingFiles: flamegraphData.metadataMappingFiles,
|
|
@@ -43,7 +45,7 @@ export const ProfileView = ({ total, filtered, flamegraphData, flamechartData, t
|
|
|
43
45
|
isHalfScreen,
|
|
44
46
|
dimensions,
|
|
45
47
|
flamegraphData,
|
|
46
|
-
|
|
48
|
+
samplesData,
|
|
47
49
|
topTableData,
|
|
48
50
|
sourceData,
|
|
49
51
|
profileSource,
|
|
@@ -53,6 +55,7 @@ export const ProfileView = ({ total, filtered, flamegraphData, flamechartData, t
|
|
|
53
55
|
setNewCurPathArrow: setCurPathArrow,
|
|
54
56
|
perf,
|
|
55
57
|
queryClient,
|
|
58
|
+
onSwitchToOneMinute,
|
|
56
59
|
});
|
|
57
60
|
};
|
|
58
61
|
const actionButtons = {
|
|
@@ -65,5 +68,5 @@ export const ProfileView = ({ total, filtered, flamegraphData, flamechartData, t
|
|
|
65
68
|
labels: flamegraphData.metadataLabels ?? [],
|
|
66
69
|
refetch: flamegraphData.metadataRefetch,
|
|
67
70
|
loading: flamegraphData.metadataLoading,
|
|
68
|
-
}, preferencesModal: preferencesModal, profileViewExternalSubActions: profileViewExternalSubActions, setGroupByLabels: setGroupByLabels, showVisualizationSelector: showVisualizationSelector, sandwichFunctionName: sandwichFunctionName, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), isColorStackLegendEnabled && (_jsx(ColorStackLegend, { compareMode: compareMode, mappings: colorMappings, loading: flamegraphData.metadataLoading })), _jsx("div", { className: "w-full", ref: ref, children: _jsx(DashboardLayout, { getDashboardItemByType: getDashboardItemByType, actionButtons: actionButtons }) })] }) }) }));
|
|
71
|
+
}, preferencesModal: preferencesModal, profileViewExternalSubActions: profileViewExternalSubActions, setGroupByLabels: setGroupByLabels, flamechartDimension: flamechartDimension, setFlamechartDimension: setFlamechartDimension, showVisualizationSelector: showVisualizationSelector, sandwichFunctionName: sandwichFunctionName, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), isColorStackLegendEnabled && (_jsx(ColorStackLegend, { compareMode: compareMode, mappings: colorMappings, loading: flamegraphData.metadataLoading })), _jsx("div", { className: "w-full", ref: ref, children: _jsx(DashboardLayout, { getDashboardItemByType: getDashboardItemByType, actionButtons: actionButtons }) })] }) }) }));
|
|
69
72
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RpcError } from '@protobuf-ts/runtime-rpc';
|
|
2
|
-
import { FlamegraphArrow, QueryServiceClient, Source, TableArrow } from '@parca/client';
|
|
2
|
+
import { FlamegraphArrow, LabelSet, QueryServiceClient, Source, TableArrow } from '@parca/client';
|
|
3
|
+
import { DataPoint } from '../../ProfileFlameChart/SamplesStrips/SamplesGraph';
|
|
3
4
|
import { ProfileSource } from '../../ProfileSource';
|
|
4
5
|
export interface FlamegraphData {
|
|
5
6
|
loading: boolean;
|
|
@@ -29,20 +30,31 @@ export interface SandwichData {
|
|
|
29
30
|
callees: FlamegraphData;
|
|
30
31
|
callers: FlamegraphData;
|
|
31
32
|
}
|
|
33
|
+
export interface SamplesSeries {
|
|
34
|
+
labelset: LabelSet;
|
|
35
|
+
data: DataPoint[];
|
|
36
|
+
}
|
|
37
|
+
export interface SamplesData {
|
|
38
|
+
loading: boolean;
|
|
39
|
+
series?: SamplesSeries[];
|
|
40
|
+
error: RpcError | null;
|
|
41
|
+
stepMs?: number;
|
|
42
|
+
}
|
|
32
43
|
export type VisualizationType = 'flamegraph' | 'callgraph' | 'table' | 'source' | 'flamechart' | 'sandwich';
|
|
33
44
|
export interface ProfileViewProps {
|
|
34
45
|
total: bigint;
|
|
35
46
|
filtered: bigint;
|
|
36
47
|
flamegraphData: FlamegraphData;
|
|
37
|
-
|
|
48
|
+
samplesData?: SamplesData;
|
|
38
49
|
sandwichData: SandwichData;
|
|
39
50
|
topTableData?: TopTableData;
|
|
40
51
|
sourceData?: SourceData;
|
|
41
52
|
profileSource: ProfileSource;
|
|
42
|
-
queryClient
|
|
53
|
+
queryClient: QueryServiceClient;
|
|
43
54
|
compare?: boolean;
|
|
44
55
|
onDownloadPProf: () => void;
|
|
45
56
|
pprofDownloading?: boolean;
|
|
46
57
|
showVisualizationSelector?: boolean;
|
|
58
|
+
onSwitchToOneMinute?: () => void;
|
|
47
59
|
}
|
|
48
60
|
//# sourceMappingURL=visualization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visualization.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/types/visualization.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"visualization.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/types/visualization.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAEhG,OAAO,EAAC,SAAS,EAAC,MAAM,oDAAoD,CAAC;AAC7E,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,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WAAW,CAAC;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,kBAAkB,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC"}
|
|
@@ -5,7 +5,8 @@ interface ProfileViewWithDataProps {
|
|
|
5
5
|
profileSource: ProfileSource;
|
|
6
6
|
compare?: boolean;
|
|
7
7
|
showVisualizationSelector?: boolean;
|
|
8
|
+
onSwitchToOneMinute?: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const ProfileViewWithData: ({ queryClient, profileSource, showVisualizationSelector, }: ProfileViewWithDataProps) => JSX.Element;
|
|
10
|
+
export declare const ProfileViewWithData: ({ queryClient, profileSource, showVisualizationSelector, onSwitchToOneMinute, }: ProfileViewWithDataProps) => JSX.Element;
|
|
10
11
|
export default ProfileViewWithData;
|
|
11
12
|
//# sourceMappingURL=ProfileViewWithData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAkB1E,OAAO,EAAsB,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAOnE,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,mBAAmB,GAAI,iFAKjC,wBAAwB,KAAG,GAAG,CAAC,OA4UjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -13,15 +13,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { useEffect, useMemo, useState } from 'react';
|
|
15
15
|
import { QueryRequest_ReportType } from '@parca/client';
|
|
16
|
-
import { useGrpcMetadata, useParcaContext, useURLState } from '@parca/components';
|
|
16
|
+
import { NumberParser, NumberSerializer, useGrpcMetadata, useParcaContext, useURLState, useURLStateCustom, } from '@parca/components';
|
|
17
17
|
import { saveAsBlob } from '@parca/utilities';
|
|
18
18
|
import { validateFlameChartQuery } from './ProfileFlameGraph';
|
|
19
19
|
import { FIELD_FUNCTION_NAME } from './ProfileFlameGraph/FlameGraphArrow';
|
|
20
|
+
import { boundsFromProfileSource } from './ProfileFlameGraph/FlameGraphArrow/utils';
|
|
21
|
+
import { getStepCountFromScreenWidth, useQueryRange, } from './ProfileMetricsGraph/hooks/useQueryRange';
|
|
20
22
|
import { ProfileView } from './ProfileView';
|
|
21
23
|
import { useProfileFilters } from './ProfileView/components/ProfileFilters/useProfileFilters';
|
|
22
24
|
import { useQuery } from './useQuery';
|
|
23
25
|
import { downloadPprof } from './utils';
|
|
24
|
-
export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizationSelector, }) => {
|
|
26
|
+
export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizationSelector, onSwitchToOneMinute, }) => {
|
|
25
27
|
const metadata = useGrpcMetadata();
|
|
26
28
|
const [dashboardItems, setDashboardItems] = useURLState('dashboard_items', {
|
|
27
29
|
alwaysReturnArray: true,
|
|
@@ -33,6 +35,9 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
|
|
|
33
35
|
alwaysReturnArray: true,
|
|
34
36
|
});
|
|
35
37
|
const [sandwichFunctionName] = useURLState('sandwich_function_name');
|
|
38
|
+
const [flamechartDimension] = useURLState('flamechart_dimension', {
|
|
39
|
+
alwaysReturnArray: true,
|
|
40
|
+
});
|
|
36
41
|
const [invertStack] = useURLState('invert_call_stack');
|
|
37
42
|
const invertCallStack = invertStack === 'true';
|
|
38
43
|
const [pprofDownloading, setPprofDownloading] = useState(false);
|
|
@@ -71,14 +76,40 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
|
|
|
71
76
|
invertCallStack,
|
|
72
77
|
protoFilters,
|
|
73
78
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
const samplesEnabled = !!(dashboardItems.includes('flamechart') &&
|
|
80
|
+
validateFlameChartQuery(profileSource).isValid &&
|
|
81
|
+
(flamechartDimension ?? []).length > 0);
|
|
82
|
+
const [samplesFromMs, samplesToMs] = useMemo(() => {
|
|
83
|
+
const bounds = boundsFromProfileSource(profileSource);
|
|
84
|
+
return [Number(bounds[0] / 1000000n), Number(bounds[1] / 1000000n)];
|
|
85
|
+
}, [profileSource]);
|
|
86
|
+
const samplesSumBy = useMemo(() => (flamechartDimension ?? []).map(f => f.startsWith('labels.') ? f.slice('labels.'.length) : f), [flamechartDimension]);
|
|
87
|
+
// Samples step count: 2px per data point for finer granularity in strips
|
|
88
|
+
const [samplesStepCount] = useURLStateCustom('samples_step_count', {
|
|
89
|
+
defaultValue: String(getStepCountFromScreenWidth(2)),
|
|
90
|
+
parse: NumberParser,
|
|
91
|
+
stringify: NumberSerializer,
|
|
81
92
|
});
|
|
93
|
+
const { isLoading: samplesLoading, response: samplesRangeResponse, error: samplesError, stepDurationMs: samplesStepMs, } = useQueryRange(queryClient, samplesEnabled ? profileSource.query.toString() : '', samplesFromMs, samplesToMs, samplesSumBy, samplesStepCount, !samplesEnabled);
|
|
94
|
+
// Map QueryRange response to SamplesData
|
|
95
|
+
// TODO (manoj): Check if we can skip this mapping and adapt the CPUSampleStrips to work directly with the QueryRange response format.
|
|
96
|
+
const samplesData = useMemo(() => {
|
|
97
|
+
if (samplesLoading)
|
|
98
|
+
return { loading: true, error: null };
|
|
99
|
+
if (samplesError != null)
|
|
100
|
+
return { loading: false, error: samplesError };
|
|
101
|
+
if (samplesRangeResponse?.series?.length == null)
|
|
102
|
+
return { loading: false, error: null };
|
|
103
|
+
const series = samplesRangeResponse.series.map(ms => ({
|
|
104
|
+
labelset: ms.labelset ?? { labels: [] },
|
|
105
|
+
data: ms.samples.map(s => ({
|
|
106
|
+
timestamp: Number(s.timestamp.seconds) * 1000 + Math.floor(s.timestamp.nanos / 1000000),
|
|
107
|
+
value: Number(s.value),
|
|
108
|
+
sampleCount: Number(s.count),
|
|
109
|
+
})),
|
|
110
|
+
}));
|
|
111
|
+
return { loading: false, series, error: null, stepMs: samplesStepMs };
|
|
112
|
+
}, [samplesLoading, samplesRangeResponse, samplesError, samplesStepMs]);
|
|
82
113
|
const { isLoading: profileMetadataLoading, response: profileMetadataResponse, error: profileMetadataError, refetch: metadataRefetch, } = useQuery(queryClient, profileSource, QueryRequest_ReportType.PROFILE_METADATA, {
|
|
83
114
|
nodeTrimThreshold,
|
|
84
115
|
groupBy,
|
|
@@ -165,10 +196,6 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
|
|
|
165
196
|
total = BigInt(sourceResponse.total);
|
|
166
197
|
filtered = BigInt(sourceResponse.filtered);
|
|
167
198
|
}
|
|
168
|
-
else if (flamechartResponse !== null) {
|
|
169
|
-
total = BigInt(flamechartResponse.total);
|
|
170
|
-
filtered = BigInt(flamechartResponse.filtered);
|
|
171
|
-
}
|
|
172
199
|
else if (callersFlamegraphResponse !== null) {
|
|
173
200
|
total = BigInt(callersFlamegraphResponse.total);
|
|
174
201
|
filtered = BigInt(callersFlamegraphResponse.filtered);
|
|
@@ -193,21 +220,6 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
|
|
|
193
220
|
: undefined,
|
|
194
221
|
metadataLoading: profileMetadataLoading,
|
|
195
222
|
metadataRefetch,
|
|
196
|
-
}, flamechartData: {
|
|
197
|
-
loading: flamechartLoading && profileMetadataLoading,
|
|
198
|
-
arrow: flamechartResponse?.report.oneofKind === 'flamegraphArrow'
|
|
199
|
-
? flamechartResponse?.report?.flamegraphArrow
|
|
200
|
-
: undefined,
|
|
201
|
-
total: BigInt(flamechartResponse?.total ?? '0'),
|
|
202
|
-
filtered: BigInt(flamechartResponse?.filtered ?? '0'),
|
|
203
|
-
error: flamechartError,
|
|
204
|
-
metadataMappingFiles: profileMetadataResponse?.report.oneofKind === 'profileMetadata'
|
|
205
|
-
? profileMetadataResponse?.report?.profileMetadata?.mappingFiles
|
|
206
|
-
: undefined,
|
|
207
|
-
metadataLabels: profileMetadataResponse?.report.oneofKind === 'profileMetadata'
|
|
208
|
-
? profileMetadataResponse?.report?.profileMetadata?.labels
|
|
209
|
-
: undefined,
|
|
210
|
-
metadataLoading: profileMetadataLoading,
|
|
211
223
|
}, topTableData: {
|
|
212
224
|
loading: tableLoading,
|
|
213
225
|
arrow: tableResponse?.report.oneofKind === 'tableArrow'
|
|
@@ -250,6 +262,6 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
|
|
|
250
262
|
: undefined,
|
|
251
263
|
metadataLoading: profileMetadataLoading,
|
|
252
264
|
},
|
|
253
|
-
}, profileSource: profileSource, queryClient: queryClient, onDownloadPProf: () => void downloadPProfClick(), pprofDownloading: pprofDownloading, showVisualizationSelector: showVisualizationSelector }));
|
|
265
|
+
}, samplesData: samplesData, profileSource: profileSource, queryClient: queryClient, onDownloadPProf: () => void downloadPProfClick(), pprofDownloading: pprofDownloading, showVisualizationSelector: showVisualizationSelector, onSwitchToOneMinute: onSwitchToOneMinute }));
|
|
254
266
|
};
|
|
255
267
|
export default ProfileViewWithData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallersSection.d.ts","sourceRoot":"","sources":["../../../src/Sandwich/components/CallersSection.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgB,MAAM,OAAO,CAAC;AASrC,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAC,cAAc,EAAC,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"CallersSection.d.ts","sourceRoot":"","sources":["../../../src/Sandwich/components/CallersSection.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgB,MAAM,OAAO,CAAC;AASrC,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAC,cAAc,EAAC,MAAM,uCAAuC,CAAC;AAgBrE,UAAU,mBAAmB;IAC3B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,qBAAqB,EAAE,cAAc,CAAC;IACtC,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,eAAe,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,UAAU,EACV,aAAa,EACb,gBAAgB,GACjB,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAuEnC"}
|