@parca/profile 0.18.0 → 0.18.1
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 +4 -0
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.d.ts +9 -1
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.js +12 -9
- package/dist/MetricsGraph/UtilizationMetrics/index.d.ts +9 -1
- package/dist/MetricsGraph/UtilizationMetrics/index.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/index.js +12 -9
- package/dist/ProfileSelector/MetricsGraphSection.d.ts +5 -1
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +3 -3
- package/dist/ProfileSelector/index.d.ts +5 -1
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +2 -2
- package/package.json +2 -2
- package/src/MetricsGraph/UtilizationMetrics/Throughput.tsx +20 -11
- package/src/MetricsGraph/UtilizationMetrics/index.tsx +20 -11
- package/src/ProfileSelector/MetricsGraphSection.tsx +6 -0
- package/src/ProfileSelector/index.tsx +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.18.1](https://github.com/parca-dev/parca/compare/@parca/profile@0.18.0...@parca/profile@0.18.1) (2025-06-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
# [0.18.0](https://github.com/parca-dev/parca/compare/@parca/profile@0.17.11...@parca/profile@0.18.0) (2025-06-16)
|
|
7
11
|
|
|
8
12
|
### Features
|
|
@@ -15,10 +15,18 @@ interface CommonProps {
|
|
|
15
15
|
humanReadableName: string;
|
|
16
16
|
from: number;
|
|
17
17
|
to: number;
|
|
18
|
+
selectedSeries?: Array<{
|
|
19
|
+
key: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}>;
|
|
22
|
+
onSelectedSeriesChange?: (series: Array<{
|
|
23
|
+
key: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}>) => void;
|
|
18
26
|
}
|
|
19
27
|
type Props = CommonProps & {
|
|
20
28
|
utilizationMetricsLoading?: boolean;
|
|
21
29
|
};
|
|
22
|
-
declare const AreaChart: ({ transmitData, receiveData, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, }: Props) => JSX.Element;
|
|
30
|
+
declare const AreaChart: ({ transmitData, receiveData, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, selectedSeries, onSelectedSeriesChange, }: Props) => JSX.Element;
|
|
23
31
|
export default AreaChart;
|
|
24
32
|
//# sourceMappingURL=Throughput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Throughput.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/UtilizationMetrics/Throughput.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,aAAa,EAAqD,MAAM,mBAAmB,CAAC;AAIpG,OAAO,EAAC,KAAK,kBAAkB,IAAI,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAkB9E,UAAU,WAAW;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,eAAe,EAAE,CACf,MAAM,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,GAAG,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KACvE,IAAI,CAAC;IACV,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,IAAI,EA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C,OAmCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -49,7 +49,7 @@ function transformToSeries(data, isReceive = false) {
|
|
|
49
49
|
values: series.values.sort((a, b) => a[0] - b[0]),
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
52
|
-
const RawAreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange, width, height, margin, humanReadableName, from, to, }) => {
|
|
52
|
+
const RawAreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange, width, height, margin, humanReadableName, from, to, selectedSeries, onSelectedSeriesChange, }) => {
|
|
53
53
|
const { timezone } = useParcaContext();
|
|
54
54
|
const graph = useRef(null);
|
|
55
55
|
const [dragging, setDragging] = useState(false);
|
|
@@ -58,13 +58,16 @@ const RawAreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange
|
|
|
58
58
|
const [pos, setPos] = useState([0, 0]);
|
|
59
59
|
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
60
60
|
const idForContextMenu = useId();
|
|
61
|
-
const [selectedSeries, setSelectedSeries] = useURLState('selectedSeries');
|
|
62
61
|
const [_, setSelectedTimeframe] = useURLState('gpu_selected_timeframe');
|
|
63
62
|
const parsedSelectedSeries = useMemo(() => {
|
|
64
|
-
if (selectedSeries ===
|
|
63
|
+
if (selectedSeries == null || selectedSeries.length === 0) {
|
|
65
64
|
return [];
|
|
66
65
|
}
|
|
67
|
-
return
|
|
66
|
+
return selectedSeries.map(s => ({
|
|
67
|
+
key: s.key,
|
|
68
|
+
value: s.value,
|
|
69
|
+
matcherType: '=',
|
|
70
|
+
}));
|
|
68
71
|
}, [selectedSeries]);
|
|
69
72
|
const lineStroke = '1px';
|
|
70
73
|
const lineStrokeHover = '2px';
|
|
@@ -231,19 +234,19 @@ const RawAreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange
|
|
|
231
234
|
: hovering && highlighted != null && i === highlighted.seriesIndex
|
|
232
235
|
? lineStrokeHover
|
|
233
236
|
: lineStroke, strokeOpacity: isSelected ? 1 : 0.8, onClick: () => {
|
|
234
|
-
if (highlighted != null) {
|
|
235
|
-
|
|
237
|
+
if (highlighted != null && onSelectedSeriesChange != null) {
|
|
238
|
+
onSelectedSeriesChange(highlighted.labels.map(l => ({
|
|
236
239
|
key: l.name,
|
|
237
240
|
value: l.value,
|
|
238
|
-
})))
|
|
241
|
+
})));
|
|
239
242
|
setSelectedTimeframe(undefined);
|
|
240
243
|
}
|
|
241
244
|
} }) }, i));
|
|
242
245
|
})] })] })] }) })] }));
|
|
243
246
|
};
|
|
244
|
-
const AreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, }) => {
|
|
247
|
+
const AreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, selectedSeries, onSelectedSeriesChange, }) => {
|
|
245
248
|
const { isDarkMode } = useParcaContext();
|
|
246
249
|
const { width, height, margin, heightStyle } = useMetricsGraphDimensions(false, true);
|
|
247
|
-
return (_jsx(AnimatePresence, { children: _jsx(motion.div, { className: "w-full relative", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: utilizationMetricsLoading === true ? (_jsx(MetricsGraphSkeleton, { heightStyle: heightStyle, isDarkMode: isDarkMode, isMini: true })) : (_jsx(RawAreaChart, { transmitData: transmitData, receiveData: receiveData, addLabelMatcher: addLabelMatcher, setTimeRange: setTimeRange, width: width, height: height, margin: margin, name: name, humanReadableName: humanReadableName, from: from, to: to })) }, "area-chart-graph-loaded") }));
|
|
250
|
+
return (_jsx(AnimatePresence, { children: _jsx(motion.div, { className: "w-full relative", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: utilizationMetricsLoading === true ? (_jsx(MetricsGraphSkeleton, { heightStyle: heightStyle, isDarkMode: isDarkMode, isMini: true })) : (_jsx(RawAreaChart, { transmitData: transmitData, receiveData: receiveData, addLabelMatcher: addLabelMatcher, setTimeRange: setTimeRange, width: width, height: height, margin: margin, name: name, humanReadableName: humanReadableName, from: from, to: to, selectedSeries: selectedSeries, onSelectedSeriesChange: onSelectedSeriesChange })) }, "area-chart-graph-loaded") }));
|
|
248
251
|
};
|
|
249
252
|
export default AreaChart;
|
|
@@ -14,6 +14,14 @@ interface CommonProps {
|
|
|
14
14
|
humanReadableName: string;
|
|
15
15
|
from: number;
|
|
16
16
|
to: number;
|
|
17
|
+
selectedSeries?: Array<{
|
|
18
|
+
key: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}>;
|
|
21
|
+
onSelectedSeriesChange?: (series: Array<{
|
|
22
|
+
key: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}>) => void;
|
|
17
25
|
}
|
|
18
26
|
type Props = CommonProps & {
|
|
19
27
|
data: MetricSeries[];
|
|
@@ -27,6 +35,6 @@ type Props = CommonProps & {
|
|
|
27
35
|
setTimeRange: (range: DateTimeRange) => void;
|
|
28
36
|
utilizationMetricsLoading?: boolean;
|
|
29
37
|
};
|
|
30
|
-
declare const UtilizationMetrics: ({ data, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, }: Props) => JSX.Element;
|
|
38
|
+
declare const UtilizationMetrics: ({ data, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, selectedSeries, onSelectedSeriesChange, }: Props) => JSX.Element;
|
|
31
39
|
export default UtilizationMetrics;
|
|
32
40
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/UtilizationMetrics/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,aAAa,EAAqD,MAAM,mBAAmB,CAAC;AAKpG,OAAO,EAAC,KAAK,kBAAkB,IAAI,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAO9E,UAAU,WAAW;IACnB,IAA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,MAAM,EAAE,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KAAK,IAAI,CAAC;CAChF;AAQD,KAAK,KAAK,GAAG,WAAW,GAAG;IACzB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,eAAe,EAAE,CACf,MAAM,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,GAAG,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KACvE,IAAI,CAAC;IACV,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AA2dF,QAAA,MAAM,kBAAkB,mJAWrB,KAAK,KAAG,GAAG,CAAC,OAkCd,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -59,7 +59,7 @@ const getYAxisUnit = (name) => {
|
|
|
59
59
|
return 'percent';
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, height, margin, name, humanReadableName, from, to, }) => {
|
|
62
|
+
const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, height, margin, name, humanReadableName, from, to, selectedSeries, onSelectedSeriesChange, }) => {
|
|
63
63
|
const { timezone } = useParcaContext();
|
|
64
64
|
const graph = useRef(null);
|
|
65
65
|
const [dragging, setDragging] = useState(false);
|
|
@@ -68,13 +68,16 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
|
|
|
68
68
|
const [pos, setPos] = useState([0, 0]);
|
|
69
69
|
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
70
70
|
const idForContextMenu = useId();
|
|
71
|
-
const [selectedSeries, setSelectedSeries] = useURLState('selectedSeries');
|
|
72
71
|
const [_, setSelectedTimeframe] = useURLState('gpu_selected_timeframe');
|
|
73
72
|
const parsedSelectedSeries = useMemo(() => {
|
|
74
|
-
if (selectedSeries ===
|
|
73
|
+
if (selectedSeries == null || selectedSeries.length === 0) {
|
|
75
74
|
return [];
|
|
76
75
|
}
|
|
77
|
-
return
|
|
76
|
+
return selectedSeries.map(s => ({
|
|
77
|
+
key: s.key,
|
|
78
|
+
value: s.value,
|
|
79
|
+
matcherType: '=',
|
|
80
|
+
}));
|
|
78
81
|
}, [selectedSeries]);
|
|
79
82
|
const lineStroke = '1px';
|
|
80
83
|
const lineStrokeHover = '2px';
|
|
@@ -236,20 +239,20 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
|
|
|
236
239
|
: hovering && highlighted != null && i === highlighted.seriesIndex
|
|
237
240
|
? lineStrokeHover
|
|
238
241
|
: lineStroke, strokeDasharray: strokeDasharray, xScale: xScale, yScale: yScale, onClick: () => {
|
|
239
|
-
if (highlighted != null) {
|
|
240
|
-
|
|
242
|
+
if (highlighted != null && onSelectedSeriesChange != null) {
|
|
243
|
+
onSelectedSeriesChange(highlighted.labels.map(l => ({
|
|
241
244
|
key: l.name,
|
|
242
245
|
value: l.value,
|
|
243
|
-
})))
|
|
246
|
+
})));
|
|
244
247
|
// reset the selected_timeframe
|
|
245
248
|
setSelectedTimeframe(undefined);
|
|
246
249
|
}
|
|
247
250
|
} }) }, i));
|
|
248
251
|
}) })] })] }) })] }));
|
|
249
252
|
};
|
|
250
|
-
const UtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, }) => {
|
|
253
|
+
const UtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, selectedSeries, onSelectedSeriesChange, }) => {
|
|
251
254
|
const { isDarkMode } = useParcaContext();
|
|
252
255
|
const { width, height, margin, heightStyle } = useMetricsGraphDimensions(false, true);
|
|
253
|
-
return (_jsx(AnimatePresence, { children: _jsx(motion.div, { className: "w-full relative", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: utilizationMetricsLoading === true ? (_jsx(MetricsGraphSkeleton, { heightStyle: heightStyle, isDarkMode: isDarkMode, isMini: true })) : (_jsx(RawUtilizationMetrics, { data: data, addLabelMatcher: addLabelMatcher, setTimeRange: setTimeRange, width: width, height: height, margin: margin, name: name, humanReadableName: humanReadableName, from: from, to: to })) }, "utilization-metrics-graph-loaded") }));
|
|
256
|
+
return (_jsx(AnimatePresence, { children: _jsx(motion.div, { className: "w-full relative", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: utilizationMetricsLoading === true ? (_jsx(MetricsGraphSkeleton, { heightStyle: heightStyle, isDarkMode: isDarkMode, isMini: true })) : (_jsx(RawUtilizationMetrics, { data: data, addLabelMatcher: addLabelMatcher, setTimeRange: setTimeRange, width: width, height: height, margin: margin, name: name, humanReadableName: humanReadableName, from: from, to: to, selectedSeries: selectedSeries, onSelectedSeriesChange: onSelectedSeriesChange })) }, "utilization-metrics-graph-loaded") }));
|
|
254
257
|
};
|
|
255
258
|
export default UtilizationMetrics;
|
|
@@ -26,7 +26,11 @@ interface MetricsGraphSectionProps {
|
|
|
26
26
|
data: UtilizationMetricsType[];
|
|
27
27
|
}>;
|
|
28
28
|
utilizationMetricsLoading?: boolean;
|
|
29
|
+
onUtilizationSeriesSelect?: (series: Array<{
|
|
30
|
+
key: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}>) => void;
|
|
29
33
|
}
|
|
30
|
-
export declare function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGraphButton, heightStyle, querySelection, profileSelection, comparing, sumBy, defaultSumByLoading, queryClient, queryExpressionString, setTimeRangeSelection, selectQuery, selectProfile, query, setNewQueryExpression, utilizationMetrics, utilizationMetricsLoading, }: MetricsGraphSectionProps): JSX.Element;
|
|
34
|
+
export declare function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGraphButton, heightStyle, querySelection, profileSelection, comparing, sumBy, defaultSumByLoading, queryClient, queryExpressionString, setTimeRangeSelection, selectQuery, selectProfile, query, setNewQueryExpression, utilizationMetrics, utilizationMetricsLoading, onUtilizationSeriesSelect, }: MetricsGraphSectionProps): JSX.Element;
|
|
31
35
|
export {};
|
|
32
36
|
//# sourceMappingURL=MetricsGraphSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsGraphSection.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/MetricsGraphSection.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAQ,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAyB,gBAAgB,EAAC,MAAM,IAAI,CAAC;AAI5D,OAAO,EAAC,cAAc,EAAE,KAAK,kBAAkB,IAAI,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAE1F,UAAU,wBAAwB;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gCAAgC,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,kBAAkB,CAAC;IAChC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C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,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,kBAAkB,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,KAAK,CAAC;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,iBAAiB,EAAE,MAAM,CAAC;QAC1B,IAAI,EAAE,sBAAsB,EAAE,CAAC;KAChC,CAAC,CAAC;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KAAK,IAAI,CAAC;CACnF;AAED,wBAAgB,mBAAmB,CAAC,EAClC,gBAAgB,EAChB,gCAAgC,EAChC,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,GAC1B,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAoMxC"}
|
|
@@ -17,7 +17,7 @@ import { MergedProfileSelection } from '..';
|
|
|
17
17
|
import UtilizationMetricsGraph from '../MetricsGraph/UtilizationMetrics';
|
|
18
18
|
import AreaChart from '../MetricsGraph/UtilizationMetrics/Throughput';
|
|
19
19
|
import ProfileMetricsGraph, { ProfileMetricsEmptyState } from '../ProfileMetricsGraph';
|
|
20
|
-
export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGraphButton, heightStyle, querySelection, profileSelection, comparing, sumBy, defaultSumByLoading, queryClient, queryExpressionString, setTimeRangeSelection, selectQuery, selectProfile, query, setNewQueryExpression, utilizationMetrics, utilizationMetricsLoading, }) {
|
|
20
|
+
export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGraphButton, heightStyle, querySelection, profileSelection, comparing, sumBy, defaultSumByLoading, queryClient, queryExpressionString, setTimeRangeSelection, selectQuery, selectProfile, query, setNewQueryExpression, utilizationMetrics, utilizationMetricsLoading, onUtilizationSeriesSelect, }) {
|
|
21
21
|
const handleTimeRangeChange = (range) => {
|
|
22
22
|
const from = range.getFromMs();
|
|
23
23
|
const to = range.getToMs();
|
|
@@ -85,12 +85,12 @@ export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGra
|
|
|
85
85
|
return (_jsxs("div", { children: [utilizationMetrics.map(({ name, humanReadableName, data }) => {
|
|
86
86
|
if (name !== 'gpu_pcie_throughput_transmit_bytes' &&
|
|
87
87
|
name !== 'gpu_pcie_throughput_receive_bytes') {
|
|
88
|
-
return (_jsx(_Fragment, { children: _jsx(UtilizationMetricsGraph, { data: data, addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, utilizationMetricsLoading: utilizationMetricsLoading, name: name, humanReadableName: humanReadableName, from: querySelection.from, to: querySelection.to }, name) }));
|
|
88
|
+
return (_jsx(_Fragment, { children: _jsx(UtilizationMetricsGraph, { data: data, addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, utilizationMetricsLoading: utilizationMetricsLoading, name: name, humanReadableName: humanReadableName, from: querySelection.from, to: querySelection.to, selectedSeries: undefined, onSelectedSeriesChange: onUtilizationSeriesSelect }, name) }));
|
|
89
89
|
}
|
|
90
90
|
return null;
|
|
91
91
|
}), throughputMetrics.length > 0 && (_jsx(AreaChart, { transmitData: throughputMetrics.find(metric => metric.name === 'gpu_pcie_throughput_transmit_bytes')
|
|
92
92
|
?.data ?? [], receiveData: throughputMetrics.find(metric => metric.name === 'gpu_pcie_throughput_receive_bytes')
|
|
93
|
-
?.data ?? [], addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, name: throughputMetrics[0].name, humanReadableName: throughputMetrics[0].humanReadableName, from: querySelection.from, to: querySelection.to, utilizationMetricsLoading: utilizationMetricsLoading }))] }));
|
|
93
|
+
?.data ?? [], addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, name: throughputMetrics[0].name, humanReadableName: throughputMetrics[0].humanReadableName, from: querySelection.from, to: querySelection.to, utilizationMetricsLoading: utilizationMetricsLoading, selectedSeries: undefined, onSelectedSeriesChange: onUtilizationSeriesSelect }))] }));
|
|
94
94
|
};
|
|
95
95
|
return (_jsxs("div", { className: cx('relative', { 'py-4': !showMetricsGraph }), children: [setDisplayHideMetricsGraphButton != null ? (_jsxs("button", { onClick: () => setDisplayHideMetricsGraphButton(!showMetricsGraph), className: cx('hidden px-3 py-1 text-sm font-medium text-gray-700 dark:text-gray-200 bg-gray-100 rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:bg-gray-900 z-10', showMetricsGraph && 'absolute right-0 bottom-3 !flex', !showMetricsGraph && 'relative !flex ml-auto'), children: [showMetricsGraph ? 'Hide' : 'Show', " Metrics Graph"] })) : null, showMetricsGraph && (_jsx(_Fragment, { children: _jsx("div", { style: { height: heightStyle }, children: querySelection.expression !== '' &&
|
|
96
96
|
querySelection.from !== undefined &&
|
|
@@ -56,6 +56,10 @@ interface ProfileSelectorProps extends ProfileSelectorFeatures {
|
|
|
56
56
|
}>;
|
|
57
57
|
utilizationMetricsLoading?: boolean;
|
|
58
58
|
utilizationLabels?: UtilizationLabels;
|
|
59
|
+
onUtilizationSeriesSelect?: (series: Array<{
|
|
60
|
+
key: string;
|
|
61
|
+
value: string;
|
|
62
|
+
}>) => void;
|
|
59
63
|
}
|
|
60
64
|
export interface IProfileTypesResult {
|
|
61
65
|
loading: boolean;
|
|
@@ -63,6 +67,6 @@ export interface IProfileTypesResult {
|
|
|
63
67
|
error?: RpcError;
|
|
64
68
|
}
|
|
65
69
|
export declare const useProfileTypes: (client: QueryServiceClient) => IProfileTypesResult;
|
|
66
|
-
declare const ProfileSelector: ({ queryClient, querySelection, selectProfile, selectQuery, closeProfile, enforcedProfileName, profileSelection, comparing, navigateTo, showMetricsGraph, showSumBySelector, showProfileTypeSelector, disableExplorativeQuerying, setDisplayHideMetricsGraphButton, utilizationMetrics, utilizationMetricsLoading, utilizationLabels, }: ProfileSelectorProps) => JSX.Element;
|
|
70
|
+
declare const ProfileSelector: ({ queryClient, querySelection, selectProfile, selectQuery, closeProfile, enforcedProfileName, profileSelection, comparing, navigateTo, showMetricsGraph, showSumBySelector, showProfileTypeSelector, disableExplorativeQuerying, setDisplayHideMetricsGraphButton, utilizationMetrics, utilizationMetricsLoading, utilizationLabels, onUtilizationSeriesSelect, }: ProfileSelectorProps) => JSX.Element;
|
|
67
71
|
export default ProfileSelector;
|
|
68
72
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAuC,MAAM,OAAO,CAAC;AAErF,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAC,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAUvE,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAC,gBAAgB,EAAC,MAAM,IAAI,CAAC;AASpC,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;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AO,CAAC;IACpC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KAAK,IAAI,CAAC;CACnF;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,WAAY,kBAAkB,KAAG,mBAkB5D,CAAC;AAEF,QAAA,MAAM,eAAe,sWAmBlB,oBAAoB,KAAG,GAAG,CAAC,OAmN7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -39,7 +39,7 @@ export const useProfileTypes = (client) => {
|
|
|
39
39
|
}, [client, metadata, loading]);
|
|
40
40
|
return { loading, data: result, error };
|
|
41
41
|
};
|
|
42
|
-
const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQuery, closeProfile, enforcedProfileName, profileSelection, comparing, navigateTo, showMetricsGraph = true, showSumBySelector = true, showProfileTypeSelector = true, disableExplorativeQuerying = false, setDisplayHideMetricsGraphButton, utilizationMetrics, utilizationMetricsLoading, utilizationLabels, }) => {
|
|
42
|
+
const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQuery, closeProfile, enforcedProfileName, profileSelection, comparing, navigateTo, showMetricsGraph = true, showSumBySelector = true, showProfileTypeSelector = true, disableExplorativeQuerying = false, setDisplayHideMetricsGraphButton, utilizationMetrics, utilizationMetricsLoading, utilizationLabels, onUtilizationSeriesSelect, }) => {
|
|
43
43
|
const { loading: profileTypesLoading, data: profileTypesData, error, } = useProfileTypes(queryClient);
|
|
44
44
|
const { heightStyle } = useMetricsGraphDimensions(comparing, utilizationMetrics != null);
|
|
45
45
|
const { viewComponent } = useParcaContext();
|
|
@@ -142,6 +142,6 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
|
|
|
142
142
|
const sumByRef = useRef(null);
|
|
143
143
|
return (_jsx(UtilizationLabelsProvider, { value: { ...utilizationLabels }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 flex", children: [_jsx(QueryControls, { showProfileTypeSelector: showProfileTypeSelector, showSumBySelector: showSumBySelector, disableExplorativeQuerying: disableExplorativeQuerying, profileTypesData: profileTypesData, profileTypesLoading: profileTypesLoading, selectedProfileName: selectedProfileName, setProfileName: setProfileName, setMatchersString: setMatchersString, setQueryExpression: setQueryExpression, query: query, queryBrowserRef: queryBrowserRef, timeRangeSelection: timeRangeSelection, setTimeRangeSelection: setTimeRangeSelection, searchDisabled: searchDisabled, queryBrowserMode: queryBrowserMode, setQueryBrowserMode: setQueryBrowserMode, advancedModeForQueryBrowser: advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser: setAdvancedModeForQueryBrowser, queryClient: queryClient, sumByRef: sumByRef, labels: labels, sumBySelection: sumBySelection ?? [], sumBySelectionLoading: sumBySelectionLoading, setUserSumBySelection: setUserSumBySelection, profileType: profileType, profileTypesError: error, viewComponent: viewComponent }), comparing && (_jsx("div", { children: _jsx(IconButton, { onClick: () => closeProfile(), icon: _jsx(CloseIcon, {}) }) }))] }), _jsx(MetricsGraphSection, { showMetricsGraph: showMetricsGraph, setDisplayHideMetricsGraphButton: setDisplayHideMetricsGraphButton, heightStyle: utilizationMetrics !== undefined && utilizationMetrics?.length > 0
|
|
144
144
|
? 'auto'
|
|
145
|
-
: heightStyle, querySelection: querySelection, profileSelection: profileSelection, comparing: comparing, sumBy: querySelection.sumBy ?? defaultSumBy ?? [], defaultSumByLoading: defaultSumByLoading, queryClient: queryClient, queryExpressionString: queryExpressionString, setTimeRangeSelection: setTimeRangeSelection, selectQuery: selectQuery, selectProfile: selectProfile, query: query, setQueryExpression: setQueryExpression, setNewQueryExpression: setNewQueryExpression, utilizationMetrics: utilizationMetrics, utilizationMetricsLoading: utilizationMetricsLoading })] }) }));
|
|
145
|
+
: heightStyle, querySelection: querySelection, profileSelection: profileSelection, comparing: comparing, sumBy: querySelection.sumBy ?? defaultSumBy ?? [], defaultSumByLoading: defaultSumByLoading, queryClient: queryClient, queryExpressionString: queryExpressionString, setTimeRangeSelection: setTimeRangeSelection, selectQuery: selectQuery, selectProfile: selectProfile, query: query, setQueryExpression: setQueryExpression, setNewQueryExpression: setNewQueryExpression, utilizationMetrics: utilizationMetrics, utilizationMetricsLoading: utilizationMetricsLoading, onUtilizationSeriesSelect: onUtilizationSeriesSelect })] }) }));
|
|
146
146
|
};
|
|
147
147
|
export default ProfileSelector;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@headlessui/react": "^1.7.19",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"access": "public",
|
|
78
78
|
"registry": "https://registry.npmjs.org/"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "5d49ba401cbd82198006103fccf8509abfde23dc"
|
|
81
81
|
}
|
|
@@ -52,6 +52,8 @@ interface CommonProps {
|
|
|
52
52
|
humanReadableName: string;
|
|
53
53
|
from: number;
|
|
54
54
|
to: number;
|
|
55
|
+
selectedSeries?: Array<{key: string; value: string}>;
|
|
56
|
+
onSelectedSeriesChange?: (series: Array<{key: string; value: string}>) => void;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
type RawAreaChartProps = CommonProps & {
|
|
@@ -112,6 +114,8 @@ const RawAreaChart = ({
|
|
|
112
114
|
humanReadableName,
|
|
113
115
|
from,
|
|
114
116
|
to,
|
|
117
|
+
selectedSeries,
|
|
118
|
+
onSelectedSeriesChange,
|
|
115
119
|
}: RawAreaChartProps): JSX.Element => {
|
|
116
120
|
const {timezone} = useParcaContext();
|
|
117
121
|
const graph = useRef(null);
|
|
@@ -121,15 +125,18 @@ const RawAreaChart = ({
|
|
|
121
125
|
const [pos, setPos] = useState([0, 0]);
|
|
122
126
|
const [isContextMenuOpen, setIsContextMenuOpen] = useState<boolean>(false);
|
|
123
127
|
const idForContextMenu = useId();
|
|
124
|
-
const [selectedSeries, setSelectedSeries] = useURLState<string>('selectedSeries');
|
|
125
128
|
const [_, setSelectedTimeframe] = useURLState('gpu_selected_timeframe');
|
|
126
129
|
|
|
127
130
|
const parsedSelectedSeries: Matcher[] = useMemo(() => {
|
|
128
|
-
if (selectedSeries ===
|
|
131
|
+
if (selectedSeries == null || selectedSeries.length === 0) {
|
|
129
132
|
return [];
|
|
130
133
|
}
|
|
131
134
|
|
|
132
|
-
return
|
|
135
|
+
return selectedSeries.map(s => ({
|
|
136
|
+
key: s.key,
|
|
137
|
+
value: s.value,
|
|
138
|
+
matcherType: '=' as const,
|
|
139
|
+
}));
|
|
133
140
|
}, [selectedSeries]);
|
|
134
141
|
|
|
135
142
|
const lineStroke = '1px';
|
|
@@ -513,14 +520,12 @@ const RawAreaChart = ({
|
|
|
513
520
|
}
|
|
514
521
|
strokeOpacity={isSelected ? 1 : 0.8}
|
|
515
522
|
onClick={() => {
|
|
516
|
-
if (highlighted != null) {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}))
|
|
523
|
-
)
|
|
523
|
+
if (highlighted != null && onSelectedSeriesChange != null) {
|
|
524
|
+
onSelectedSeriesChange(
|
|
525
|
+
highlighted.labels.map(l => ({
|
|
526
|
+
key: l.name,
|
|
527
|
+
value: l.value,
|
|
528
|
+
}))
|
|
524
529
|
);
|
|
525
530
|
setSelectedTimeframe(undefined);
|
|
526
531
|
}
|
|
@@ -547,6 +552,8 @@ const AreaChart = ({
|
|
|
547
552
|
humanReadableName,
|
|
548
553
|
from,
|
|
549
554
|
to,
|
|
555
|
+
selectedSeries,
|
|
556
|
+
onSelectedSeriesChange,
|
|
550
557
|
}: Props): JSX.Element => {
|
|
551
558
|
const {isDarkMode} = useParcaContext();
|
|
552
559
|
const {width, height, margin, heightStyle} = useMetricsGraphDimensions(false, true);
|
|
@@ -575,6 +582,8 @@ const AreaChart = ({
|
|
|
575
582
|
humanReadableName={humanReadableName}
|
|
576
583
|
from={from}
|
|
577
584
|
to={to}
|
|
585
|
+
selectedSeries={selectedSeries}
|
|
586
|
+
onSelectedSeriesChange={onSelectedSeriesChange}
|
|
578
587
|
/>
|
|
579
588
|
)}
|
|
580
589
|
</motion.div>
|
|
@@ -41,6 +41,8 @@ interface CommonProps {
|
|
|
41
41
|
humanReadableName: string;
|
|
42
42
|
from: number;
|
|
43
43
|
to: number;
|
|
44
|
+
selectedSeries?: Array<{key: string; value: string}>;
|
|
45
|
+
onSelectedSeriesChange?: (series: Array<{key: string; value: string}>) => void;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
type RawUtilizationMetricsProps = CommonProps & {
|
|
@@ -112,6 +114,8 @@ const RawUtilizationMetrics = ({
|
|
|
112
114
|
humanReadableName,
|
|
113
115
|
from,
|
|
114
116
|
to,
|
|
117
|
+
selectedSeries,
|
|
118
|
+
onSelectedSeriesChange,
|
|
115
119
|
}: RawUtilizationMetricsProps): JSX.Element => {
|
|
116
120
|
const {timezone} = useParcaContext();
|
|
117
121
|
const graph = useRef(null);
|
|
@@ -121,15 +125,18 @@ const RawUtilizationMetrics = ({
|
|
|
121
125
|
const [pos, setPos] = useState([0, 0]);
|
|
122
126
|
const [isContextMenuOpen, setIsContextMenuOpen] = useState<boolean>(false);
|
|
123
127
|
const idForContextMenu = useId();
|
|
124
|
-
const [selectedSeries, setSelectedSeries] = useURLState<string>('selectedSeries');
|
|
125
128
|
const [_, setSelectedTimeframe] = useURLState('gpu_selected_timeframe');
|
|
126
129
|
|
|
127
130
|
const parsedSelectedSeries: Matcher[] = useMemo(() => {
|
|
128
|
-
if (selectedSeries ===
|
|
131
|
+
if (selectedSeries == null || selectedSeries.length === 0) {
|
|
129
132
|
return [];
|
|
130
133
|
}
|
|
131
134
|
|
|
132
|
-
return
|
|
135
|
+
return selectedSeries.map(s => ({
|
|
136
|
+
key: s.key,
|
|
137
|
+
value: s.value,
|
|
138
|
+
matcherType: '=' as const,
|
|
139
|
+
}));
|
|
133
140
|
}, [selectedSeries]);
|
|
134
141
|
|
|
135
142
|
const lineStroke = '1px';
|
|
@@ -503,14 +510,12 @@ const RawUtilizationMetrics = ({
|
|
|
503
510
|
xScale={xScale}
|
|
504
511
|
yScale={yScale}
|
|
505
512
|
onClick={() => {
|
|
506
|
-
if (highlighted != null) {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}))
|
|
513
|
-
)
|
|
513
|
+
if (highlighted != null && onSelectedSeriesChange != null) {
|
|
514
|
+
onSelectedSeriesChange(
|
|
515
|
+
highlighted.labels.map(l => ({
|
|
516
|
+
key: l.name,
|
|
517
|
+
value: l.value,
|
|
518
|
+
}))
|
|
514
519
|
);
|
|
515
520
|
// reset the selected_timeframe
|
|
516
521
|
setSelectedTimeframe(undefined);
|
|
@@ -537,6 +542,8 @@ const UtilizationMetrics = ({
|
|
|
537
542
|
humanReadableName,
|
|
538
543
|
from,
|
|
539
544
|
to,
|
|
545
|
+
selectedSeries,
|
|
546
|
+
onSelectedSeriesChange,
|
|
540
547
|
}: Props): JSX.Element => {
|
|
541
548
|
const {isDarkMode} = useParcaContext();
|
|
542
549
|
const {width, height, margin, heightStyle} = useMetricsGraphDimensions(false, true);
|
|
@@ -564,6 +571,8 @@ const UtilizationMetrics = ({
|
|
|
564
571
|
humanReadableName={humanReadableName}
|
|
565
572
|
from={from}
|
|
566
573
|
to={to}
|
|
574
|
+
selectedSeries={selectedSeries}
|
|
575
|
+
onSelectedSeriesChange={onSelectedSeriesChange}
|
|
567
576
|
/>
|
|
568
577
|
)}
|
|
569
578
|
</motion.div>
|
|
@@ -46,6 +46,7 @@ interface MetricsGraphSectionProps {
|
|
|
46
46
|
data: UtilizationMetricsType[];
|
|
47
47
|
}>;
|
|
48
48
|
utilizationMetricsLoading?: boolean;
|
|
49
|
+
onUtilizationSeriesSelect?: (series: Array<{key: string; value: string}>) => void;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export function MetricsGraphSection({
|
|
@@ -66,6 +67,7 @@ export function MetricsGraphSection({
|
|
|
66
67
|
setNewQueryExpression,
|
|
67
68
|
utilizationMetrics,
|
|
68
69
|
utilizationMetricsLoading,
|
|
70
|
+
onUtilizationSeriesSelect,
|
|
69
71
|
}: MetricsGraphSectionProps): JSX.Element {
|
|
70
72
|
const handleTimeRangeChange = (range: DateTimeRange): void => {
|
|
71
73
|
const from = range.getFromMs();
|
|
@@ -176,6 +178,8 @@ export function MetricsGraphSection({
|
|
|
176
178
|
humanReadableName={humanReadableName}
|
|
177
179
|
from={querySelection.from}
|
|
178
180
|
to={querySelection.to}
|
|
181
|
+
selectedSeries={undefined}
|
|
182
|
+
onSelectedSeriesChange={onUtilizationSeriesSelect}
|
|
179
183
|
/>
|
|
180
184
|
</>
|
|
181
185
|
);
|
|
@@ -199,6 +203,8 @@ export function MetricsGraphSection({
|
|
|
199
203
|
from={querySelection.from}
|
|
200
204
|
to={querySelection.to}
|
|
201
205
|
utilizationMetricsLoading={utilizationMetricsLoading}
|
|
206
|
+
selectedSeries={undefined}
|
|
207
|
+
onSelectedSeriesChange={onUtilizationSeriesSelect}
|
|
202
208
|
/>
|
|
203
209
|
)}
|
|
204
210
|
</div>
|
|
@@ -93,6 +93,7 @@ interface ProfileSelectorProps extends ProfileSelectorFeatures {
|
|
|
93
93
|
}>;
|
|
94
94
|
utilizationMetricsLoading?: boolean;
|
|
95
95
|
utilizationLabels?: UtilizationLabels;
|
|
96
|
+
onUtilizationSeriesSelect?: (series: Array<{key: string; value: string}>) => void;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
export interface IProfileTypesResult {
|
|
@@ -139,6 +140,7 @@ const ProfileSelector = ({
|
|
|
139
140
|
utilizationMetrics,
|
|
140
141
|
utilizationMetricsLoading,
|
|
141
142
|
utilizationLabels,
|
|
143
|
+
onUtilizationSeriesSelect,
|
|
142
144
|
}: ProfileSelectorProps): JSX.Element => {
|
|
143
145
|
const {
|
|
144
146
|
loading: profileTypesLoading,
|
|
@@ -345,6 +347,7 @@ const ProfileSelector = ({
|
|
|
345
347
|
setNewQueryExpression={setNewQueryExpression}
|
|
346
348
|
utilizationMetrics={utilizationMetrics}
|
|
347
349
|
utilizationMetricsLoading={utilizationMetricsLoading}
|
|
350
|
+
onUtilizationSeriesSelect={onUtilizationSeriesSelect}
|
|
348
351
|
/>
|
|
349
352
|
</>
|
|
350
353
|
</UtilizationLabelsProvider>
|