@parca/profile 0.16.497 → 0.16.498
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/AreaChart.d.ts +24 -0
- package/dist/MetricsGraph/UtilizationMetrics/AreaChart.d.ts.map +1 -0
- package/dist/MetricsGraph/UtilizationMetrics/AreaChart.js +278 -0
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +17 -2
- package/package.json +6 -6
- package/src/MetricsGraph/UtilizationMetrics/AreaChart.tsx +605 -0
- package/src/ProfileSelector/MetricsGraphSection.tsx +63 -15
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.16.498](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.497...@parca/profile@0.16.498) (2025-04-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.16.497](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.496...@parca/profile@0.16.497) (2025-04-24)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DateTimeRange } from '@parca/components';
|
|
2
|
+
import { type UtilizationMetrics as MetricSeries } from '../../ProfileSelector';
|
|
3
|
+
interface CommonProps {
|
|
4
|
+
transmitData: MetricSeries[];
|
|
5
|
+
receiveData: MetricSeries[];
|
|
6
|
+
addLabelMatcher: (labels: {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
} | Array<{
|
|
10
|
+
key: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}>) => void;
|
|
13
|
+
setTimeRange: (range: DateTimeRange) => void;
|
|
14
|
+
name: string;
|
|
15
|
+
humanReadableName: string;
|
|
16
|
+
from: number;
|
|
17
|
+
to: number;
|
|
18
|
+
}
|
|
19
|
+
type Props = CommonProps & {
|
|
20
|
+
utilizationMetricsLoading?: boolean;
|
|
21
|
+
};
|
|
22
|
+
declare const AreaChart: ({ transmitData, receiveData, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, }: Props) => JSX.Element;
|
|
23
|
+
export default AreaChart;
|
|
24
|
+
//# sourceMappingURL=AreaChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AreaChart.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/UtilizationMetrics/AreaChart.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,aAAa,EAAqD,MAAM,mBAAmB,CAAC;AAIpG,OAAO,EAAC,KAAK,kBAAkB,IAAI,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAiB9E,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,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAQD,KAAK,KAAK,GAAG,WAAW,GAAG;IACzB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAgfF,QAAA,MAAM,SAAS,gIAUZ,KAAK,KAAG,GAAG,CAAC,OAiCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2022 The Parca Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { Fragment, useCallback, useId, useMemo, useRef, useState } from 'react';
|
|
15
|
+
import * as d3 from 'd3';
|
|
16
|
+
import { pointer } from 'd3-selection';
|
|
17
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
18
|
+
import throttle from 'lodash.throttle';
|
|
19
|
+
import { useContextMenu } from 'react-contexify';
|
|
20
|
+
import { DateTimeRange, MetricsGraphSkeleton, useParcaContext, useURLState } from '@parca/components';
|
|
21
|
+
import { formatDate, formatForTimespan, getPrecision, valueFormatter } from '@parca/utilities';
|
|
22
|
+
import MetricsContextMenu from '../MetricsContextMenu';
|
|
23
|
+
import MetricsTooltip from '../MetricsTooltip';
|
|
24
|
+
import { useMetricsGraphDimensions } from '../useMetricsGraphDimensions';
|
|
25
|
+
function transformToSeries(data, isReceive = false) {
|
|
26
|
+
const series = data.reduce(function (agg, s) {
|
|
27
|
+
if (s.labelset !== undefined) {
|
|
28
|
+
const metric = s.labelset.labels.sort((a, b) => a.name.localeCompare(b.name));
|
|
29
|
+
agg.push({
|
|
30
|
+
metric,
|
|
31
|
+
values: s.samples.reduce(function (agg, d) {
|
|
32
|
+
if (d.timestamp !== undefined && d.value !== undefined) {
|
|
33
|
+
// Multiply receive values by -1 to display below zero
|
|
34
|
+
const value = isReceive ? -1 * d.value : d.value;
|
|
35
|
+
agg.push([d.timestamp, value]);
|
|
36
|
+
}
|
|
37
|
+
return agg;
|
|
38
|
+
}, []),
|
|
39
|
+
labelset: metric.map(m => `${m.name}=${m.value}`).join(','),
|
|
40
|
+
isReceive,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return agg;
|
|
44
|
+
}, []);
|
|
45
|
+
// Sort values by timestamp for each series
|
|
46
|
+
return series.map(series => ({
|
|
47
|
+
...series,
|
|
48
|
+
values: series.values.sort((a, b) => a[0] - b[0]),
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
const getYAxisUnit = (name) => {
|
|
52
|
+
switch (name) {
|
|
53
|
+
case 'gpu_utilization_percent':
|
|
54
|
+
return 'percent';
|
|
55
|
+
case 'gpu_memory_utilization_percent':
|
|
56
|
+
return 'percent';
|
|
57
|
+
case 'gpu_power_watt':
|
|
58
|
+
return 'watts';
|
|
59
|
+
case 'gpu_pcie_throughput_transmit_bytes':
|
|
60
|
+
return 'bytes_per_second';
|
|
61
|
+
case 'gpu_pcie_throughput_receive_bytes':
|
|
62
|
+
return 'bytes_per_second';
|
|
63
|
+
default:
|
|
64
|
+
return 'percent';
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const RawAreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange, width, height, margin, name, humanReadableName, from, to, }) => {
|
|
68
|
+
const { timezone } = useParcaContext();
|
|
69
|
+
const graph = useRef(null);
|
|
70
|
+
const [dragging, setDragging] = useState(false);
|
|
71
|
+
const [hovering, setHovering] = useState(false);
|
|
72
|
+
const [relPos, setRelPos] = useState(-1);
|
|
73
|
+
const [pos, setPos] = useState([0, 0]);
|
|
74
|
+
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
75
|
+
const idForContextMenu = useId();
|
|
76
|
+
const [selectedSeries, setSelectedSeries] = useURLState('selectedSeries');
|
|
77
|
+
const [_, setSelectedTimeframe] = useURLState('gpu_selected_timeframe');
|
|
78
|
+
const parsedSelectedSeries = useMemo(() => {
|
|
79
|
+
if (selectedSeries === undefined) {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
return JSON.parse(decodeURIComponent(selectedSeries));
|
|
83
|
+
}, [selectedSeries]);
|
|
84
|
+
const lineStroke = '1px';
|
|
85
|
+
const lineStrokeHover = '2px';
|
|
86
|
+
const lineStrokeSelected = '3px';
|
|
87
|
+
const graphWidth = width - margin * 1.5 - margin / 2;
|
|
88
|
+
const paddedFrom = from;
|
|
89
|
+
const paddedTo = to;
|
|
90
|
+
const series = useMemo(() => {
|
|
91
|
+
const transmitSeries = transformToSeries(transmitData);
|
|
92
|
+
const receiveSeries = transformToSeries(receiveData, true);
|
|
93
|
+
return [...transmitSeries, ...receiveSeries];
|
|
94
|
+
}, [transmitData, receiveData]);
|
|
95
|
+
const extentsY = series.map(function (s) {
|
|
96
|
+
return d3.extent(s.values, function (d) {
|
|
97
|
+
return d[1];
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
const minY = d3.min(extentsY, function (d) {
|
|
101
|
+
return d[0];
|
|
102
|
+
});
|
|
103
|
+
const maxY = d3.max(extentsY, function (d) {
|
|
104
|
+
return d[1];
|
|
105
|
+
});
|
|
106
|
+
// Setup scales with padded time range
|
|
107
|
+
const xScale = d3.scaleUtc().domain([paddedFrom, paddedTo]).range([0, graphWidth]);
|
|
108
|
+
const yScale = d3
|
|
109
|
+
.scaleLinear()
|
|
110
|
+
// Ensure domain is symmetric around 0 for balanced visualization
|
|
111
|
+
.domain([minY ?? 0, maxY ?? 0])
|
|
112
|
+
.range([height - margin, 0])
|
|
113
|
+
.nice();
|
|
114
|
+
const throttledSetPos = throttle(setPos, 20);
|
|
115
|
+
const onMouseMove = (e) => {
|
|
116
|
+
if (isContextMenuOpen) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
// X/Y coordinate array relative to svg
|
|
120
|
+
const rel = pointer(e);
|
|
121
|
+
const xCoordinate = rel[0];
|
|
122
|
+
const xCoordinateWithoutMargin = xCoordinate - margin;
|
|
123
|
+
const yCoordinate = rel[1];
|
|
124
|
+
const yCoordinateWithoutMargin = yCoordinate - margin;
|
|
125
|
+
throttledSetPos([xCoordinateWithoutMargin, yCoordinateWithoutMargin]);
|
|
126
|
+
};
|
|
127
|
+
const trackVisibility = (isVisible) => {
|
|
128
|
+
setIsContextMenuOpen(isVisible);
|
|
129
|
+
};
|
|
130
|
+
const MENU_ID = `areachart-context-menu-${idForContextMenu}`;
|
|
131
|
+
const { show } = useContextMenu({
|
|
132
|
+
id: MENU_ID,
|
|
133
|
+
});
|
|
134
|
+
const displayMenu = useCallback((e) => {
|
|
135
|
+
show({
|
|
136
|
+
event: e,
|
|
137
|
+
});
|
|
138
|
+
}, [show]);
|
|
139
|
+
const getSeriesColor = (series) => {
|
|
140
|
+
return series.isReceive === true ? '#EAB308' : '#22C55E'; // Yellow for receive, Green for transmit
|
|
141
|
+
};
|
|
142
|
+
// Create area generator for transmit (above zero)
|
|
143
|
+
const transmitArea = d3
|
|
144
|
+
.area()
|
|
145
|
+
.x(d => xScale(d[0]))
|
|
146
|
+
.y0(yScale(0)) // Start from zero line
|
|
147
|
+
.y1(d => yScale(d[1])); // Top of the area (data point)
|
|
148
|
+
// Create area generator for receive (below zero)
|
|
149
|
+
const receiveArea = d3
|
|
150
|
+
.area()
|
|
151
|
+
.x(d => xScale(d[0]))
|
|
152
|
+
.y0(yScale(0)) // Start from zero line
|
|
153
|
+
.y1(d => yScale(d[1])); // Bottom of the area (negative data point)
|
|
154
|
+
const highlighted = useMemo(() => {
|
|
155
|
+
if (series.length === 0) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
// Return the closest point as the highlighted point
|
|
159
|
+
const closestPointPerSeries = series.map(function (s) {
|
|
160
|
+
const distances = s.values.map(d => {
|
|
161
|
+
const x = xScale(d[0]) + margin / 2;
|
|
162
|
+
const y = yScale(d[1]) - margin / 3;
|
|
163
|
+
return Math.sqrt(Math.pow(pos[0] - x, 2) + Math.pow(pos[1] - y, 2));
|
|
164
|
+
});
|
|
165
|
+
const pointIndex = d3.minIndex(distances);
|
|
166
|
+
const minDistance = distances[pointIndex];
|
|
167
|
+
return {
|
|
168
|
+
pointIndex,
|
|
169
|
+
distance: minDistance,
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
const closestSeriesIndex = d3.minIndex(closestPointPerSeries, s => s.distance);
|
|
173
|
+
const pointIndex = closestPointPerSeries[closestSeriesIndex].pointIndex;
|
|
174
|
+
const point = series[closestSeriesIndex].values[pointIndex];
|
|
175
|
+
return {
|
|
176
|
+
seriesIndex: closestSeriesIndex,
|
|
177
|
+
labels: series[closestSeriesIndex].metric,
|
|
178
|
+
timestamp: point[0],
|
|
179
|
+
valuePerSecond: point[1],
|
|
180
|
+
value: point[2],
|
|
181
|
+
duration: point[3],
|
|
182
|
+
x: xScale(point[0]),
|
|
183
|
+
y: yScale(point[1]),
|
|
184
|
+
};
|
|
185
|
+
}, [pos, series, xScale, yScale, margin]);
|
|
186
|
+
const onMouseDown = (e) => {
|
|
187
|
+
// only left mouse button
|
|
188
|
+
if (e.button !== 0) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
// X/Y coordinate array relative to svg
|
|
192
|
+
const rel = pointer(e);
|
|
193
|
+
const xCoordinate = rel[0];
|
|
194
|
+
const xCoordinateWithoutMargin = xCoordinate - margin;
|
|
195
|
+
if (xCoordinateWithoutMargin >= 0) {
|
|
196
|
+
setRelPos(xCoordinateWithoutMargin);
|
|
197
|
+
setDragging(true);
|
|
198
|
+
}
|
|
199
|
+
e.stopPropagation();
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
};
|
|
202
|
+
const onMouseUp = (e) => {
|
|
203
|
+
setDragging(false);
|
|
204
|
+
if (relPos === -1) {
|
|
205
|
+
// MouseDown happened outside of this element.
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
// This is a normal click. We tolerate tiny movements to still be a
|
|
209
|
+
// click as they can occur when clicking based on user feedback.
|
|
210
|
+
if (Math.abs(relPos - pos[0]) <= 1) {
|
|
211
|
+
setRelPos(-1);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
let startPos = relPos;
|
|
215
|
+
let endPos = pos[0];
|
|
216
|
+
if (startPos > endPos) {
|
|
217
|
+
startPos = pos[0];
|
|
218
|
+
endPos = relPos;
|
|
219
|
+
}
|
|
220
|
+
const startCorrection = 10;
|
|
221
|
+
const endCorrection = 30;
|
|
222
|
+
const firstTime = xScale.invert(startPos - startCorrection).valueOf();
|
|
223
|
+
const secondTime = xScale.invert(endPos - endCorrection).valueOf();
|
|
224
|
+
setTimeRange(DateTimeRange.fromAbsoluteDates(firstTime, secondTime));
|
|
225
|
+
setRelPos(-1);
|
|
226
|
+
e.stopPropagation();
|
|
227
|
+
e.preventDefault();
|
|
228
|
+
};
|
|
229
|
+
return (_jsxs(_Fragment, { children: [_jsx(MetricsContextMenu, { onAddLabelMatcher: addLabelMatcher, menuId: MENU_ID, highlighted: highlighted, trackVisibility: trackVisibility, utilizationMetrics: true }), highlighted != null && hovering && !dragging && pos[0] !== 0 && pos[1] !== 0 && (_jsx("div", { onMouseMove: onMouseMove, onMouseEnter: () => setHovering(true), onMouseLeave: () => setHovering(false), children: !isContextMenuOpen && (_jsx(MetricsTooltip, { x: pos[0] + margin, y: pos[1] + margin, highlighted: {
|
|
230
|
+
...highlighted,
|
|
231
|
+
valuePerSecond: Math.abs(highlighted.valuePerSecond), // Show absolute value in tooltip
|
|
232
|
+
}, contextElement: graph.current, sampleUnit: getYAxisUnit(name), delta: false, utilizationMetrics: true })) })), _jsx("div", { ref: graph, onMouseEnter: () => setHovering(true), onMouseLeave: () => setHovering(false), onContextMenu: displayMenu, children: _jsxs("svg", { width: `${width}px`, height: `${height + margin}px`, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onMouseMove: onMouseMove, children: [_jsx("g", { transform: `translate(${margin}, 0)`, children: dragging && (_jsx("g", { className: "zoom-time-rect", children: _jsx("rect", { className: "bar", x: pos[0] - relPos < 0 ? pos[0] : relPos, y: 0, height: height, width: Math.abs(pos[0] - relPos), fill: 'rgba(0, 0, 0, 0.125)' }) })) }), _jsxs("g", { transform: `translate(${margin * 1.5}, ${margin / 1.5})`, children: [_jsxs("g", { className: "y axis", textAnchor: "end", fontSize: "10", fill: "none", children: [yScale.ticks(6).map((d, i, allTicks) => {
|
|
233
|
+
let decimals = 2;
|
|
234
|
+
const intervalBetweenTicks = allTicks[1] - allTicks[0];
|
|
235
|
+
if (intervalBetweenTicks < 1) {
|
|
236
|
+
const precision = getPrecision(intervalBetweenTicks);
|
|
237
|
+
decimals = precision;
|
|
238
|
+
}
|
|
239
|
+
return (_jsxs(Fragment, { children: [_jsxs("g", { className: "tick", transform: `translate(0, ${yScale(d)})`, children: [_jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x2: -6 }), _jsxs("text", { fill: "currentColor", x: -9, dy: '0.32em', children: [d < 0 ? '-' : '', valueFormatter(Math.abs(d), getYAxisUnit(name), decimals)] })] }, `tick-${i}`), _jsx("g", { children: _jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x1: xScale(from), x2: xScale(to), y1: yScale(d), y2: yScale(d) }) }, `grid-${i}`)] }, `${i.toString()}-${d.toString()}`));
|
|
240
|
+
}), _jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x1: 0, x2: 0, y1: 0, y2: height - margin }), _jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x1: xScale(to), x2: xScale(to), y1: 0, y2: height - margin }), _jsx("g", { transform: `translate(${-margin}, ${(height - margin) / 2}) rotate(270)`, children: _jsx("text", { fill: "currentColor", dy: "-0.7em", className: "text-sm capitalize", textAnchor: "middle", children: humanReadableName }) })] }), _jsxs("g", { className: "x axis", fill: "none", fontSize: "10", textAnchor: "middle", transform: `translate(0,${height - margin})`, children: [xScale.ticks(5).map((d, i) => (_jsxs(Fragment, { children: [_jsxs("g", { className: "tick",
|
|
241
|
+
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
|
|
242
|
+
transform: `translate(${xScale(d)}, 0)`, children: [_jsx("line", { y2: 6, className: "stroke-gray-300 dark:stroke-gray-500" }), _jsx("text", { fill: "currentColor", dy: ".71em", y: 9, children: formatDate(d, formatForTimespan(from, to), timezone) })] }, `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()}`))), _jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x1: 0, x2: graphWidth, y1: 0, y2: 0 }), _jsx("g", { transform: `translate(${(width - 2.5 * margin) / 2}, ${margin / 2})`, children: _jsx("text", { fill: "currentColor", dy: ".71em", y: 5, className: "text-sm", children: "Time" }) })] }), _jsx("g", { className: "areas", children: series.map((s, i) => {
|
|
243
|
+
let isSelected = false;
|
|
244
|
+
if (parsedSelectedSeries != null && parsedSelectedSeries.length > 0) {
|
|
245
|
+
isSelected = parsedSelectedSeries.every(m => {
|
|
246
|
+
for (let i = 0; i < s.metric.length; i++) {
|
|
247
|
+
if (s.metric[i].name === m.key && s.metric[i].value === m.value) {
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return false;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
const seriesColor = getSeriesColor(s);
|
|
255
|
+
const fillOpacity = isSelected ? 0.4 : 0.2;
|
|
256
|
+
const strokeOpacity = isSelected ? 1 : 0.8;
|
|
257
|
+
const areaGenerator = s.isReceive === true ? receiveArea : transmitArea;
|
|
258
|
+
return (_jsx("g", { className: "area cursor-pointer", children: _jsx("path", { d: areaGenerator(s.values) ?? '', fill: seriesColor, fillOpacity: fillOpacity, stroke: seriesColor, strokeWidth: isSelected
|
|
259
|
+
? lineStrokeSelected
|
|
260
|
+
: hovering && highlighted != null && i === highlighted.seriesIndex
|
|
261
|
+
? lineStrokeHover
|
|
262
|
+
: lineStroke, strokeOpacity: strokeOpacity, onClick: () => {
|
|
263
|
+
if (highlighted != null) {
|
|
264
|
+
setSelectedSeries(JSON.stringify(highlighted.labels.map(l => ({
|
|
265
|
+
key: l.name,
|
|
266
|
+
value: l.value,
|
|
267
|
+
}))));
|
|
268
|
+
setSelectedTimeframe(undefined);
|
|
269
|
+
}
|
|
270
|
+
} }) }, i));
|
|
271
|
+
}) })] })] }) })] }));
|
|
272
|
+
};
|
|
273
|
+
const AreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, }) => {
|
|
274
|
+
const { isDarkMode } = useParcaContext();
|
|
275
|
+
const { width, height, margin, heightStyle } = useMetricsGraphDimensions(false, true);
|
|
276
|
+
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") }));
|
|
277
|
+
};
|
|
278
|
+
export default AreaChart;
|
|
@@ -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;
|
|
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,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;CACrC;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,GAC1B,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CA0LxC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// Copyright 2022 The Parca Authors
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -15,6 +15,7 @@ import cx from 'classnames';
|
|
|
15
15
|
import { Query } from '@parca/parser';
|
|
16
16
|
import { MergedProfileSelection } from '..';
|
|
17
17
|
import UtilizationMetricsGraph from '../MetricsGraph/UtilizationMetrics';
|
|
18
|
+
import AreaChart from '../MetricsGraph/UtilizationMetrics/AreaChart';
|
|
18
19
|
import ProfileMetricsGraph, { ProfileMetricsEmptyState } from '../ProfileMetricsGraph';
|
|
19
20
|
export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGraphButton, heightStyle, querySelection, profileSelection, comparing, sumBy, defaultSumByLoading, queryClient, queryExpressionString, setTimeRangeSelection, selectQuery, selectProfile, query, setNewQueryExpression, utilizationMetrics, utilizationMetricsLoading, }) {
|
|
20
21
|
const handleTimeRangeChange = (range) => {
|
|
@@ -75,7 +76,21 @@ export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGra
|
|
|
75
76
|
const mergeTo = query.profileType().delta ? mergeFrom + durationInMilliseconds : mergeFrom;
|
|
76
77
|
selectProfile(new MergedProfileSelection(mergeFrom, mergeTo, query));
|
|
77
78
|
};
|
|
79
|
+
const UtilizationGraphToShow = ({ utilizationMetrics, }) => {
|
|
80
|
+
const throughputMetrics = utilizationMetrics.filter(metric => metric.name === 'gpu_pcie_throughput_transmit_bytes' ||
|
|
81
|
+
metric.name === 'gpu_pcie_throughput_receive_bytes');
|
|
82
|
+
if (utilizationMetrics === undefined || utilizationMetrics.length === 0) {
|
|
83
|
+
return _jsx(_Fragment, {});
|
|
84
|
+
}
|
|
85
|
+
return (_jsxs("div", { children: [utilizationMetrics.map(({ name, humanReadableName, data }) => {
|
|
86
|
+
if (name !== 'gpu_pcie_throughput_transmit_bytes' &&
|
|
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) }));
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}), throughputMetrics.length > 0 && (_jsx(AreaChart, { transmitData: throughputMetrics[0].data, receiveData: throughputMetrics[1].data, addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, name: throughputMetrics[0].name, humanReadableName: throughputMetrics[0].humanReadableName, from: querySelection.from, to: querySelection.to, utilizationMetricsLoading: utilizationMetricsLoading }))] }));
|
|
92
|
+
};
|
|
78
93
|
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 !== '' &&
|
|
79
94
|
querySelection.from !== undefined &&
|
|
80
|
-
querySelection.to !== undefined ? (_jsx(_Fragment, { children: utilizationMetrics !== undefined ? (
|
|
95
|
+
querySelection.to !== undefined ? (_jsx(_Fragment, { children: utilizationMetrics !== undefined ? (_jsx(UtilizationGraphToShow, { utilizationMetrics: utilizationMetrics })) : (_jsx(_Fragment, { children: _jsx(ProfileMetricsGraph, { queryClient: queryClient, queryExpression: querySelection.expression, from: querySelection.from, to: querySelection.to, profile: profileSelection, comparing: comparing, sumBy: querySelection.sumBy ?? sumBy ?? [], sumByLoading: defaultSumByLoading, setTimeRange: handleTimeRangeChange, addLabelMatcher: addLabelMatcher, onPointClick: handlePointClick }) })) })) : (profileSelection === null && (_jsx("div", { className: "p-2", children: _jsx(ProfileMetricsEmptyState, { message: "Please select a profile type and click 'Search' to begin." }) }))) }) }))] }));
|
|
81
96
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.498",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@headlessui/react": "^1.7.19",
|
|
7
7
|
"@iconify/react": "^4.0.0",
|
|
8
8
|
"@parca/client": "0.16.128",
|
|
9
|
-
"@parca/components": "0.16.
|
|
9
|
+
"@parca/components": "0.16.329",
|
|
10
10
|
"@parca/dynamicsize": "0.16.65",
|
|
11
|
-
"@parca/hooks": "0.0.
|
|
11
|
+
"@parca/hooks": "0.0.84",
|
|
12
12
|
"@parca/icons": "0.16.71",
|
|
13
13
|
"@parca/parser": "0.16.78",
|
|
14
|
-
"@parca/store": "0.16.
|
|
15
|
-
"@parca/utilities": "0.0.
|
|
14
|
+
"@parca/store": "0.16.169",
|
|
15
|
+
"@parca/utilities": "0.0.95",
|
|
16
16
|
"@popperjs/core": "^2.11.8",
|
|
17
17
|
"@protobuf-ts/runtime-rpc": "^2.5.0",
|
|
18
18
|
"@storybook/preview-api": "^8.4.3",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"access": "public",
|
|
78
78
|
"registry": "https://registry.npmjs.org/"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "fc0740783d9673d30bf0020d3744bceaba02a345"
|
|
81
81
|
}
|
|
@@ -0,0 +1,605 @@
|
|
|
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
|
+
|
|
14
|
+
import {Fragment, useCallback, useId, useMemo, useRef, useState} from 'react';
|
|
15
|
+
|
|
16
|
+
import * as d3 from 'd3';
|
|
17
|
+
import {pointer} from 'd3-selection';
|
|
18
|
+
import {AnimatePresence, motion} from 'framer-motion';
|
|
19
|
+
import throttle from 'lodash.throttle';
|
|
20
|
+
import {useContextMenu} from 'react-contexify';
|
|
21
|
+
|
|
22
|
+
import {DateTimeRange, MetricsGraphSkeleton, useParcaContext, useURLState} from '@parca/components';
|
|
23
|
+
import {Matcher} from '@parca/parser';
|
|
24
|
+
import {formatDate, formatForTimespan, getPrecision, valueFormatter} from '@parca/utilities';
|
|
25
|
+
|
|
26
|
+
import {type UtilizationMetrics as MetricSeries} from '../../ProfileSelector';
|
|
27
|
+
import MetricsContextMenu from '../MetricsContextMenu';
|
|
28
|
+
import MetricsTooltip from '../MetricsTooltip';
|
|
29
|
+
import {useMetricsGraphDimensions} from '../useMetricsGraphDimensions';
|
|
30
|
+
|
|
31
|
+
interface NetworkLabel {
|
|
32
|
+
name: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface NetworkSeries {
|
|
37
|
+
metric: NetworkLabel[];
|
|
38
|
+
values: number[][];
|
|
39
|
+
labelset: string;
|
|
40
|
+
isReceive?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface CommonProps {
|
|
44
|
+
transmitData: MetricSeries[];
|
|
45
|
+
receiveData: MetricSeries[];
|
|
46
|
+
addLabelMatcher: (
|
|
47
|
+
labels: {key: string; value: string} | Array<{key: string; value: string}>
|
|
48
|
+
) => void;
|
|
49
|
+
setTimeRange: (range: DateTimeRange) => void;
|
|
50
|
+
name: string;
|
|
51
|
+
humanReadableName: string;
|
|
52
|
+
from: number;
|
|
53
|
+
to: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type RawAreaChartProps = CommonProps & {
|
|
57
|
+
width: number;
|
|
58
|
+
height: number;
|
|
59
|
+
margin: number;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type Props = CommonProps & {
|
|
63
|
+
utilizationMetricsLoading?: boolean;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
interface MetricsSample {
|
|
67
|
+
timestamp: number;
|
|
68
|
+
value: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function transformToSeries(data: MetricSeries[], isReceive = false): NetworkSeries[] {
|
|
72
|
+
const series: NetworkSeries[] = data.reduce<NetworkSeries[]>(function (
|
|
73
|
+
agg: NetworkSeries[],
|
|
74
|
+
s: MetricSeries
|
|
75
|
+
) {
|
|
76
|
+
if (s.labelset !== undefined) {
|
|
77
|
+
const metric = s.labelset.labels.sort((a, b) => a.name.localeCompare(b.name));
|
|
78
|
+
agg.push({
|
|
79
|
+
metric,
|
|
80
|
+
values: s.samples.reduce<number[][]>(function (agg: number[][], d: MetricsSample) {
|
|
81
|
+
if (d.timestamp !== undefined && d.value !== undefined) {
|
|
82
|
+
// Multiply receive values by -1 to display below zero
|
|
83
|
+
const value = isReceive ? -1 * d.value : d.value;
|
|
84
|
+
agg.push([d.timestamp, value]);
|
|
85
|
+
}
|
|
86
|
+
return agg;
|
|
87
|
+
}, []),
|
|
88
|
+
labelset: metric.map(m => `${m.name}=${m.value}`).join(','),
|
|
89
|
+
isReceive,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return agg;
|
|
93
|
+
},
|
|
94
|
+
[]);
|
|
95
|
+
|
|
96
|
+
// Sort values by timestamp for each series
|
|
97
|
+
return series.map(series => ({
|
|
98
|
+
...series,
|
|
99
|
+
values: series.values.sort((a, b) => a[0] - b[0]),
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const getYAxisUnit = (name: string): string => {
|
|
104
|
+
switch (name) {
|
|
105
|
+
case 'gpu_utilization_percent':
|
|
106
|
+
return 'percent';
|
|
107
|
+
case 'gpu_memory_utilization_percent':
|
|
108
|
+
return 'percent';
|
|
109
|
+
case 'gpu_power_watt':
|
|
110
|
+
return 'watts';
|
|
111
|
+
case 'gpu_pcie_throughput_transmit_bytes':
|
|
112
|
+
return 'bytes_per_second';
|
|
113
|
+
case 'gpu_pcie_throughput_receive_bytes':
|
|
114
|
+
return 'bytes_per_second';
|
|
115
|
+
default:
|
|
116
|
+
return 'percent';
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const RawAreaChart = ({
|
|
121
|
+
transmitData,
|
|
122
|
+
receiveData,
|
|
123
|
+
addLabelMatcher,
|
|
124
|
+
setTimeRange,
|
|
125
|
+
width,
|
|
126
|
+
height,
|
|
127
|
+
margin,
|
|
128
|
+
name,
|
|
129
|
+
humanReadableName,
|
|
130
|
+
from,
|
|
131
|
+
to,
|
|
132
|
+
}: RawAreaChartProps): JSX.Element => {
|
|
133
|
+
const {timezone} = useParcaContext();
|
|
134
|
+
const graph = useRef(null);
|
|
135
|
+
const [dragging, setDragging] = useState(false);
|
|
136
|
+
const [hovering, setHovering] = useState(false);
|
|
137
|
+
const [relPos, setRelPos] = useState(-1);
|
|
138
|
+
const [pos, setPos] = useState([0, 0]);
|
|
139
|
+
const [isContextMenuOpen, setIsContextMenuOpen] = useState<boolean>(false);
|
|
140
|
+
const idForContextMenu = useId();
|
|
141
|
+
const [selectedSeries, setSelectedSeries] = useURLState<string>('selectedSeries');
|
|
142
|
+
const [_, setSelectedTimeframe] = useURLState('gpu_selected_timeframe');
|
|
143
|
+
|
|
144
|
+
const parsedSelectedSeries: Matcher[] = useMemo(() => {
|
|
145
|
+
if (selectedSeries === undefined) {
|
|
146
|
+
return [];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return JSON.parse(decodeURIComponent(selectedSeries));
|
|
150
|
+
}, [selectedSeries]);
|
|
151
|
+
|
|
152
|
+
const lineStroke = '1px';
|
|
153
|
+
const lineStrokeHover = '2px';
|
|
154
|
+
const lineStrokeSelected = '3px';
|
|
155
|
+
|
|
156
|
+
const graphWidth = width - margin * 1.5 - margin / 2;
|
|
157
|
+
|
|
158
|
+
const paddedFrom = from;
|
|
159
|
+
const paddedTo = to;
|
|
160
|
+
|
|
161
|
+
const series = useMemo(() => {
|
|
162
|
+
const transmitSeries = transformToSeries(transmitData);
|
|
163
|
+
const receiveSeries = transformToSeries(receiveData, true);
|
|
164
|
+
return [...transmitSeries, ...receiveSeries];
|
|
165
|
+
}, [transmitData, receiveData]);
|
|
166
|
+
|
|
167
|
+
const extentsY = series.map(function (s) {
|
|
168
|
+
return d3.extent(s.values, function (d) {
|
|
169
|
+
return d[1];
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const minY = d3.min(extentsY, function (d) {
|
|
174
|
+
return d[0];
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
const maxY = d3.max(extentsY, function (d) {
|
|
178
|
+
return d[1];
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// Setup scales with padded time range
|
|
182
|
+
const xScale = d3.scaleUtc().domain([paddedFrom, paddedTo]).range([0, graphWidth]);
|
|
183
|
+
|
|
184
|
+
const yScale = d3
|
|
185
|
+
.scaleLinear()
|
|
186
|
+
// Ensure domain is symmetric around 0 for balanced visualization
|
|
187
|
+
.domain([minY ?? 0, maxY ?? 0])
|
|
188
|
+
.range([height - margin, 0])
|
|
189
|
+
.nice();
|
|
190
|
+
|
|
191
|
+
const throttledSetPos = throttle(setPos, 20);
|
|
192
|
+
|
|
193
|
+
const onMouseMove = (e: React.MouseEvent<SVGSVGElement | HTMLDivElement, MouseEvent>): void => {
|
|
194
|
+
if (isContextMenuOpen) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// X/Y coordinate array relative to svg
|
|
199
|
+
const rel = pointer(e);
|
|
200
|
+
|
|
201
|
+
const xCoordinate = rel[0];
|
|
202
|
+
const xCoordinateWithoutMargin = xCoordinate - margin;
|
|
203
|
+
const yCoordinate = rel[1];
|
|
204
|
+
const yCoordinateWithoutMargin = yCoordinate - margin;
|
|
205
|
+
|
|
206
|
+
throttledSetPos([xCoordinateWithoutMargin, yCoordinateWithoutMargin]);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const trackVisibility = (isVisible: boolean): void => {
|
|
210
|
+
setIsContextMenuOpen(isVisible);
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
const MENU_ID = `areachart-context-menu-${idForContextMenu}`;
|
|
214
|
+
|
|
215
|
+
const {show} = useContextMenu({
|
|
216
|
+
id: MENU_ID,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
const displayMenu = useCallback(
|
|
220
|
+
(e: React.MouseEvent): void => {
|
|
221
|
+
show({
|
|
222
|
+
event: e,
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
[show]
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
const getSeriesColor = (series: NetworkSeries): string => {
|
|
229
|
+
return series.isReceive === true ? '#EAB308' : '#22C55E'; // Yellow for receive, Green for transmit
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// Create area generator for transmit (above zero)
|
|
233
|
+
const transmitArea = d3
|
|
234
|
+
.area<number[]>()
|
|
235
|
+
.x(d => xScale(d[0]))
|
|
236
|
+
.y0(yScale(0)) // Start from zero line
|
|
237
|
+
.y1(d => yScale(d[1])); // Top of the area (data point)
|
|
238
|
+
|
|
239
|
+
// Create area generator for receive (below zero)
|
|
240
|
+
const receiveArea = d3
|
|
241
|
+
.area<number[]>()
|
|
242
|
+
.x(d => xScale(d[0]))
|
|
243
|
+
.y0(yScale(0)) // Start from zero line
|
|
244
|
+
.y1(d => yScale(d[1])); // Bottom of the area (negative data point)
|
|
245
|
+
|
|
246
|
+
const highlighted = useMemo(() => {
|
|
247
|
+
if (series.length === 0) {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Return the closest point as the highlighted point
|
|
252
|
+
const closestPointPerSeries = series.map(function (s) {
|
|
253
|
+
const distances = s.values.map(d => {
|
|
254
|
+
const x = xScale(d[0]) + margin / 2;
|
|
255
|
+
const y = yScale(d[1]) - margin / 3;
|
|
256
|
+
|
|
257
|
+
return Math.sqrt(Math.pow(pos[0] - x, 2) + Math.pow(pos[1] - y, 2));
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
const pointIndex = d3.minIndex(distances);
|
|
261
|
+
const minDistance = distances[pointIndex];
|
|
262
|
+
|
|
263
|
+
return {
|
|
264
|
+
pointIndex,
|
|
265
|
+
distance: minDistance,
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
const closestSeriesIndex = d3.minIndex(closestPointPerSeries, s => s.distance);
|
|
270
|
+
const pointIndex = closestPointPerSeries[closestSeriesIndex].pointIndex;
|
|
271
|
+
const point = series[closestSeriesIndex].values[pointIndex];
|
|
272
|
+
return {
|
|
273
|
+
seriesIndex: closestSeriesIndex,
|
|
274
|
+
labels: series[closestSeriesIndex].metric,
|
|
275
|
+
timestamp: point[0],
|
|
276
|
+
valuePerSecond: point[1],
|
|
277
|
+
value: point[2],
|
|
278
|
+
duration: point[3],
|
|
279
|
+
x: xScale(point[0]),
|
|
280
|
+
y: yScale(point[1]),
|
|
281
|
+
};
|
|
282
|
+
}, [pos, series, xScale, yScale, margin]);
|
|
283
|
+
|
|
284
|
+
const onMouseDown = (e: React.MouseEvent<SVGSVGElement | HTMLDivElement, MouseEvent>): void => {
|
|
285
|
+
// only left mouse button
|
|
286
|
+
if (e.button !== 0) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// X/Y coordinate array relative to svg
|
|
291
|
+
const rel = pointer(e);
|
|
292
|
+
|
|
293
|
+
const xCoordinate = rel[0];
|
|
294
|
+
const xCoordinateWithoutMargin = xCoordinate - margin;
|
|
295
|
+
if (xCoordinateWithoutMargin >= 0) {
|
|
296
|
+
setRelPos(xCoordinateWithoutMargin);
|
|
297
|
+
setDragging(true);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
e.stopPropagation();
|
|
301
|
+
e.preventDefault();
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
const onMouseUp = (e: React.MouseEvent<SVGSVGElement | HTMLDivElement, MouseEvent>): void => {
|
|
305
|
+
setDragging(false);
|
|
306
|
+
|
|
307
|
+
if (relPos === -1) {
|
|
308
|
+
// MouseDown happened outside of this element.
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// This is a normal click. We tolerate tiny movements to still be a
|
|
313
|
+
// click as they can occur when clicking based on user feedback.
|
|
314
|
+
if (Math.abs(relPos - pos[0]) <= 1) {
|
|
315
|
+
setRelPos(-1);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
let startPos = relPos;
|
|
320
|
+
let endPos = pos[0];
|
|
321
|
+
|
|
322
|
+
if (startPos > endPos) {
|
|
323
|
+
startPos = pos[0];
|
|
324
|
+
endPos = relPos;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const startCorrection = 10;
|
|
328
|
+
const endCorrection = 30;
|
|
329
|
+
|
|
330
|
+
const firstTime = xScale.invert(startPos - startCorrection).valueOf();
|
|
331
|
+
const secondTime = xScale.invert(endPos - endCorrection).valueOf();
|
|
332
|
+
|
|
333
|
+
setTimeRange(DateTimeRange.fromAbsoluteDates(firstTime, secondTime));
|
|
334
|
+
|
|
335
|
+
setRelPos(-1);
|
|
336
|
+
|
|
337
|
+
e.stopPropagation();
|
|
338
|
+
e.preventDefault();
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
return (
|
|
342
|
+
<>
|
|
343
|
+
<MetricsContextMenu
|
|
344
|
+
onAddLabelMatcher={addLabelMatcher}
|
|
345
|
+
menuId={MENU_ID}
|
|
346
|
+
highlighted={highlighted}
|
|
347
|
+
trackVisibility={trackVisibility}
|
|
348
|
+
utilizationMetrics={true}
|
|
349
|
+
/>
|
|
350
|
+
|
|
351
|
+
{highlighted != null && hovering && !dragging && pos[0] !== 0 && pos[1] !== 0 && (
|
|
352
|
+
<div
|
|
353
|
+
onMouseMove={onMouseMove}
|
|
354
|
+
onMouseEnter={() => setHovering(true)}
|
|
355
|
+
onMouseLeave={() => setHovering(false)}
|
|
356
|
+
>
|
|
357
|
+
{!isContextMenuOpen && (
|
|
358
|
+
<MetricsTooltip
|
|
359
|
+
x={pos[0] + margin}
|
|
360
|
+
y={pos[1] + margin}
|
|
361
|
+
highlighted={{
|
|
362
|
+
...highlighted,
|
|
363
|
+
valuePerSecond: Math.abs(highlighted.valuePerSecond), // Show absolute value in tooltip
|
|
364
|
+
}}
|
|
365
|
+
contextElement={graph.current}
|
|
366
|
+
sampleUnit={getYAxisUnit(name)}
|
|
367
|
+
delta={false}
|
|
368
|
+
utilizationMetrics={true}
|
|
369
|
+
/>
|
|
370
|
+
)}
|
|
371
|
+
</div>
|
|
372
|
+
)}
|
|
373
|
+
<div
|
|
374
|
+
ref={graph}
|
|
375
|
+
onMouseEnter={() => setHovering(true)}
|
|
376
|
+
onMouseLeave={() => setHovering(false)}
|
|
377
|
+
onContextMenu={displayMenu}
|
|
378
|
+
>
|
|
379
|
+
<svg
|
|
380
|
+
width={`${width}px`}
|
|
381
|
+
height={`${height + margin}px`}
|
|
382
|
+
onMouseDown={onMouseDown}
|
|
383
|
+
onMouseUp={onMouseUp}
|
|
384
|
+
onMouseMove={onMouseMove}
|
|
385
|
+
>
|
|
386
|
+
<g transform={`translate(${margin}, 0)`}>
|
|
387
|
+
{dragging && (
|
|
388
|
+
<g className="zoom-time-rect">
|
|
389
|
+
<rect
|
|
390
|
+
className="bar"
|
|
391
|
+
x={pos[0] - relPos < 0 ? pos[0] : relPos}
|
|
392
|
+
y={0}
|
|
393
|
+
height={height}
|
|
394
|
+
width={Math.abs(pos[0] - relPos)}
|
|
395
|
+
fill={'rgba(0, 0, 0, 0.125)'}
|
|
396
|
+
/>
|
|
397
|
+
</g>
|
|
398
|
+
)}
|
|
399
|
+
</g>
|
|
400
|
+
<g transform={`translate(${margin * 1.5}, ${margin / 1.5})`}>
|
|
401
|
+
<g className="y axis" textAnchor="end" fontSize="10" fill="none">
|
|
402
|
+
{yScale.ticks(6).map((d, i, allTicks) => {
|
|
403
|
+
let decimals = 2;
|
|
404
|
+
const intervalBetweenTicks = allTicks[1] - allTicks[0];
|
|
405
|
+
|
|
406
|
+
if (intervalBetweenTicks < 1) {
|
|
407
|
+
const precision = getPrecision(intervalBetweenTicks);
|
|
408
|
+
decimals = precision;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return (
|
|
412
|
+
<Fragment key={`${i.toString()}-${d.toString()}`}>
|
|
413
|
+
<g key={`tick-${i}`} className="tick" transform={`translate(0, ${yScale(d)})`}>
|
|
414
|
+
<line className="stroke-gray-300 dark:stroke-gray-500" x2={-6} />
|
|
415
|
+
<text fill="currentColor" x={-9} dy={'0.32em'}>
|
|
416
|
+
{d < 0 ? '-' : ''}
|
|
417
|
+
{valueFormatter(Math.abs(d), getYAxisUnit(name), decimals)}
|
|
418
|
+
</text>
|
|
419
|
+
</g>
|
|
420
|
+
<g key={`grid-${i}`}>
|
|
421
|
+
<line
|
|
422
|
+
className="stroke-gray-300 dark:stroke-gray-500"
|
|
423
|
+
x1={xScale(from)}
|
|
424
|
+
x2={xScale(to)}
|
|
425
|
+
y1={yScale(d)}
|
|
426
|
+
y2={yScale(d)}
|
|
427
|
+
/>
|
|
428
|
+
</g>
|
|
429
|
+
</Fragment>
|
|
430
|
+
);
|
|
431
|
+
})}
|
|
432
|
+
<line
|
|
433
|
+
className="stroke-gray-300 dark:stroke-gray-500"
|
|
434
|
+
x1={0}
|
|
435
|
+
x2={0}
|
|
436
|
+
y1={0}
|
|
437
|
+
y2={height - margin}
|
|
438
|
+
/>
|
|
439
|
+
<line
|
|
440
|
+
className="stroke-gray-300 dark:stroke-gray-500"
|
|
441
|
+
x1={xScale(to)}
|
|
442
|
+
x2={xScale(to)}
|
|
443
|
+
y1={0}
|
|
444
|
+
y2={height - margin}
|
|
445
|
+
/>
|
|
446
|
+
<g transform={`translate(${-margin}, ${(height - margin) / 2}) rotate(270)`}>
|
|
447
|
+
<text
|
|
448
|
+
fill="currentColor"
|
|
449
|
+
dy="-0.7em"
|
|
450
|
+
className="text-sm capitalize"
|
|
451
|
+
textAnchor="middle"
|
|
452
|
+
>
|
|
453
|
+
{humanReadableName}
|
|
454
|
+
</text>
|
|
455
|
+
</g>
|
|
456
|
+
</g>
|
|
457
|
+
<g
|
|
458
|
+
className="x axis"
|
|
459
|
+
fill="none"
|
|
460
|
+
fontSize="10"
|
|
461
|
+
textAnchor="middle"
|
|
462
|
+
transform={`translate(0,${height - margin})`}
|
|
463
|
+
>
|
|
464
|
+
{xScale.ticks(5).map((d, i) => (
|
|
465
|
+
<Fragment key={`${i.toString()}-${d.toString()}`}>
|
|
466
|
+
<g
|
|
467
|
+
key={`tick-${i}`}
|
|
468
|
+
className="tick"
|
|
469
|
+
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
|
|
470
|
+
transform={`translate(${xScale(d)}, 0)`}
|
|
471
|
+
>
|
|
472
|
+
<line y2={6} className="stroke-gray-300 dark:stroke-gray-500" />
|
|
473
|
+
<text fill="currentColor" dy=".71em" y={9}>
|
|
474
|
+
{formatDate(d, formatForTimespan(from, to), timezone)}
|
|
475
|
+
</text>
|
|
476
|
+
</g>
|
|
477
|
+
<g key={`grid-${i}`}>
|
|
478
|
+
<line
|
|
479
|
+
className="stroke-gray-300 dark:stroke-gray-500"
|
|
480
|
+
x1={xScale(d)}
|
|
481
|
+
x2={xScale(d)}
|
|
482
|
+
y1={0}
|
|
483
|
+
y2={-height + margin}
|
|
484
|
+
/>
|
|
485
|
+
</g>
|
|
486
|
+
</Fragment>
|
|
487
|
+
))}
|
|
488
|
+
<line
|
|
489
|
+
className="stroke-gray-300 dark:stroke-gray-500"
|
|
490
|
+
x1={0}
|
|
491
|
+
x2={graphWidth}
|
|
492
|
+
y1={0}
|
|
493
|
+
y2={0}
|
|
494
|
+
/>
|
|
495
|
+
<g transform={`translate(${(width - 2.5 * margin) / 2}, ${margin / 2})`}>
|
|
496
|
+
<text fill="currentColor" dy=".71em" y={5} className="text-sm">
|
|
497
|
+
Time
|
|
498
|
+
</text>
|
|
499
|
+
</g>
|
|
500
|
+
</g>
|
|
501
|
+
<g className="areas">
|
|
502
|
+
{series.map((s, i) => {
|
|
503
|
+
let isSelected = false;
|
|
504
|
+
if (parsedSelectedSeries != null && parsedSelectedSeries.length > 0) {
|
|
505
|
+
isSelected = parsedSelectedSeries.every(m => {
|
|
506
|
+
for (let i = 0; i < s.metric.length; i++) {
|
|
507
|
+
if (s.metric[i].name === m.key && s.metric[i].value === m.value) {
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return false;
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const seriesColor = getSeriesColor(s);
|
|
516
|
+
const fillOpacity = isSelected ? 0.4 : 0.2;
|
|
517
|
+
const strokeOpacity = isSelected ? 1 : 0.8;
|
|
518
|
+
const areaGenerator = s.isReceive === true ? receiveArea : transmitArea;
|
|
519
|
+
|
|
520
|
+
return (
|
|
521
|
+
<g key={i} className="area cursor-pointer">
|
|
522
|
+
<path
|
|
523
|
+
d={areaGenerator(s.values) ?? ''}
|
|
524
|
+
fill={seriesColor}
|
|
525
|
+
fillOpacity={fillOpacity}
|
|
526
|
+
stroke={seriesColor}
|
|
527
|
+
strokeWidth={
|
|
528
|
+
isSelected
|
|
529
|
+
? lineStrokeSelected
|
|
530
|
+
: hovering && highlighted != null && i === highlighted.seriesIndex
|
|
531
|
+
? lineStrokeHover
|
|
532
|
+
: lineStroke
|
|
533
|
+
}
|
|
534
|
+
strokeOpacity={strokeOpacity}
|
|
535
|
+
onClick={() => {
|
|
536
|
+
if (highlighted != null) {
|
|
537
|
+
setSelectedSeries(
|
|
538
|
+
JSON.stringify(
|
|
539
|
+
highlighted.labels.map(l => ({
|
|
540
|
+
key: l.name,
|
|
541
|
+
value: l.value,
|
|
542
|
+
}))
|
|
543
|
+
)
|
|
544
|
+
);
|
|
545
|
+
setSelectedTimeframe(undefined);
|
|
546
|
+
}
|
|
547
|
+
}}
|
|
548
|
+
/>
|
|
549
|
+
</g>
|
|
550
|
+
);
|
|
551
|
+
})}
|
|
552
|
+
</g>
|
|
553
|
+
</g>
|
|
554
|
+
</svg>
|
|
555
|
+
</div>
|
|
556
|
+
</>
|
|
557
|
+
);
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
const AreaChart = ({
|
|
561
|
+
transmitData,
|
|
562
|
+
receiveData,
|
|
563
|
+
addLabelMatcher,
|
|
564
|
+
setTimeRange,
|
|
565
|
+
utilizationMetricsLoading,
|
|
566
|
+
name,
|
|
567
|
+
humanReadableName,
|
|
568
|
+
from,
|
|
569
|
+
to,
|
|
570
|
+
}: Props): JSX.Element => {
|
|
571
|
+
const {isDarkMode} = useParcaContext();
|
|
572
|
+
const {width, height, margin, heightStyle} = useMetricsGraphDimensions(false, true);
|
|
573
|
+
|
|
574
|
+
return (
|
|
575
|
+
<AnimatePresence>
|
|
576
|
+
<motion.div
|
|
577
|
+
className="w-full relative"
|
|
578
|
+
key="area-chart-graph-loaded"
|
|
579
|
+
initial={{display: 'none', opacity: 0}}
|
|
580
|
+
animate={{display: 'block', opacity: 1}}
|
|
581
|
+
transition={{duration: 0.5}}
|
|
582
|
+
>
|
|
583
|
+
{utilizationMetricsLoading === true ? (
|
|
584
|
+
<MetricsGraphSkeleton heightStyle={heightStyle} isDarkMode={isDarkMode} isMini={true} />
|
|
585
|
+
) : (
|
|
586
|
+
<RawAreaChart
|
|
587
|
+
transmitData={transmitData}
|
|
588
|
+
receiveData={receiveData}
|
|
589
|
+
addLabelMatcher={addLabelMatcher}
|
|
590
|
+
setTimeRange={setTimeRange}
|
|
591
|
+
width={width}
|
|
592
|
+
height={height}
|
|
593
|
+
margin={margin}
|
|
594
|
+
name={name}
|
|
595
|
+
humanReadableName={humanReadableName}
|
|
596
|
+
from={from}
|
|
597
|
+
to={to}
|
|
598
|
+
/>
|
|
599
|
+
)}
|
|
600
|
+
</motion.div>
|
|
601
|
+
</AnimatePresence>
|
|
602
|
+
);
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
export default AreaChart;
|
|
@@ -19,6 +19,7 @@ import {Query} from '@parca/parser';
|
|
|
19
19
|
|
|
20
20
|
import {MergedProfileSelection, ProfileSelection} from '..';
|
|
21
21
|
import UtilizationMetricsGraph from '../MetricsGraph/UtilizationMetrics';
|
|
22
|
+
import AreaChart from '../MetricsGraph/UtilizationMetrics/AreaChart';
|
|
22
23
|
import ProfileMetricsGraph, {ProfileMetricsEmptyState} from '../ProfileMetricsGraph';
|
|
23
24
|
import {QuerySelection, type UtilizationMetrics as UtilizationMetricsType} from './index';
|
|
24
25
|
|
|
@@ -137,6 +138,67 @@ export function MetricsGraphSection({
|
|
|
137
138
|
selectProfile(new MergedProfileSelection(mergeFrom, mergeTo, query));
|
|
138
139
|
};
|
|
139
140
|
|
|
141
|
+
const UtilizationGraphToShow = ({
|
|
142
|
+
utilizationMetrics,
|
|
143
|
+
}: {
|
|
144
|
+
utilizationMetrics: Array<{
|
|
145
|
+
name: string;
|
|
146
|
+
humanReadableName: string;
|
|
147
|
+
data: UtilizationMetricsType[];
|
|
148
|
+
}>;
|
|
149
|
+
}): JSX.Element => {
|
|
150
|
+
const throughputMetrics = utilizationMetrics.filter(
|
|
151
|
+
metric =>
|
|
152
|
+
metric.name === 'gpu_pcie_throughput_transmit_bytes' ||
|
|
153
|
+
metric.name === 'gpu_pcie_throughput_receive_bytes'
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
if (utilizationMetrics === undefined || utilizationMetrics.length === 0) {
|
|
157
|
+
return <></>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<div>
|
|
162
|
+
{utilizationMetrics.map(({name, humanReadableName, data}) => {
|
|
163
|
+
if (
|
|
164
|
+
name !== 'gpu_pcie_throughput_transmit_bytes' &&
|
|
165
|
+
name !== 'gpu_pcie_throughput_receive_bytes'
|
|
166
|
+
) {
|
|
167
|
+
return (
|
|
168
|
+
<>
|
|
169
|
+
<UtilizationMetricsGraph
|
|
170
|
+
key={name}
|
|
171
|
+
data={data}
|
|
172
|
+
addLabelMatcher={addLabelMatcher}
|
|
173
|
+
setTimeRange={handleTimeRangeChange}
|
|
174
|
+
utilizationMetricsLoading={utilizationMetricsLoading}
|
|
175
|
+
name={name}
|
|
176
|
+
humanReadableName={humanReadableName}
|
|
177
|
+
from={querySelection.from}
|
|
178
|
+
to={querySelection.to}
|
|
179
|
+
/>
|
|
180
|
+
</>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
return null;
|
|
184
|
+
})}
|
|
185
|
+
{throughputMetrics.length > 0 && (
|
|
186
|
+
<AreaChart
|
|
187
|
+
transmitData={throughputMetrics[0].data}
|
|
188
|
+
receiveData={throughputMetrics[1].data}
|
|
189
|
+
addLabelMatcher={addLabelMatcher}
|
|
190
|
+
setTimeRange={handleTimeRangeChange}
|
|
191
|
+
name={throughputMetrics[0].name}
|
|
192
|
+
humanReadableName={throughputMetrics[0].humanReadableName}
|
|
193
|
+
from={querySelection.from}
|
|
194
|
+
to={querySelection.to}
|
|
195
|
+
utilizationMetricsLoading={utilizationMetricsLoading}
|
|
196
|
+
/>
|
|
197
|
+
)}
|
|
198
|
+
</div>
|
|
199
|
+
);
|
|
200
|
+
};
|
|
201
|
+
|
|
140
202
|
return (
|
|
141
203
|
<div className={cx('relative', {'py-4': !showMetricsGraph})}>
|
|
142
204
|
{setDisplayHideMetricsGraphButton != null ? (
|
|
@@ -159,21 +221,7 @@ export function MetricsGraphSection({
|
|
|
159
221
|
querySelection.to !== undefined ? (
|
|
160
222
|
<>
|
|
161
223
|
{utilizationMetrics !== undefined ? (
|
|
162
|
-
utilizationMetrics
|
|
163
|
-
<>
|
|
164
|
-
<UtilizationMetricsGraph
|
|
165
|
-
key={name}
|
|
166
|
-
data={data}
|
|
167
|
-
addLabelMatcher={addLabelMatcher}
|
|
168
|
-
setTimeRange={handleTimeRangeChange}
|
|
169
|
-
utilizationMetricsLoading={utilizationMetricsLoading}
|
|
170
|
-
name={name}
|
|
171
|
-
humanReadableName={humanReadableName}
|
|
172
|
-
from={querySelection.from}
|
|
173
|
-
to={querySelection.to}
|
|
174
|
-
/>
|
|
175
|
-
</>
|
|
176
|
-
))
|
|
224
|
+
<UtilizationGraphToShow utilizationMetrics={utilizationMetrics} />
|
|
177
225
|
) : (
|
|
178
226
|
<>
|
|
179
227
|
<ProfileMetricsGraph
|