@parca/profile 0.17.7 → 0.17.8
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/MetricsTooltip/index.d.ts +2 -1
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.js +4 -2
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.js +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/index.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/index.js +1 -1
- package/dist/MetricsGraph/index.d.ts +3 -2
- package/dist/MetricsGraph/index.d.ts.map +1 -1
- package/dist/MetricsGraph/index.js +11 -6
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +6 -2
- package/dist/ProfileTypeSelector/index.d.ts.map +1 -1
- package/dist/ProfileTypeSelector/index.js +4 -0
- package/package.json +2 -2
- package/src/MetricsGraph/MetricsTooltip/index.tsx +5 -1
- package/src/MetricsGraph/UtilizationMetrics/Throughput.tsx +1 -0
- package/src/MetricsGraph/UtilizationMetrics/index.tsx +1 -0
- package/src/MetricsGraph/index.tsx +13 -3
- package/src/ProfileMetricsGraph/index.tsx +6 -1
- package/src/ProfileTypeSelector/index.tsx +4 -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.17.8](https://github.com/parca-dev/parca/compare/@parca/profile@0.17.5...@parca/profile@0.17.8) (2025-06-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.17.7](https://github.com/parca-dev/parca/compare/@parca/profile@0.17.6...@parca/profile@0.17.7) (2025-06-05)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -4,11 +4,12 @@ interface Props {
|
|
|
4
4
|
y: number;
|
|
5
5
|
highlighted: HighlightedSeries;
|
|
6
6
|
contextElement: Element | null;
|
|
7
|
+
sampleType: string;
|
|
7
8
|
sampleUnit: string;
|
|
8
9
|
delta: boolean;
|
|
9
10
|
utilizationMetrics?: boolean;
|
|
10
11
|
valuePrefix?: string;
|
|
11
12
|
}
|
|
12
|
-
declare const MetricsTooltip: ({ x, y, highlighted, contextElement, sampleUnit, delta, utilizationMetrics, valuePrefix, }: Props) => JSX.Element;
|
|
13
|
+
declare const MetricsTooltip: ({ x, y, highlighted, contextElement, sampleType, sampleUnit, delta, utilizationMetrics, valuePrefix, }: Props) => JSX.Element;
|
|
13
14
|
export default MetricsTooltip;
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/MetricsTooltip/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAC,iBAAiB,EAAC,MAAM,KAAK,CAAC;AAEtC,UAAU,KAAK;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,iBAAiB,CAAC;IAC/B,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA8BD,QAAA,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/MetricsTooltip/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAC,iBAAiB,EAAC,MAAM,KAAK,CAAC;AAEtC,UAAU,KAAK;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,iBAAiB,CAAC;IAC/B,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA8BD,QAAA,MAAM,cAAc,2GAUjB,KAAK,KAAG,GAAG,CAAC,OAyMd,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -42,7 +42,7 @@ function generateGetBoundingClientRect(contextElement, x = 0, y = 0) {
|
|
|
42
42
|
bottom: domRect.y + y,
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
const MetricsTooltip = ({ x, y, highlighted, contextElement, sampleUnit, delta, utilizationMetrics = false, valuePrefix, }) => {
|
|
45
|
+
const MetricsTooltip = ({ x, y, highlighted, contextElement, sampleType, sampleUnit, delta, utilizationMetrics = false, valuePrefix, }) => {
|
|
46
46
|
const { timezone } = useParcaContext();
|
|
47
47
|
const [popperElement, setPopperElement] = useState(null);
|
|
48
48
|
const { styles, attributes, ...popperProps } = usePopper(virtualElement, popperElement, {
|
|
@@ -91,7 +91,9 @@ const MetricsTooltip = ({ x, y, highlighted, contextElement, sampleUnit, delta,
|
|
|
91
91
|
}, [x, y, contextElement, update]);
|
|
92
92
|
const nameLabel = highlighted?.labels.find(e => e.name === '__name__');
|
|
93
93
|
const highlightedNameLabel = nameLabel !== undefined ? nameLabel : { name: '', value: '' };
|
|
94
|
-
return (_jsx("div", { ref: setPopperElement, style: styles.popper, ...attributes.popper, className: "z-50", children: _jsx("div", { className: "flex max-w-lg", children: _jsx("div", { className: "m-auto", children: _jsx("div", { className: "rounded-lg border-gray-300 bg-gray-50 p-3 opacity-90 shadow-lg dark:border-gray-500 dark:bg-gray-900", style: { borderWidth: 1 }, children: _jsx("div", { className: "flex flex-row", children: _jsxs("div", { className: "ml-2 mr-6", children: [_jsx("span", { className: "font-semibold", children: highlightedNameLabel.value }), _jsx("span", { className: "my-2 block text-gray-700 dark:text-gray-300", children: _jsx("table", { className: "table-auto", children: _jsxs("tbody", { children: [delta ? (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pr-3", children: "Per\u00A0Second" }), _jsx("td", { className: "w-3/4", children: valueFormatter(highlighted.valuePerSecond, sampleUnit === 'nanoseconds'
|
|
94
|
+
return (_jsx("div", { ref: setPopperElement, style: styles.popper, ...attributes.popper, className: "z-50", children: _jsx("div", { className: "flex max-w-lg", children: _jsx("div", { className: "m-auto", children: _jsx("div", { className: "rounded-lg border-gray-300 bg-gray-50 p-3 opacity-90 shadow-lg dark:border-gray-500 dark:bg-gray-900", style: { borderWidth: 1 }, children: _jsx("div", { className: "flex flex-row", children: _jsxs("div", { className: "ml-2 mr-6", children: [_jsx("span", { className: "font-semibold", children: highlightedNameLabel.value }), _jsx("span", { className: "my-2 block text-gray-700 dark:text-gray-300", children: _jsx("table", { className: "table-auto", children: _jsxs("tbody", { children: [delta ? (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pr-3", children: "Per\u00A0Second" }), _jsx("td", { className: "w-3/4", children: valueFormatter(highlighted.valuePerSecond, sampleUnit === 'nanoseconds' && sampleType === 'cpu'
|
|
95
|
+
? 'CPU Cores'
|
|
96
|
+
: sampleUnit, 5) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Total" }), _jsx("td", { className: "w-3/4", children: valueFormatter(highlighted.value, sampleUnit, 2) })] })] })) : (_jsxs("tr", { children: [_jsxs("td", { className: "w-1/4", children: [valuePrefix ?? '', "Value"] }), _jsx("td", { className: "w-3/4", children: valueFormatter(highlighted.valuePerSecond, sampleUnit, 5) })] })), highlighted.duration > 0 && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Duration" }), _jsx("td", { className: "w-3/4", children: valueFormatter(highlighted.duration, 'nanoseconds', 2) })] })), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "At" }), _jsx("td", { className: "w-3/4", children: formatDate(highlighted.timestamp, timePattern(timezone), timezone) })] })] }) }) }), _jsx("span", { className: "my-2 block text-gray-500", children: utilizationMetrics ? (_jsxs(_Fragment, { children: [Object.keys(attributesResourceMap).length > 0 && (_jsx("span", { className: "text-sm font-bold text-gray-700 dark:text-white", children: "Resource Attributes" })), _jsx("span", { className: "my-2 block text-gray-500", children: Object.keys(attributesResourceMap).map(name => (_jsx("div", { className: "mr-3 inline-block rounded-lg bg-gray-200 px-2 py-1 text-xs font-bold text-gray-700 dark:bg-gray-700 dark:text-gray-400", children: _jsx(TextWithTooltip, { text: `${name.replace('attributes.', '')}="${attributesResourceMap[name]}"`, maxTextLength: 48, id: `tooltip-${name}-${attributesResourceMap[name]}` }) }, name))) }), Object.keys(attributesMap).length > 0 && (_jsx("span", { className: "text-sm font-bold text-gray-700 dark:text-white", children: "Attributes" })), _jsx("span", { className: "my-2 block text-gray-500", children: Object.keys(attributesMap).map(name => (_jsx("div", { className: "mr-3 inline-block rounded-lg bg-gray-200 px-2 py-1 text-xs font-bold text-gray-700 dark:bg-gray-700 dark:text-gray-400", children: _jsx(TextWithTooltip, { text: `${name.replace('attributes.', '')}="${attributesMap[name]}"`, maxTextLength: 48, id: `tooltip-${name}-${attributesMap[name]}` }) }, name))) })] })) : (_jsx(_Fragment, { children: highlighted.labels
|
|
95
97
|
.filter((label) => label.name !== '__name__')
|
|
96
98
|
.map((label) => (_jsx("div", { className: "mr-3 inline-block rounded-lg bg-gray-200 px-2 py-1 text-xs font-bold text-gray-700 dark:bg-gray-700 dark:text-gray-400", children: _jsx(TextWithTooltip, { text: `${label.name}="${label.value}"`, maxTextLength: 37, id: `tooltip-${label.name}` }) }, label.name))) })) }), _jsxs("div", { className: "flex w-full items-center gap-1 text-xs text-gray-500", children: [_jsx(Icon, { icon: "iconoir:mouse-button-right" }), _jsx("div", { children: "Right click to add labels to query." })] })] }) }) }) }) }) }));
|
|
97
99
|
};
|
|
@@ -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,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;
|
|
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,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;AA2dF,QAAA,MAAM,SAAS,gIAUZ,KAAK,KAAG,GAAG,CAAC,OAiCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -204,7 +204,7 @@ const RawAreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange
|
|
|
204
204
|
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: {
|
|
205
205
|
...highlighted,
|
|
206
206
|
valuePerSecond: Math.abs(highlighted.valuePerSecond),
|
|
207
|
-
}, contextElement: graph.current, sampleUnit: 'bytes_per_second', delta: false, utilizationMetrics: true, valuePrefix: highlighted.seriesIndex >= transmitData.length ? 'Receive ' : 'Transmit ' })) })), _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) => {
|
|
207
|
+
}, contextElement: graph.current, sampleType: 'throughput', sampleUnit: 'bytes_per_second', delta: false, utilizationMetrics: true, valuePrefix: highlighted.seriesIndex >= transmitData.length ? 'Receive ' : 'Transmit ' })) })), _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) => {
|
|
208
208
|
let decimals = 2;
|
|
209
209
|
const intervalBetweenTicks = allTicks[1] - allTicks[0];
|
|
210
210
|
if (intervalBetweenTicks < 1) {
|
|
@@ -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,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,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;
|
|
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,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,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;AAwdF,QAAA,MAAM,kBAAkB,2GASrB,KAAK,KAAG,GAAG,CAAC,OAgCd,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -203,7 +203,7 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
|
|
|
203
203
|
e.stopPropagation();
|
|
204
204
|
e.preventDefault();
|
|
205
205
|
};
|
|
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 () {
|
|
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, sampleType: name, sampleUnit: getYAxisUnit(name), delta: false, utilizationMetrics: true })) })), _jsx("div", { ref: graph, onMouseEnter: function () {
|
|
207
207
|
setHovering(true);
|
|
208
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) => {
|
|
209
209
|
let decimals = 2;
|
|
@@ -15,6 +15,7 @@ interface Props {
|
|
|
15
15
|
value: string;
|
|
16
16
|
}>) => void;
|
|
17
17
|
setTimeRange: (range: DateTimeRange) => void;
|
|
18
|
+
sampleType: string;
|
|
18
19
|
sampleUnit: string;
|
|
19
20
|
width?: number;
|
|
20
21
|
height?: number;
|
|
@@ -36,8 +37,8 @@ export interface Series {
|
|
|
36
37
|
values: number[][];
|
|
37
38
|
labelset: string;
|
|
38
39
|
}
|
|
39
|
-
declare const MetricsGraph: ({ data, from, to, profile, onSampleClick, addLabelMatcher, setTimeRange, sampleUnit, width, height, margin, sumBy, }: Props) => JSX.Element;
|
|
40
|
+
declare const MetricsGraph: ({ data, from, to, profile, onSampleClick, addLabelMatcher, setTimeRange, sampleType, sampleUnit, width, height, margin, sumBy, }: Props) => JSX.Element;
|
|
40
41
|
export default MetricsGraph;
|
|
41
42
|
export declare const parseValue: (value: string) => number | null;
|
|
42
|
-
export declare const RawMetricsGraph: ({ data, from, to, profile, onSampleClick, addLabelMatcher, setTimeRange, width, height, margin,
|
|
43
|
+
export declare const RawMetricsGraph: ({ data, from, to, profile, onSampleClick, addLabelMatcher, setTimeRange, sampleType, sampleUnit, width, height, margin, sumBy, }: Props) => JSX.Element;
|
|
43
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MetricsGraph/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAC,KAAK,EAAiB,aAAa,IAAI,eAAe,EAAC,MAAM,eAAe,CAAC;AACrF,OAAO,EAAC,aAAa,EAAkB,MAAM,mBAAmB,CAAC;AASjE,OAAO,EAAC,sBAAsB,EAAC,MAAM,IAAI,CAAC;AAO1C,UAAU,KAAK;IACb,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACvC,aAAa,EAAE,CAAC,SAAS,EAAE,M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MAAM,YAAY,qIAcf,KAAK,KAAG,GAAG,CAAC,OA2Bd,CAAC;AAEF,eAAe,YAAY,CAAC;AAE5B,eAAO,MAAM,UAAU,UAAW,MAAM,KAAG,MAAM,GAAG,IAKnD,CAAC;AAKF,eAAO,MAAM,eAAe,qIAczB,KAAK,KAAG,GAAG,CAAC,OAmfd,CAAC"}
|
|
@@ -23,9 +23,9 @@ import MetricsSeries from '../MetricsSeries';
|
|
|
23
23
|
import MetricsContextMenu from './MetricsContextMenu';
|
|
24
24
|
import MetricsInfoPanel from './MetricsInfoPanel';
|
|
25
25
|
import MetricsTooltip from './MetricsTooltip';
|
|
26
|
-
const MetricsGraph = ({ data, from, to, profile, onSampleClick, addLabelMatcher, setTimeRange, sampleUnit, width = 0, height = 0, margin = 0, sumBy, }) => {
|
|
26
|
+
const MetricsGraph = ({ data, from, to, profile, onSampleClick, addLabelMatcher, setTimeRange, sampleType, sampleUnit, width = 0, height = 0, margin = 0, sumBy, }) => {
|
|
27
27
|
const [isInfoPanelOpen, setIsInfoPanelOpen] = useState(false);
|
|
28
|
-
return (_jsxs("div", { className: "relative", onClick: () => isInfoPanelOpen && setIsInfoPanelOpen(false), children: [_jsx("div", { className: "absolute right-0 top-0", children: _jsx(MetricsInfoPanel, { isInfoPanelOpen: isInfoPanelOpen, onInfoIconClick: () => setIsInfoPanelOpen(true) }) }), _jsx(RawMetricsGraph, { data: data, from: from, to: to, profile: profile, onSampleClick: onSampleClick, addLabelMatcher: addLabelMatcher, setTimeRange: setTimeRange, sampleUnit: sampleUnit, width: width, height: height, margin: margin, sumBy: sumBy })] }));
|
|
28
|
+
return (_jsxs("div", { className: "relative", onClick: () => isInfoPanelOpen && setIsInfoPanelOpen(false), children: [_jsx("div", { className: "absolute right-0 top-0", children: _jsx(MetricsInfoPanel, { isInfoPanelOpen: isInfoPanelOpen, onInfoIconClick: () => setIsInfoPanelOpen(true) }) }), _jsx(RawMetricsGraph, { data: data, from: from, to: to, profile: profile, onSampleClick: onSampleClick, addLabelMatcher: addLabelMatcher, setTimeRange: setTimeRange, sampleType: sampleType, sampleUnit: sampleUnit, width: width, height: height, margin: margin, sumBy: sumBy })] }));
|
|
29
29
|
};
|
|
30
30
|
export default MetricsGraph;
|
|
31
31
|
export const parseValue = (value) => {
|
|
@@ -36,7 +36,7 @@ export const parseValue = (value) => {
|
|
|
36
36
|
};
|
|
37
37
|
const lineStroke = '1px';
|
|
38
38
|
const lineStrokeHover = '2px';
|
|
39
|
-
export const RawMetricsGraph = ({ data, from, to, profile, onSampleClick, addLabelMatcher, setTimeRange, width, height = 50, margin = 0,
|
|
39
|
+
export const RawMetricsGraph = ({ data, from, to, profile, onSampleClick, addLabelMatcher, setTimeRange, sampleType, sampleUnit, width, height = 50, margin = 0, sumBy, }) => {
|
|
40
40
|
const { timezone } = useParcaContext();
|
|
41
41
|
const graph = useRef(null);
|
|
42
42
|
const [dragging, setDragging] = useState(false);
|
|
@@ -253,14 +253,19 @@ export const RawMetricsGraph = ({ data, from, to, profile, onSampleClick, addLab
|
|
|
253
253
|
let yAxisUnit = sampleUnit;
|
|
254
254
|
if (isDeltaType) {
|
|
255
255
|
if (sampleUnit === 'nanoseconds') {
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
if (sampleType === 'cpu') {
|
|
257
|
+
yAxisLabel = 'CPU Cores';
|
|
258
|
+
yAxisUnit = '';
|
|
259
|
+
}
|
|
260
|
+
if (sampleType === 'cuda') {
|
|
261
|
+
yAxisLabel = 'GPU Time';
|
|
262
|
+
}
|
|
258
263
|
}
|
|
259
264
|
if (sampleUnit === 'bytes') {
|
|
260
265
|
yAxisLabel = 'Bytes per Second';
|
|
261
266
|
}
|
|
262
267
|
}
|
|
263
|
-
return (_jsxs(_Fragment, { children: [_jsx(MetricsContextMenu, { onAddLabelMatcher: addLabelMatcher, menuId: MENU_ID, highlighted: highlighted, trackVisibility: trackVisibility }), 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: sampleUnit, delta: isDeltaType })) })), _jsx("div", { ref: graph, onMouseEnter: function () {
|
|
268
|
+
return (_jsxs(_Fragment, { children: [_jsx(MetricsContextMenu, { onAddLabelMatcher: addLabelMatcher, menuId: MENU_ID, highlighted: highlighted, trackVisibility: trackVisibility }), 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, sampleType: sampleType, sampleUnit: sampleUnit, delta: isDeltaType })) })), _jsx("div", { ref: graph, onMouseEnter: function () {
|
|
264
269
|
setHovering(true);
|
|
265
270
|
}, 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(5).map((d, i, allTicks) => {
|
|
266
271
|
let decimals = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileMetricsGraph/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,KAAK,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,CAAC;AAIvF,OAAO,EAAyB,gBAAgB,EAAC,MAAM,IAAI,CAAC;AAK5D,UAAU,6BAA6B;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAaD,eAAO,MAAM,wBAAwB,gBAAe,6BAA6B,KAAG,GAAG,CAAC,OAMvF,CAAC;AAEF,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,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,CACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,KAAK,EAAE,EACf,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,mBAAmB,sIAYtB,wBAAwB,KAAG,GAAG,CAAC,OA4FjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -50,16 +50,20 @@ const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to,
|
|
|
50
50
|
return _jsx(ErrorContent, { errorMessage: capitalizeOnlyFirstLetter(error.message) });
|
|
51
51
|
}
|
|
52
52
|
let sampleUnit = '';
|
|
53
|
+
let sampleType = '';
|
|
53
54
|
if (dataAvailable) {
|
|
54
55
|
if (series.every((val, i, arr) => val?.sampleType?.unit === arr[0]?.sampleType?.unit)) {
|
|
55
56
|
sampleUnit = series[0]?.sampleType?.unit ?? '';
|
|
57
|
+
sampleType = series[0]?.sampleType?.type ?? '';
|
|
56
58
|
}
|
|
57
59
|
if (sampleUnit === '') {
|
|
58
|
-
|
|
60
|
+
const profileType = Query.parse(queryExpression).profileType();
|
|
61
|
+
sampleUnit = profileType.sampleUnit;
|
|
62
|
+
sampleType = profileType.sampleType;
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
return (_jsx(AnimatePresence, { children: _jsx(motion.div, { className: "h-full w-full relative", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: loading ? (_jsx(MetricsGraphSkeleton, { heightStyle: heightStyle, isDarkMode: isDarkMode })) : dataAvailable ? (_jsx(MetricsGraph, { data: series, from: from, to: to, profile: profile, setTimeRange: setTimeRange, onSampleClick: (timestamp, _value, labels, duration) => {
|
|
62
66
|
onPointClick(timestamp, labels, queryExpression, duration);
|
|
63
|
-
}, addLabelMatcher: addLabelMatcher, sampleUnit: sampleUnit, height: height, width: width, margin: margin, sumBy: sumBy })) : (_jsx(ProfileMetricsEmptyState, { message: "No data found. Try a different query." })) }, "metrics-graph-loaded") }));
|
|
67
|
+
}, addLabelMatcher: addLabelMatcher, sampleUnit: sampleUnit, sampleType: sampleType, height: height, width: width, margin: margin, sumBy: sumBy })) : (_jsx(ProfileMetricsEmptyState, { message: "No data found. Try a different query." })) }, "metrics-graph-loaded") }));
|
|
64
68
|
};
|
|
65
69
|
export default ProfileMetricsGraph;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileTypeSelector/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAC,WAAW,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO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W,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,mBAAmB,8GAQtB,KAAK,KAAG,GAAG,CAAC,OAyBd,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -90,6 +90,10 @@ export const wellKnownProfiles = {
|
|
|
90
90
|
name: 'Off-CPU',
|
|
91
91
|
help: 'Time spent off the CPU as observed by the Parca Agent.',
|
|
92
92
|
},
|
|
93
|
+
'parca_agent:cuda:nanoseconds:cuda:nanoseconds:delta': {
|
|
94
|
+
name: 'On-GPU',
|
|
95
|
+
help: 'Time spent on the GPU.',
|
|
96
|
+
},
|
|
93
97
|
};
|
|
94
98
|
export function flexibleWellKnownProfileMatching(name) {
|
|
95
99
|
const prefixExcludedName = name.split(':').slice(1).join(':');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.8",
|
|
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": "39406ca7bb8b0db80a91694a6bac0f6879a88fe8"
|
|
81
81
|
}
|
|
@@ -28,6 +28,7 @@ interface Props {
|
|
|
28
28
|
y: number;
|
|
29
29
|
highlighted: HighlightedSeries;
|
|
30
30
|
contextElement: Element | null;
|
|
31
|
+
sampleType: string;
|
|
31
32
|
sampleUnit: string;
|
|
32
33
|
delta: boolean;
|
|
33
34
|
utilizationMetrics?: boolean;
|
|
@@ -67,6 +68,7 @@ const MetricsTooltip = ({
|
|
|
67
68
|
y,
|
|
68
69
|
highlighted,
|
|
69
70
|
contextElement,
|
|
71
|
+
sampleType,
|
|
70
72
|
sampleUnit,
|
|
71
73
|
delta,
|
|
72
74
|
utilizationMetrics = false,
|
|
@@ -152,7 +154,9 @@ const MetricsTooltip = ({
|
|
|
152
154
|
<td className="w-3/4">
|
|
153
155
|
{valueFormatter(
|
|
154
156
|
highlighted.valuePerSecond,
|
|
155
|
-
sampleUnit === 'nanoseconds'
|
|
157
|
+
sampleUnit === 'nanoseconds' && sampleType === 'cpu'
|
|
158
|
+
? 'CPU Cores'
|
|
159
|
+
: sampleUnit,
|
|
156
160
|
5
|
|
157
161
|
)}
|
|
158
162
|
</td>
|
|
@@ -45,6 +45,7 @@ interface Props {
|
|
|
45
45
|
labels: {key: string; value: string} | Array<{key: string; value: string}>
|
|
46
46
|
) => void;
|
|
47
47
|
setTimeRange: (range: DateTimeRange) => void;
|
|
48
|
+
sampleType: string;
|
|
48
49
|
sampleUnit: string;
|
|
49
50
|
width?: number;
|
|
50
51
|
height?: number;
|
|
@@ -77,6 +78,7 @@ const MetricsGraph = ({
|
|
|
77
78
|
onSampleClick,
|
|
78
79
|
addLabelMatcher,
|
|
79
80
|
setTimeRange,
|
|
81
|
+
sampleType,
|
|
80
82
|
sampleUnit,
|
|
81
83
|
width = 0,
|
|
82
84
|
height = 0,
|
|
@@ -100,6 +102,7 @@ const MetricsGraph = ({
|
|
|
100
102
|
onSampleClick={onSampleClick}
|
|
101
103
|
addLabelMatcher={addLabelMatcher}
|
|
102
104
|
setTimeRange={setTimeRange}
|
|
105
|
+
sampleType={sampleType}
|
|
103
106
|
sampleUnit={sampleUnit}
|
|
104
107
|
width={width}
|
|
105
108
|
height={height}
|
|
@@ -130,10 +133,11 @@ export const RawMetricsGraph = ({
|
|
|
130
133
|
onSampleClick,
|
|
131
134
|
addLabelMatcher,
|
|
132
135
|
setTimeRange,
|
|
136
|
+
sampleType,
|
|
137
|
+
sampleUnit,
|
|
133
138
|
width,
|
|
134
139
|
height = 50,
|
|
135
140
|
margin = 0,
|
|
136
|
-
sampleUnit,
|
|
137
141
|
sumBy,
|
|
138
142
|
}: Props): JSX.Element => {
|
|
139
143
|
const {timezone} = useParcaContext();
|
|
@@ -416,8 +420,13 @@ export const RawMetricsGraph = ({
|
|
|
416
420
|
let yAxisUnit = sampleUnit;
|
|
417
421
|
if (isDeltaType) {
|
|
418
422
|
if (sampleUnit === 'nanoseconds') {
|
|
419
|
-
|
|
420
|
-
|
|
423
|
+
if (sampleType === 'cpu') {
|
|
424
|
+
yAxisLabel = 'CPU Cores';
|
|
425
|
+
yAxisUnit = '';
|
|
426
|
+
}
|
|
427
|
+
if (sampleType === 'cuda') {
|
|
428
|
+
yAxisLabel = 'GPU Time';
|
|
429
|
+
}
|
|
421
430
|
}
|
|
422
431
|
if (sampleUnit === 'bytes') {
|
|
423
432
|
yAxisLabel = 'Bytes per Second';
|
|
@@ -444,6 +453,7 @@ export const RawMetricsGraph = ({
|
|
|
444
453
|
y={pos[1] + margin}
|
|
445
454
|
highlighted={highlighted}
|
|
446
455
|
contextElement={graph.current}
|
|
456
|
+
sampleType={sampleType}
|
|
447
457
|
sampleUnit={sampleUnit}
|
|
448
458
|
delta={isDeltaType}
|
|
449
459
|
/>
|
|
@@ -119,13 +119,17 @@ const ProfileMetricsGraph = ({
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
let sampleUnit = '';
|
|
122
|
+
let sampleType = '';
|
|
122
123
|
|
|
123
124
|
if (dataAvailable) {
|
|
124
125
|
if (series.every((val, i, arr) => val?.sampleType?.unit === arr[0]?.sampleType?.unit)) {
|
|
125
126
|
sampleUnit = series[0]?.sampleType?.unit ?? '';
|
|
127
|
+
sampleType = series[0]?.sampleType?.type ?? '';
|
|
126
128
|
}
|
|
127
129
|
if (sampleUnit === '') {
|
|
128
|
-
|
|
130
|
+
const profileType = Query.parse(queryExpression).profileType();
|
|
131
|
+
sampleUnit = profileType.sampleUnit;
|
|
132
|
+
sampleType = profileType.sampleType;
|
|
129
133
|
}
|
|
130
134
|
}
|
|
131
135
|
|
|
@@ -157,6 +161,7 @@ const ProfileMetricsGraph = ({
|
|
|
157
161
|
}}
|
|
158
162
|
addLabelMatcher={addLabelMatcher}
|
|
159
163
|
sampleUnit={sampleUnit}
|
|
164
|
+
sampleType={sampleType}
|
|
160
165
|
height={height}
|
|
161
166
|
width={width}
|
|
162
167
|
margin={margin}
|
|
@@ -104,6 +104,10 @@ export const wellKnownProfiles: WellKnownProfiles = {
|
|
|
104
104
|
name: 'Off-CPU',
|
|
105
105
|
help: 'Time spent off the CPU as observed by the Parca Agent.',
|
|
106
106
|
},
|
|
107
|
+
'parca_agent:cuda:nanoseconds:cuda:nanoseconds:delta': {
|
|
108
|
+
name: 'On-GPU',
|
|
109
|
+
help: 'Time spent on the GPU.',
|
|
110
|
+
},
|
|
107
111
|
};
|
|
108
112
|
|
|
109
113
|
export function flexibleWellKnownProfileMatching(name: string): WellKnownProfile | undefined {
|