@parca/profile 0.19.46 → 0.19.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/MetricsGraph/MetricsContextMenu/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsContextMenu/index.js +2 -1
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.js +2 -1
- package/dist/MetricsGraph/index.d.ts.map +1 -1
- package/dist/MetricsGraph/index.js +2 -1
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +3 -2
- package/dist/ProfileSelector/MetricsGraphSection.js +1 -1
- package/package.json +4 -4
- package/src/MetricsGraph/MetricsContextMenu/index.tsx +7 -1
- package/src/MetricsGraph/MetricsTooltip/index.tsx +9 -1
- package/src/MetricsGraph/index.tsx +6 -1
- package/src/ProfileMetricsGraph/index.tsx +4 -0
- package/src/ProfileSelector/MetricsGraphSection.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.19.48](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.47...@parca/profile@0.19.48) (2025-09-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.19.47](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.46...@parca/profile@0.19.47) (2025-09-02)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.19.46](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.45...@parca/profile@0.19.46) (2025-08-28)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/MetricsContextMenu/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/MetricsContextMenu/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,KAAK,CAAC;AAExC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtE,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;CAC5E;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,CAAC;CAChG;AAED,MAAM,MAAM,wBAAwB,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAE5E,UAAU,uBAAuB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,wBAAwB,EAAE,CAAC;CACvC;AAED,QAAA,MAAM,kBAAkB,GAAI,+DAMzB,uBAAuB,KAAG,GAAG,CAAC,OAqEhC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -14,6 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { Icon } from '@iconify/react';
|
|
15
15
|
import { Item, Menu, Submenu } from 'react-contexify';
|
|
16
16
|
import { useParcaContext } from '@parca/components';
|
|
17
|
+
import { testId } from '@parca/test-utils';
|
|
17
18
|
const MetricsContextMenu = ({ menuId, closestPoint, series, trackVisibility, menuItems, }) => {
|
|
18
19
|
const { isDarkMode } = useParcaContext();
|
|
19
20
|
const renderMenuItem = (item) => {
|
|
@@ -31,6 +32,6 @@ const MetricsContextMenu = ({ menuId, closestPoint, series, trackVisibility, men
|
|
|
31
32
|
return (_jsx(Item, { id: menuItem.id, onClick: () => menuItem.onClick(closestPoint, series), disabled: menuItem.disabled?.(closestPoint, series) ?? false, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [menuItem.icon != null && menuItem.icon !== '' && _jsx(Icon, { icon: menuItem.icon }), _jsx("div", { children: menuItem.label })] }) }, menuItem.id));
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
|
-
return (_jsx(Menu, { id: menuId, onVisibilityChange: trackVisibility, theme: isDarkMode ? 'dark' : '', children: menuItems.map(renderMenuItem) }));
|
|
35
|
+
return (_jsx(Menu, { id: menuId, onVisibilityChange: trackVisibility, theme: isDarkMode ? 'dark' : '', ...testId('METRICS_GRAPH_CONTEXT_MENU'), children: menuItems.map(renderMenuItem) }));
|
|
35
36
|
};
|
|
36
37
|
export default MetricsContextMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/MetricsTooltip/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/MetricsTooltip/index.tsx"],"names":[],"mappings":"AAuBA,UAAU,KAAK;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAkCD,QAAA,MAAM,cAAc,GAAI,mCAAiC,KAAK,KAAG,GAAG,CAAC,OAiEpE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -13,6 +13,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { useEffect, useMemo, useState } from 'react';
|
|
15
15
|
import { usePopper } from 'react-popper';
|
|
16
|
+
import { testId } from '@parca/test-utils';
|
|
16
17
|
const virtualElement = {
|
|
17
18
|
getBoundingClientRect: () => {
|
|
18
19
|
const emptyRect = {
|
|
@@ -86,6 +87,6 @@ const MetricsTooltip = ({ x, y, contextElement, content }) => {
|
|
|
86
87
|
if (content == null) {
|
|
87
88
|
return _jsx(_Fragment, {});
|
|
88
89
|
}
|
|
89
|
-
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: "border border-gray-300 bg-gray-50 dark:border-gray-500 dark:bg-gray-900 rounded-lg shadow-lg px-3 py-2", children: content }) }) }) }));
|
|
90
|
+
return (_jsx("div", { ref: setPopperElement, style: styles.popper, ...attributes.popper, ...testId('METRICS_GRAPH_TOOLTIP'), className: "z-50", children: _jsx("div", { className: "flex max-w-lg", children: _jsx("div", { className: "m-auto", children: _jsx("div", { className: "border border-gray-300 bg-gray-50 dark:border-gray-500 dark:bg-gray-900 rounded-lg shadow-lg px-3 py-2", children: content }) }) }) }));
|
|
90
91
|
};
|
|
91
92
|
export default MetricsTooltip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MetricsGraph/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAOrF,OAAO,EAAC,aAAa,EAAkB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MetricsGraph/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAOrF,OAAO,EAAC,aAAa,EAAkB,MAAM,mBAAmB,CAAC;AAMjE,OAA2B,EACzB,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAI9B,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,CAAC,YAAY,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAC9C,oBAAoB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CACrF;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC;AAED,QAAA,MAAM,YAAY,GAAI,uJAcnB,KAAK,KAAG,GAAG,CAAC,OA+Bd,CAAC;AAEF,eAAe,YAAY,CAAC;AAC5B,YAAY,EAAC,wBAAwB,EAAE,eAAe,EAAE,kBAAkB,EAAC,CAAC;AAE5E,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAKnD,CAAC;AAKF,eAAO,MAAM,eAAe,GAAI,uJAc7B,KAAK,KAAG,GAAG,CAAC,OA6ad,CAAC"}
|
|
@@ -17,6 +17,7 @@ import { pointer } from 'd3-selection';
|
|
|
17
17
|
import throttle from 'lodash.throttle';
|
|
18
18
|
import { useContextMenu } from 'react-contexify';
|
|
19
19
|
import { DateTimeRange, useParcaContext } from '@parca/components';
|
|
20
|
+
import { testId } from '@parca/test-utils';
|
|
20
21
|
import { formatDate, formatForTimespan, getPrecision, valueFormatter } from '@parca/utilities';
|
|
21
22
|
import MetricsCircle from '../MetricsCircle';
|
|
22
23
|
import MetricsSeries from '../MetricsSeries';
|
|
@@ -25,7 +26,7 @@ import MetricsInfoPanel from './MetricsInfoPanel';
|
|
|
25
26
|
import MetricsTooltip from './MetricsTooltip';
|
|
26
27
|
const MetricsGraph = ({ data, from, to, onSampleClick, setTimeRange, yAxisLabel, yAxisUnit, width = 0, height = 0, margin = 0, selectedPoint, contextMenuItems, renderTooltipContent, }) => {
|
|
27
28
|
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, onSampleClick: onSampleClick, setTimeRange: setTimeRange, yAxisLabel: yAxisLabel, yAxisUnit: yAxisUnit, width: width, height: height, margin: margin, selectedPoint: selectedPoint, contextMenuItems: contextMenuItems, renderTooltipContent: renderTooltipContent })] }));
|
|
29
|
+
return (_jsxs("div", { className: "relative", ...testId('METRICS_GRAPH'), 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, onSampleClick: onSampleClick, setTimeRange: setTimeRange, yAxisLabel: yAxisLabel, yAxisUnit: yAxisUnit, width: width, height: height, margin: margin, selectedPoint: selectedPoint, contextMenuItems: contextMenuItems, renderTooltipContent: renderTooltipContent })] }));
|
|
29
30
|
};
|
|
30
31
|
export default MetricsGraph;
|
|
31
32
|
export const parseValue = (value) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileMetricsGraph/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,EAGL,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EAId,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileMetricsGraph/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,EAGL,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EAId,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAyB,gBAAgB,EAAC,MAAM,IAAI,CAAC;AAwH5D,UAAU,6BAA6B;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAaD,eAAO,MAAM,wBAAwB,GAAI,aAAW,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,GAAI,mIAY1B,wBAAwB,KAAG,GAAG,CAAC,OA0WjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -16,6 +16,7 @@ import { Icon } from '@iconify/react';
|
|
|
16
16
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
17
17
|
import { MetricsGraphSkeleton, TextWithTooltip, useParcaContext, } from '@parca/components';
|
|
18
18
|
import { Query } from '@parca/parser';
|
|
19
|
+
import { testId } from '@parca/test-utils';
|
|
19
20
|
import { capitalizeOnlyFirstLetter, formatDate, timePattern, valueFormatter } from '@parca/utilities';
|
|
20
21
|
import { MergedProfileSelection } from '..';
|
|
21
22
|
import MetricsGraph from '../MetricsGraph';
|
|
@@ -267,9 +268,9 @@ const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to,
|
|
|
267
268
|
return (_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: [isDeltaType ? (_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(originalPoint.valuePerSecond, sampleUnit === 'nanoseconds' && sampleType === 'cpu'
|
|
268
269
|
? 'CPU Cores'
|
|
269
270
|
: sampleUnit, 5) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Total" }), _jsx("td", { className: "w-3/4", children: valueFormatter(originalPoint.value ?? 0, sampleUnit, 2) })] })] })) : (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Value" }), _jsx("td", { className: "w-3/4", children: valueFormatter(originalPoint.valuePerSecond, sampleUnit, 5) })] })), originalPoint.duration != null &&
|
|
270
|
-
Number(originalPoint.duration) > 0 && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Duration" }), _jsx("td", { className: "w-3/4", children: valueFormatter(Number(originalPoint.duration.toString()), 'nanoseconds', 2) })] })), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "At" }), _jsx("td", { className: "w-3/4", children: formatDate(new Date(timestampMs), 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: labels
|
|
271
|
+
Number(originalPoint.duration) > 0 && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Duration" }), _jsx("td", { className: "w-3/4", children: valueFormatter(Number(originalPoint.duration.toString()), 'nanoseconds', 2) })] })), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "At" }), _jsx("td", { className: "w-3/4", children: formatDate(new Date(timestampMs), 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", ...testId('TOOLTIP_LABEL'), 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", ...testId('TOOLTIP_LABEL'), children: _jsx(TextWithTooltip, { text: `${name.replace('attributes.', '')}="${attributesMap[name]}"`, maxTextLength: 48, id: `tooltip-${name}-${attributesMap[name]}` }) }, name))) })] })) : (_jsx(_Fragment, { children: labels
|
|
271
272
|
.filter((label) => label.name !== '__name__')
|
|
272
|
-
.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." })] })] }) }));
|
|
273
|
+
.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", ...testId('TOOLTIP_LABEL'), 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." })] })] }) }));
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
276
|
return null;
|
|
@@ -25,7 +25,7 @@ export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGra
|
|
|
25
25
|
const to = range.getToMs();
|
|
26
26
|
let mergedProfileParams = {};
|
|
27
27
|
if (query.profileType().delta) {
|
|
28
|
-
mergedProfileParams = { mergeFrom: from, mergeTo: to };
|
|
28
|
+
mergedProfileParams = { mergeFrom: from * 1000000, mergeTo: to * 1000000 };
|
|
29
29
|
}
|
|
30
30
|
setTimeRangeSelection(range);
|
|
31
31
|
selectQuery({
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.48",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@floating-ui/react": "^0.27.12",
|
|
7
7
|
"@headlessui/react": "^1.7.19",
|
|
8
8
|
"@iconify/react": "^4.0.0",
|
|
9
9
|
"@parca/client": "0.17.3",
|
|
10
|
-
"@parca/components": "0.16.
|
|
10
|
+
"@parca/components": "0.16.367",
|
|
11
11
|
"@parca/dynamicsize": "0.16.65",
|
|
12
12
|
"@parca/hooks": "0.0.100",
|
|
13
13
|
"@parca/icons": "0.16.72",
|
|
14
14
|
"@parca/parser": "0.16.79",
|
|
15
15
|
"@parca/store": "0.16.184",
|
|
16
|
-
"@parca/test-utils": "0.0.
|
|
16
|
+
"@parca/test-utils": "0.0.9",
|
|
17
17
|
"@parca/utilities": "0.0.107",
|
|
18
18
|
"@popperjs/core": "^2.11.8",
|
|
19
19
|
"@protobuf-ts/runtime-rpc": "^2.5.0",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"access": "public",
|
|
80
80
|
"registry": "https://registry.npmjs.org/"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "71cd5d9ae150e768a939633ddd4a3489abe99e98"
|
|
83
83
|
}
|
|
@@ -15,6 +15,7 @@ import {Icon} from '@iconify/react';
|
|
|
15
15
|
import {Item, Menu, Submenu} from 'react-contexify';
|
|
16
16
|
|
|
17
17
|
import {useParcaContext} from '@parca/components';
|
|
18
|
+
import {testId} from '@parca/test-utils';
|
|
18
19
|
|
|
19
20
|
import {Series, SeriesPoint} from '../';
|
|
20
21
|
|
|
@@ -110,7 +111,12 @@ const MetricsContextMenu = ({
|
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
return (
|
|
113
|
-
<Menu
|
|
114
|
+
<Menu
|
|
115
|
+
id={menuId}
|
|
116
|
+
onVisibilityChange={trackVisibility}
|
|
117
|
+
theme={isDarkMode ? 'dark' : ''}
|
|
118
|
+
{...testId('METRICS_GRAPH_CONTEXT_MENU')}
|
|
119
|
+
>
|
|
114
120
|
{menuItems.map(renderMenuItem)}
|
|
115
121
|
</Menu>
|
|
116
122
|
);
|
|
@@ -15,6 +15,8 @@ import {useEffect, useMemo, useState} from 'react';
|
|
|
15
15
|
|
|
16
16
|
import {usePopper} from 'react-popper';
|
|
17
17
|
|
|
18
|
+
import {testId} from '@parca/test-utils';
|
|
19
|
+
|
|
18
20
|
interface VirtualElement {
|
|
19
21
|
getBoundingClientRect: () => DOMRect;
|
|
20
22
|
}
|
|
@@ -107,7 +109,13 @@ const MetricsTooltip = ({x, y, contextElement, content}: Props): JSX.Element =>
|
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
return (
|
|
110
|
-
<div
|
|
112
|
+
<div
|
|
113
|
+
ref={setPopperElement}
|
|
114
|
+
style={styles.popper}
|
|
115
|
+
{...attributes.popper}
|
|
116
|
+
{...testId('METRICS_GRAPH_TOOLTIP')}
|
|
117
|
+
className="z-50"
|
|
118
|
+
>
|
|
111
119
|
<div className="flex max-w-lg">
|
|
112
120
|
<div className="m-auto">
|
|
113
121
|
<div className="border border-gray-300 bg-gray-50 dark:border-gray-500 dark:bg-gray-900 rounded-lg shadow-lg px-3 py-2">
|
|
@@ -19,6 +19,7 @@ import throttle from 'lodash.throttle';
|
|
|
19
19
|
import {useContextMenu} from 'react-contexify';
|
|
20
20
|
|
|
21
21
|
import {DateTimeRange, useParcaContext} from '@parca/components';
|
|
22
|
+
import {testId} from '@parca/test-utils';
|
|
22
23
|
import {formatDate, formatForTimespan, getPrecision, valueFormatter} from '@parca/utilities';
|
|
23
24
|
|
|
24
25
|
import MetricsCircle from '../MetricsCircle';
|
|
@@ -81,7 +82,11 @@ const MetricsGraph = ({
|
|
|
81
82
|
}: Props): JSX.Element => {
|
|
82
83
|
const [isInfoPanelOpen, setIsInfoPanelOpen] = useState<boolean>(false);
|
|
83
84
|
return (
|
|
84
|
-
<div
|
|
85
|
+
<div
|
|
86
|
+
className="relative"
|
|
87
|
+
{...testId('METRICS_GRAPH')}
|
|
88
|
+
onClick={() => isInfoPanelOpen && setIsInfoPanelOpen(false)}
|
|
89
|
+
>
|
|
85
90
|
<div className="absolute right-0 top-0">
|
|
86
91
|
<MetricsInfoPanel
|
|
87
92
|
isInfoPanelOpen={isInfoPanelOpen}
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
useParcaContext,
|
|
30
30
|
} from '@parca/components';
|
|
31
31
|
import {Query} from '@parca/parser';
|
|
32
|
+
import {testId} from '@parca/test-utils';
|
|
32
33
|
import {capitalizeOnlyFirstLetter, formatDate, timePattern, valueFormatter} from '@parca/utilities';
|
|
33
34
|
|
|
34
35
|
import {MergedProfileSelection, ProfileSelection} from '..';
|
|
@@ -490,6 +491,7 @@ const ProfileMetricsGraph = ({
|
|
|
490
491
|
<div
|
|
491
492
|
key={name}
|
|
492
493
|
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"
|
|
494
|
+
{...testId('TOOLTIP_LABEL')}
|
|
493
495
|
>
|
|
494
496
|
<TextWithTooltip
|
|
495
497
|
text={`${name.replace('attributes.', '')}="${
|
|
@@ -511,6 +513,7 @@ const ProfileMetricsGraph = ({
|
|
|
511
513
|
<div
|
|
512
514
|
key={name}
|
|
513
515
|
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"
|
|
516
|
+
{...testId('TOOLTIP_LABEL')}
|
|
514
517
|
>
|
|
515
518
|
<TextWithTooltip
|
|
516
519
|
text={`${name.replace('attributes.', '')}="${
|
|
@@ -531,6 +534,7 @@ const ProfileMetricsGraph = ({
|
|
|
531
534
|
<div
|
|
532
535
|
key={label.name}
|
|
533
536
|
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"
|
|
537
|
+
{...testId('TOOLTIP_LABEL')}
|
|
534
538
|
>
|
|
535
539
|
<TextWithTooltip
|
|
536
540
|
text={`${label.name}="${label.value}"`}
|
|
@@ -76,7 +76,7 @@ export function MetricsGraphSection({
|
|
|
76
76
|
const to = range.getToMs();
|
|
77
77
|
let mergedProfileParams = {};
|
|
78
78
|
if (query.profileType().delta) {
|
|
79
|
-
mergedProfileParams = {mergeFrom: from, mergeTo: to};
|
|
79
|
+
mergedProfileParams = {mergeFrom: from * 1_000_000, mergeTo: to * 1_000_000};
|
|
80
80
|
}
|
|
81
81
|
setTimeRangeSelection(range);
|
|
82
82
|
selectQuery({
|