@parca/profile 0.16.486 → 0.16.488

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 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.16.488](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.487...@parca/profile@0.16.488) (2025-03-19)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.487](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.486...@parca/profile@0.16.487) (2025-03-18)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.486](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.485...@parca/profile@0.16.486) (2025-03-12)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -10,6 +10,10 @@ interface CommonProps {
10
10
  value: string;
11
11
  }>) => void;
12
12
  setTimeRange: (range: DateTimeRange) => void;
13
+ name: string;
14
+ humanReadableName: string;
15
+ from: number;
16
+ to: number;
13
17
  }
14
18
  type Props = CommonProps & {
15
19
  data: MetricSeries[];
@@ -23,6 +27,6 @@ type Props = CommonProps & {
23
27
  setTimeRange: (range: DateTimeRange) => void;
24
28
  utilizationMetricsLoading?: boolean;
25
29
  };
26
- declare const UtilizationMetrics: ({ data, addLabelMatcher, setTimeRange, utilizationMetricsLoading, }: Props) => JSX.Element;
30
+ declare const UtilizationMetrics: ({ data, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, }: Props) => JSX.Element;
27
31
  export default UtilizationMetrics;
28
32
  //# 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,mBAAm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AM,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,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;AAodF,QAAA,MAAM,kBAAkB,2GASrB,KAAK,KAAG,GAAG,CAAC,OAgCd,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -46,7 +46,19 @@ function transformToSeries(data) {
46
46
  values: series.values.sort((a, b) => a[0] - b[0]),
47
47
  }));
48
48
  }
49
- const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, height, margin, }) => {
49
+ const getYAxisUnit = (name) => {
50
+ switch (name) {
51
+ case 'gpu_utilization_percent':
52
+ return 'percent';
53
+ case 'gpu_memory_utilization_percent':
54
+ return 'percent';
55
+ case 'gpu_power_watt':
56
+ return 'watts';
57
+ default:
58
+ return 'percent';
59
+ }
60
+ };
61
+ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, height, margin, name, humanReadableName, from, to, }) => {
50
62
  const { timezone } = useParcaContext();
51
63
  const graph = useRef(null);
52
64
  const [dragging, setDragging] = useState(false);
@@ -67,9 +79,6 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
67
79
  const lineStrokeHover = '2px';
68
80
  const lineStrokeSelected = '3px';
69
81
  const graphWidth = width - margin * 1.5 - margin / 2;
70
- const timeExtent = d3.extent(data.flatMap(d => d.samples.map(s => s.timestamp)));
71
- const from = timeExtent[0] ?? 0;
72
- const to = timeExtent[1] ?? 0;
73
82
  const paddedFrom = from;
74
83
  const paddedTo = to;
75
84
  const series = useMemo(() => transformToSeries(data), [data]);
@@ -194,7 +203,7 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
194
203
  e.stopPropagation();
195
204
  e.preventDefault();
196
205
  };
