@parca/profile 0.19.135 → 0.19.137
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/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/SamplesStrips/index.js +1 -1
- package/dist/ProfileFlameChart/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/index.js +5 -1
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +3 -2
- package/dist/TimelineGuide/index.d.ts +2 -1
- package/dist/TimelineGuide/index.d.ts.map +1 -1
- package/dist/TimelineGuide/index.js +2 -2
- package/package.json +3 -3
- package/src/ProfileFlameChart/SamplesStrips/index.tsx +1 -0
- package/src/ProfileFlameChart/index.tsx +10 -1
- package/src/ProfileView/components/Toolbars/index.tsx +4 -2
- package/src/TimelineGuide/index.tsx +3 -1
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.19.137 (2026-03-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.19.136](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.135...@parca/profile@0.19.136) (2026-03-12)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## 0.19.135 (2026-03-12)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ProfileFlameChart/SamplesStrips/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAIvC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AM,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAmID,eAAO,MAAM,YAAY,GAAI,yFAS1B,KAAK,KAAG,GAAG,CAAC,OAyKd,CAAC"}
|
|
@@ -148,7 +148,7 @@ export const SamplesStrip = ({ loading, cpus, data, selectedTimeframe, onSelecte
|
|
|
148
148
|
return (_jsxs("div", { ref: containerRef, className: cx('flex flex-col gap-1 relative my-0', {
|
|
149
149
|
'cursor-ew-resize': isDragging,
|
|
150
150
|
'animate-pulse pointer-events-none': effectiveLoading,
|
|
151
|
-
}), style: { width: width ?? '100%' }, onMouseMove: effectiveLoading ? undefined : handleMouseMove, onMouseUp: effectiveLoading ? undefined : handleMouseUp, onMouseLeave: effectiveLoading ? undefined : handleMouseLeave, children: [_jsx(TimelineGuide, { bounds: [BigInt(0), BigInt(bounds[1] - bounds[0])], width: width ?? 1468, height: getTimelineGuideHeight(visibleItems.length, [...collapsedLabels].filter(l => visibleItems.some(item => item.label === l)).length), margin: 1 }), visibleItems.map((item, i) => {
|
|
151
|
+
}), style: { width: width ?? '100%' }, onMouseMove: effectiveLoading ? undefined : handleMouseMove, onMouseUp: effectiveLoading ? undefined : handleMouseUp, onMouseLeave: effectiveLoading ? undefined : handleMouseLeave, children: [_jsx(TimelineGuide, { bounds: [BigInt(0), BigInt(bounds[1] - bounds[0])], width: width ?? 1468, height: getTimelineGuideHeight(visibleItems.length, [...collapsedLabels].filter(l => visibleItems.some(item => item.label === l)).length), margin: 1, elevateGuideLines: true }), visibleItems.map((item, i) => {
|
|
152
152
|
const isCollapsed = collapsedLabels.has(item.label);
|
|
153
153
|
const isSelected = isEqual(item.cpu, selectedTimeframe?.labels);
|
|
154
154
|
return (_jsx(SamplesGraphContainer, { isSelected: isSelected, isCollapsed: isCollapsed, label: item.label, width: width, data: item.data, onToggleCollapse: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileFlameChart/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAoC,kBAAkB,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileFlameChart/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAoC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAOpF,OAAO,EAAwB,WAAW,EAAQ,MAAM,eAAe,CAAC;AAKxE,OAAO,EAAsB,aAAa,EAAa,MAAM,kBAAkB,CAAC;AAEhF,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oCAAoC,CAAC;AA4CpE,UAAU,sBAAsB;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA+BD,eAAO,MAAM,iBAAiB,GAAI,wIAW/B,sBAAsB,KAAG,GAAG,CAAC,OAmL/B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -13,12 +13,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { useEffect, useMemo, useRef } from 'react';
|
|
15
15
|
import { QueryRequest_ReportType } from '@parca/client';
|
|
16
|
-
import { useURLState, useURLStateCustom } from '@parca/components';
|
|
16
|
+
import { useParcaContext, useURLState, useURLStateCustom, } from '@parca/components';
|
|
17
17
|
import { Matcher, MatcherTypes, Query } from '@parca/parser';
|
|
18
18
|
import { TimeUnits, formatDate, formatDuration } from '@parca/utilities';
|
|
19
19
|
import ProfileFlameGraph, { validateFlameChartQuery } from '../ProfileFlameGraph';
|
|
20
20
|
import { boundsFromProfileSource } from '../ProfileFlameGraph/FlameGraphArrow/utils';
|
|
21
21
|
import { MergedProfileSource, timeFormat } from '../ProfileSource';
|
|
22
|
+
import { useProfileFilters } from '../ProfileView/components/ProfileFilters/useProfileFilters';
|
|
22
23
|
import { useQuery } from '../useQuery';
|
|
23
24
|
import { SamplesStrip } from './SamplesStrips';
|
|
24
25
|
const TimeframeStateSerializer = {
|
|
@@ -71,6 +72,8 @@ const createFilteredProfileSource = (profileSource, selectedTimeframe) => {
|
|
|
71
72
|
return new MergedProfileSource(mergeFrom, mergeTo, query);
|
|
72
73
|
};
|
|
73
74
|
export const ProfileFlameChart = ({ samplesData, queryClient, profileSource, width, total, filtered, profileType, isHalfScreen, metadataMappingFiles, metadataLoading, }) => {
|
|
75
|
+
const { enableFlamechartFiltering } = useParcaContext();
|
|
76
|
+
const { protoFilters } = useProfileFilters();
|
|
74
77
|
const zoomControlsRef = useRef(null);
|
|
75
78
|
const [selectedTimeframe, setSelectedTimeframe] = useURLStateCustom('flamechart_timeframe', TimeframeStateSerializer);
|
|
76
79
|
// Read flamechart dimension from URL state to detect changes
|
|
@@ -113,6 +116,7 @@ export const ProfileFlameChart = ({ samplesData, queryClient, profileSource, wid
|
|
|
113
116
|
// Query flamechart data only when a strip selection exists
|
|
114
117
|
const { isLoading: flamechartLoading, response: flamechartResponse, error: flamechartError, } = useQuery(queryClient, filteredProfileSource ?? profileSource, QueryRequest_ReportType.FLAMECHART, {
|
|
115
118
|
skip: selectedTimeframe == null || filteredProfileSource == null,
|
|
119
|
+
...(enableFlamechartFiltering === true ? { protoFilters } : {}),
|
|
116
120
|
});
|
|
117
121
|
const flamechartArrow = flamechartResponse?.report.oneofKind === 'flamegraphArrow'
|
|
118
122
|
? flamechartResponse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C,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,8BAA8B;IAC7C,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,CAoH9D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Icon } from '@iconify/react';
|
|
3
|
-
import { Button } from '@parca/components';
|
|
3
|
+
import { Button, useParcaContext } from '@parca/components';
|
|
4
4
|
import { TEST_IDS, testId } from '@parca/test-utils';
|
|
5
5
|
import { useDashboard } from '../../context/DashboardContext';
|
|
6
6
|
import GroupByDropdown from '../ActionButtons/GroupByDropdown';
|
|
@@ -28,11 +28,12 @@ export const VisualisationToolbar = ({ groupBy, toggleGroupBy, setGroupByLabels,
|
|
|
28
28
|
const isGraphVizOnly = dashboardItems?.length === 1 && isGraphViz;
|
|
29
29
|
const isFlamechartViz = dashboardItems?.includes('flamechart');
|
|
30
30
|
const isFlamechartVizOnly = dashboardItems?.length === 1 && isFlamechartViz;
|
|
31
|
+
const { enableFlamechartFiltering } = useParcaContext();
|
|
31
32
|
const req = profileSource?.QueryRequest();
|
|
32
33
|
if (req !== null && req !== undefined) {
|
|
33
34
|
req.groupBy = {
|
|
34
35
|
fields: groupBy ?? [],
|
|
35
36
|
};
|
|
36
37
|
}
|
|
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 })] }))] }));
|
|
38
|
+
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 || enableFlamechartFiltering === true) && _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 })] }))] }));
|
|
38
39
|
};
|
|
@@ -6,7 +6,8 @@ interface Props {
|
|
|
6
6
|
bounds: BigIntDuo;
|
|
7
7
|
ticks?: number;
|
|
8
8
|
timeUnit?: string;
|
|
9
|
+
elevateGuideLines?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare const TimelineGuide: ({ bounds, width, height, margin, ticks, timeUnit, }: Props) => JSX.Element;
|
|
11
|
+
export declare const TimelineGuide: ({ bounds, width, height, margin, ticks, timeUnit, elevateGuideLines, }: Props) => JSX.Element;
|
|
11
12
|
export {};
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimelineGuide/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAEnC,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimelineGuide/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAEnC,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAaD,eAAO,MAAM,aAAa,GAAI,wEAQ3B,KAAK,KAAG,GAAG,CAAC,OA2Dd,CAAC"}
|
|
@@ -22,9 +22,9 @@ const alignBeforeAxisCorrection = (val) => {
|
|
|
22
22
|
}
|
|
23
23
|
return 0;
|
|
24
24
|
};
|
|
25
|
-
export const TimelineGuide = ({ bounds, width, height, margin, ticks, timeUnit = 'milliseconds', }) => {
|
|
25
|
+
export const TimelineGuide = ({ bounds, width, height, margin, ticks, timeUnit = 'milliseconds', elevateGuideLines = false, }) => {
|
|
26
26
|
const xScale = scaleLinear(bounds, [0, width]);
|
|
27
|
-
return (_jsx("div", { className:
|
|
27
|
+
return (_jsx("div", { className: `relative h-5${elevateGuideLines ? ' z-40' : ''}`, children: _jsx("div", { className: "pointer-events-none absolute", style: { width, height }, children: _jsx("svg", { style: { width: '100%', height: '100%' }, children: _jsxs("g", { className: "x axis", fill: "none", fontSize: "10", textAnchor: "middle", transform: `translate(0,${height - margin})`, children: [xScale.ticks(ticks).map((d, i) => {
|
|
28
28
|
return (_jsxs(Fragment, { children: [_jsx("g", { className: "tick",
|
|
29
29
|
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
|
|
30
30
|
transform: `translate(${xScale(d) + alignBeforeAxisCorrection(d)}, ${-height})`, children: _jsx("text", { fill: "currentColor", dy: ".71em", y: 9, children: valueFormatter(d - bounds[0], timeUnit, 2, true).toString() }) }, `tick-${i}`), _jsx("g", { children: _jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x1: xScale(d), x2: xScale(d), y1: 0, y2: -height + margin }) }, `grid-${i}`)] }, `${i.toString()}-${d.toString()}`));
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.137",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@floating-ui/react": "^0.27.12",
|
|
7
7
|
"@headlessui/react": "^1.7.19",
|
|
8
8
|
"@iconify/react": "^4.0.0",
|
|
9
9
|
"@parca/client": "0.17.20",
|
|
10
|
-
"@parca/components": "0.16.
|
|
10
|
+
"@parca/components": "0.16.410",
|
|
11
11
|
"@parca/dynamicsize": "0.16.73",
|
|
12
12
|
"@parca/hooks": "0.0.121",
|
|
13
13
|
"@parca/icons": "0.16.80",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"access": "public",
|
|
89
89
|
"registry": "https://registry.npmjs.org/"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "9b98bd254e8f8c53bf0a57786acba9931d30ddc7"
|
|
92
92
|
}
|
|
@@ -311,6 +311,7 @@ export const SamplesStrip = ({
|
|
|
311
311
|
[...collapsedLabels].filter(l => visibleItems.some(item => item.label === l)).length
|
|
312
312
|
)}
|
|
313
313
|
margin={1}
|
|
314
|
+
elevateGuideLines
|
|
314
315
|
/>
|
|
315
316
|
{visibleItems.map((item, i) => {
|
|
316
317
|
const isCollapsed = collapsedLabels.has(item.label);
|
|
@@ -14,13 +14,19 @@
|
|
|
14
14
|
import {useEffect, useMemo, useRef} from 'react';
|
|
15
15
|
|
|
16
16
|
import {LabelSet, QueryRequest_ReportType, QueryServiceClient} from '@parca/client';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
useParcaContext,
|
|
19
|
+
useURLState,
|
|
20
|
+
useURLStateCustom,
|
|
21
|
+
type OptionsCustom,
|
|
22
|
+
} from '@parca/components';
|
|
18
23
|
import {Matcher, MatcherTypes, ProfileType, Query} from '@parca/parser';
|
|
19
24
|
import {TimeUnits, formatDate, formatDuration} from '@parca/utilities';
|
|
20
25
|
|
|
21
26
|
import ProfileFlameGraph, {validateFlameChartQuery} from '../ProfileFlameGraph';
|
|
22
27
|
import {boundsFromProfileSource} from '../ProfileFlameGraph/FlameGraphArrow/utils';
|
|
23
28
|
import {MergedProfileSource, ProfileSource, timeFormat} from '../ProfileSource';
|
|
29
|
+
import {useProfileFilters} from '../ProfileView/components/ProfileFilters/useProfileFilters';
|
|
24
30
|
import type {SamplesData} from '../ProfileView/types/visualization';
|
|
25
31
|
import {useQuery} from '../useQuery';
|
|
26
32
|
import {NumberDuo} from '../utils';
|
|
@@ -119,6 +125,8 @@ export const ProfileFlameChart = ({
|
|
|
119
125
|
metadataMappingFiles,
|
|
120
126
|
metadataLoading,
|
|
121
127
|
}: ProfileFlameChartProps): JSX.Element => {
|
|
128
|
+
const {enableFlamechartFiltering} = useParcaContext();
|
|
129
|
+
const {protoFilters} = useProfileFilters();
|
|
122
130
|
const zoomControlsRef = useRef<HTMLDivElement>(null);
|
|
123
131
|
|
|
124
132
|
const [selectedTimeframe, setSelectedTimeframe] = useURLStateCustom<
|
|
@@ -176,6 +184,7 @@ export const ProfileFlameChart = ({
|
|
|
176
184
|
QueryRequest_ReportType.FLAMECHART,
|
|
177
185
|
{
|
|
178
186
|
skip: selectedTimeframe == null || filteredProfileSource == null,
|
|
187
|
+
...(enableFlamechartFiltering === true ? {protoFilters} : {}),
|
|
179
188
|
}
|
|
180
189
|
);
|
|
181
190
|
|
|
@@ -16,7 +16,7 @@ import {FC} from 'react';
|
|
|
16
16
|
import {Icon} from '@iconify/react';
|
|
17
17
|
|
|
18
18
|
import {QueryServiceClient} from '@parca/client';
|
|
19
|
-
import {Button} from '@parca/components';
|
|
19
|
+
import {Button, useParcaContext} from '@parca/components';
|
|
20
20
|
import {ProfileType} from '@parca/parser';
|
|
21
21
|
import {TEST_IDS, testId} from '@parca/test-utils';
|
|
22
22
|
|
|
@@ -165,6 +165,8 @@ export const VisualisationToolbar: FC<VisualisationToolbarProps> = ({
|
|
|
165
165
|
const isFlamechartViz = dashboardItems?.includes('flamechart');
|
|
166
166
|
const isFlamechartVizOnly = dashboardItems?.length === 1 && isFlamechartViz;
|
|
167
167
|
|
|
168
|
+
const {enableFlamechartFiltering} = useParcaContext();
|
|
169
|
+
|
|
168
170
|
const req = profileSource?.QueryRequest();
|
|
169
171
|
if (req !== null && req !== undefined) {
|
|
170
172
|
req.groupBy = {
|
|
@@ -202,7 +204,7 @@ export const VisualisationToolbar: FC<VisualisationToolbarProps> = ({
|
|
|
202
204
|
)}
|
|
203
205
|
|
|
204
206
|
<div className="flex mt-5">
|
|
205
|
-
{!isFlamechartVizOnly && <ProfileFilters />}
|
|
207
|
+
{(!isFlamechartVizOnly || enableFlamechartFiltering === true) && <ProfileFilters />}
|
|
206
208
|
|
|
207
209
|
{profileViewExternalSubActions != null ? profileViewExternalSubActions : null}
|
|
208
210
|
</div>
|
|
@@ -24,6 +24,7 @@ interface Props {
|
|
|
24
24
|
bounds: BigIntDuo;
|
|
25
25
|
ticks?: number;
|
|
26
26
|
timeUnit?: string;
|
|
27
|
+
elevateGuideLines?: boolean;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
const alignBeforeAxisCorrection = (val: bigint): number => {
|
|
@@ -44,11 +45,12 @@ export const TimelineGuide = ({
|
|
|
44
45
|
margin,
|
|
45
46
|
ticks,
|
|
46
47
|
timeUnit = 'milliseconds',
|
|
48
|
+
elevateGuideLines = false,
|
|
47
49
|
}: Props): JSX.Element => {
|
|
48
50
|
const xScale = scaleLinear(bounds, [0, width]);
|
|
49
51
|
|
|
50
52
|
return (
|
|
51
|
-
<div className=
|
|
53
|
+
<div className={`relative h-5${elevateGuideLines ? ' z-40' : ''}`}>
|
|
52
54
|
<div className="pointer-events-none absolute" style={{width, height}}>
|
|
53
55
|
<svg style={{width: '100%', height: '100%'}}>
|
|
54
56
|
<g
|