197
- 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: highlighted, contextElement: graph.current, sampleUnit: "%", delta: false, utilizationMetrics: true })) })), _jsx("div", { ref: graph, onMouseEnter: function () {
206
+ 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: highlighted, contextElement: graph.current, sampleUnit: getYAxisUnit(name), delta: false, utilizationMetrics: true })) })), _jsx("div", { ref: graph, onMouseEnter: function () {
198
207
  setHovering(true);
199
208
  }, 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(3).map((d, i, allTicks) => {
200
209
  let decimals = 2;
@@ -205,8 +214,8 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
205
214
  }
206
215
  return (_jsxs(Fragment, { children: [_jsxs("g", { className: "tick",
207
216
  /* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
208
- transform: `translate(0, ${yScale(d)})`, children: [_jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x2: -6 }), _jsx("text", { fill: "currentColor", x: -9, dy: '0.32em', children: valueFormatter(d, 'percent', 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()}`));
209
- }), _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: "Utilization" }) })] }), _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",
217
+ transform: `translate(0, ${yScale(d)})`, children: [_jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x2: -6 }), _jsx("text", { fill: "currentColor", x: -9, dy: '0.32em', children: valueFormatter(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()}`));
218
+ }), _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",
210
219
  /* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
211
220
  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: "lines fill-transparent", children: series.map((s, i) => {
212
221
  let isSelected = false;
@@ -236,9 +245,9 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
236
245
  } }) }, i));
237
246
  }) })] })] }) })] }));
238
247
  };
239
- const UtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, utilizationMetricsLoading, }) => {
248
+ const UtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, utilizationMetricsLoading, name, humanReadableName, from, to, }) => {
240
249
  const { isDarkMode } = useParcaContext();
241
250
  const { width, height, margin, heightStyle } = useMetricsGraphDimensions(false, true);
242
- 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 })) }, "utilization-metrics-graph-loaded") }));
251
+ 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") }));
243
252
  };
244
253
  export default UtilizationMetrics;
@@ -20,7 +20,11 @@ interface MetricsGraphSectionProps {
20
20
  query: Query;
21
21
  setNewQueryExpression: (queryExpression: string) => void;
22
22
  setQueryExpression: (updateTs?: boolean) => void;
23
- utilizationMetrics?: UtilizationMetricsType[];
23
+ utilizationMetrics?: Array<{
24
+ name: string;
25
+ humanReadableName: string;
26
+ data: UtilizationMetricsType[];
27
+ }>;
24
28
  utilizationMetricsLoading?: boolean;
25
29
  }
26
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;
@@ -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;AAG5D,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;IACv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C,OAAO,CA2IxC"}
@@ -77,5 +77,5 @@ export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGra
77
77
  };
78
78
  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
79
  querySelection.from !== undefined &&
80
- querySelection.to !== undefined ? (_jsx(_Fragment, { children: utilizationMetrics !== undefined ? (_jsx(UtilizationMetricsGraph, { data: utilizationMetrics, addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, utilizationMetricsLoading: utilizationMetricsLoading })) : (_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." }) }))) }) }))] }));
80
+ querySelection.to !== undefined ? (_jsx(_Fragment, { children: utilizationMetrics !== undefined ? (utilizationMetrics.map(({ name, humanReadableName, data }) => (_jsx(_Fragment, { children: _jsx(UtilizationMetricsGraph, { data: data, addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, utilizationMetricsLoading: utilizationMetricsLoading, name: name, humanReadableName: humanReadableName, from: querySelection.from, to: querySelection.to }, name) })))) : (_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
81
  }
@@ -48,7 +48,11 @@ interface ProfileSelectorProps extends ProfileSelectorFeatures {
48
48
  navigateTo: NavigateFunction;
49
49
  setDisplayHideMetricsGraphButton?: Dispatch<SetStateAction<boolean>>;
50
50
  suffix?: string;
51
- utilizationMetrics?: UtilizationMetrics[];
51
+ utilizationMetrics?: Array<{
52
+ name: string;
53
+ humanReadableName: string;
54
+ data: UtilizationMetrics[];
55
+ }>;
52
56
  utilizationMetricsLoading?: boolean;
53
57
  utilizationLabels?: UtilizationLabels;
54
58
  }
@@ -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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zB,IAAI,EAAE,MAAM,CAAC;QACb,iBAAiB,EAAE,MAAM,CAAC;QAC1B,IAAI,EAAE,kBAAkB,EAAE,CAAC;KAC5B,CAAC,CAAC;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;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,2UAkBlB,oBAAoB,KAAG,GAAG,CAAC,OAiN7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -140,6 +140,8 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
140
140
  queryExpressionString === '{}';
141
141
  const queryBrowserRef = useRef(null);
142
142
  const sumByRef = useRef(null);
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 ?? [], 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: 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 })] }) }));
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 ?? [], 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
+ ? '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 })] }) }));
144
146
  };
145
147
  export default ProfileSelector;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.486",
3
+ "version": "0.16.488",
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.127",
9
- "@parca/components": "0.16.323",
9
+ "@parca/components": "0.16.324",
10
10
  "@parca/dynamicsize": "0.16.65",
11
- "@parca/hooks": "0.0.80",
11
+ "@parca/hooks": "0.0.81",
12
12
  "@parca/icons": "0.16.71",
13
13
  "@parca/parser": "0.16.78",
14
- "@parca/store": "0.16.166",
15
- "@parca/utilities": "0.0.92",
14
+ "@parca/store": "0.16.167",
15
+ "@parca/utilities": "0.0.93",
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": "f970fa2046e730608d9591d04d39f17ed714aa54"
80
+ "gitHead": "8ff4bd148bfc490a9b5167e0acb4cb89937cadb4"
81
81
  }
@@ -36,6 +36,10 @@ interface CommonProps {
36
36
  labels: {key: string; value: string} | Array<{key: string; value: string}>
37
37
  ) => void;
38
38
  setTimeRange: (range: DateTimeRange) => void;
39
+ name: string;
40
+ humanReadableName: string;
41
+ from: number;
42
+ to: number;
39
43
  }
40
44
 
41
45
  type RawUtilizationMetricsProps = CommonProps & {
@@ -83,6 +87,19 @@ function transformToSeries(data: MetricSeries[]): Series[] {
83
87
  }));
84
88
  }
85
89
 
90
+ const getYAxisUnit = (name: string): string => {
91
+ switch (name) {
92
+ case 'gpu_utilization_percent':
93
+ return 'percent';
94
+ case 'gpu_memory_utilization_percent':
95
+ return 'percent';
96
+ case 'gpu_power_watt':
97
+ return 'watts';
98
+ default:
99
+ return 'percent';
100
+ }
101
+ };
102
+
86
103
  const RawUtilizationMetrics = ({
87
104
  data,
88
105
  addLabelMatcher,
@@ -90,6 +107,10 @@ const RawUtilizationMetrics = ({
90
107
  width,
91
108
  height,
92
109
  margin,
110
+ name,
111
+ humanReadableName,
112
+ from,
113
+ to,
93
114
  }: RawUtilizationMetricsProps): JSX.Element => {
94
115
  const {timezone} = useParcaContext();
95
116
  const graph = useRef(null);
@@ -116,10 +137,6 @@ const RawUtilizationMetrics = ({
116
137
 
117
138
  const graphWidth = width - margin * 1.5 - margin / 2;
118
139
 
119
- const timeExtent = d3.extent(data.flatMap(d => d.samples.map(s => s.timestamp)));
120
- const from = timeExtent[0] ?? 0;
121
- const to = timeExtent[1] ?? 0;
122
-
123
140
  const paddedFrom = from;
124
141
  const paddedTo = to;
125
142
 
@@ -310,7 +327,7 @@ const RawUtilizationMetrics = ({
310
327
  y={pos[1] + margin}
311
328
  highlighted={highlighted}
312
329
  contextElement={graph.current}
313
- sampleUnit="%"
330
+ sampleUnit={getYAxisUnit(name)}
314
331
  delta={false}
315
332
  utilizationMetrics={true}
316
333
  />
@@ -367,7 +384,7 @@ const RawUtilizationMetrics = ({
367
384
  >
368
385
  <line className="stroke-gray-300 dark:stroke-gray-500" x2={-6} />
369
386
  <text fill="currentColor" x={-9} dy={'0.32em'}>
370
- {valueFormatter(d, 'percent', decimals)}
387
+ {valueFormatter(d, getYAxisUnit(name), decimals)}
371
388
  </text>
372
389
  </g>
373
390
  <g key={`grid-${i}`}>
@@ -403,7 +420,7 @@ const RawUtilizationMetrics = ({
403
420
  className="text-sm capitalize"
404
421
  textAnchor="middle"
405
422
  >
406
- Utilization
423
+ {humanReadableName}
407
424
  </text>
408
425
  </g>
409
426
  </g>
@@ -511,6 +528,10 @@ const UtilizationMetrics = ({
511
528
  addLabelMatcher,
512
529
  setTimeRange,
513
530
  utilizationMetricsLoading,
531
+ name,
532
+ humanReadableName,
533
+ from,
534
+ to,
514
535
  }: Props): JSX.Element => {
515
536
  const {isDarkMode} = useParcaContext();
516
537
  const {width, height, margin, heightStyle} = useMetricsGraphDimensions(false, true);
@@ -534,6 +555,10 @@ const UtilizationMetrics = ({
534
555
  width={width}
535
556
  height={height}
536
557
  margin={margin}
558
+ name={name}
559
+ humanReadableName={humanReadableName}
560
+ from={from}
561
+ to={to}
537
562
  />
538
563
  )}
539
564
  </motion.div>
@@ -39,7 +39,11 @@ interface MetricsGraphSectionProps {
39
39
  query: Query;
40
40
  setNewQueryExpression: (queryExpression: string) => void;
41
41
  setQueryExpression: (updateTs?: boolean) => void;
42
- utilizationMetrics?: UtilizationMetricsType[];
42
+ utilizationMetrics?: Array<{
43
+ name: string;
44
+ humanReadableName: string;
45
+ data: UtilizationMetricsType[];
46
+ }>;
43
47
  utilizationMetricsLoading?: boolean;
44
48
  }
45
49
 
@@ -155,12 +159,21 @@ export function MetricsGraphSection({
155
159
  querySelection.to !== undefined ? (
156
160
  <>
157
161
  {utilizationMetrics !== undefined ? (
158
- <UtilizationMetricsGraph
159
- data={utilizationMetrics}
160
- addLabelMatcher={addLabelMatcher}
161
- setTimeRange={handleTimeRangeChange}
162
- utilizationMetricsLoading={utilizationMetricsLoading}
163
- />
162
+ utilizationMetrics.map(({name, humanReadableName, data}) => (
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
+ ))
164
177
  ) : (
165
178
  <>
166
179
  <ProfileMetricsGraph
@@ -85,7 +85,11 @@ interface ProfileSelectorProps extends ProfileSelectorFeatures {
85
85
  navigateTo: NavigateFunction;
86
86
  setDisplayHideMetricsGraphButton?: Dispatch<SetStateAction<boolean>>;
87
87
  suffix?: string;
88
- utilizationMetrics?: UtilizationMetrics[];
88
+ utilizationMetrics?: Array<{
89
+ name: string;
90
+ humanReadableName: string;
91
+ data: UtilizationMetrics[];
92
+ }>;
89
93
  utilizationMetricsLoading?: boolean;
90
94
  utilizationLabels?: UtilizationLabels;
91
95
  }
@@ -279,7 +283,7 @@ const ProfileSelector = ({
279
283
  const sumByRef = useRef(null);
280
284
 
281
285
  return (
282
- <UtilizationLabelsProvider value={utilizationLabels}>
286
+ <UtilizationLabelsProvider value={{...utilizationLabels}}>
283
287
  <>
284
288
  <div className="mb-2 flex">
285
289
  <QueryControls
@@ -319,7 +323,11 @@ const ProfileSelector = ({
319
323
  <MetricsGraphSection
320
324
  showMetricsGraph={showMetricsGraph}
321
325
  setDisplayHideMetricsGraphButton={setDisplayHideMetricsGraphButton}
322
- heightStyle={heightStyle}
326
+ heightStyle={
327
+ utilizationMetrics !== undefined && utilizationMetrics?.length > 0
328
+ ? 'auto'
329
+ : heightStyle
330
+ }
323
331
  querySelection={querySelection}
324
332
  profileSelection={profileSelection}
325
333
  comparing={comparing}