@parca/profile 0.16.469 → 0.16.470
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/GraphTooltipArrow/Content.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/Content.js +5 -3
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts +1 -0
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +3 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.js +8 -10
- package/dist/ProfileSource.d.ts +1 -0
- package/dist/ProfileSource.d.ts.map +1 -1
- package/dist/ProfileSource.js +1 -1
- package/package.json +6 -6
- package/src/GraphTooltipArrow/Content.tsx +16 -3
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +4 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.tsx +9 -15
- package/src/ProfileSource.tsx +2 -1
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.470 (2025-02-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.16.469](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.468...@parca/profile@0.16.469) (2025-02-10)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../src/GraphTooltipArrow/Content.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../src/GraphTooltipArrow/Content.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAGnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAQ1C,UAAU,6BAA6B;IACrC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAMD,QAAA,MAAM,wBAAwB,gGAU3B,6BAA6B,KAAG,KAAK,CAAC,GAAG,CAAC,OAgF5C,CAAC;AAuFF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Icon } from '@iconify/react';
|
|
3
|
-
import {
|
|
3
|
+
import { useParcaContext } from '@parca/components';
|
|
4
|
+
import { formatDateTimeDownToMS, getLastItem } from '@parca/utilities';
|
|
4
5
|
import { hexifyAddress, truncateString, truncateStringReverse } from '../utils';
|
|
5
6
|
import { ExpandOnHover } from './ExpandOnHoverValue';
|
|
6
7
|
import { useGraphTooltip } from './useGraphTooltip';
|
|
@@ -30,10 +31,11 @@ const GraphTooltipArrowContent = ({ table, profileType, unit, total, totalUnfilt
|
|
|
30
31
|
: 'unknown' })) }), _jsx("table", { className: "my-2 w-full table-fixed pr-0 text-gray-700 dark:text-gray-300", children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Cumulative" }), _jsx("td", { className: "w-3/4", children: _jsx("div", { children: cumulativeText }) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Flat" }), _jsx("td", { className: "w-3/4 pt-2", children: _jsx("div", { children: flatText }) })] }), diff !== 0n && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Diff" }), _jsx("td", { className: "w-3/4 pt-2", children: _jsx("div", { children: diffText }) })] })), _jsx(TooltipMetaInfo, { table: table, row: rowNumber })] }) })] }) }), _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 show context menu" })] })] }) }) }));
|
|
31
32
|
};
|
|
32
33
|
const TooltipMetaInfo = ({ table, row }) => {
|
|
33
|
-
const { labelPairs, functionFilename, file, locationAddress, mappingFile, mappingBuildID, inlined, } = useGraphTooltipMetaInfo({ table, row });
|
|
34
|
+
const { labelPairs, functionFilename, file, locationAddress, mappingFile, mappingBuildID, inlined, timestamp, } = useGraphTooltipMetaInfo({ table, row });
|
|
35
|
+
const { timezone } = useParcaContext();
|
|
34
36
|
const labels = labelPairs.map((l) => (_jsx("span", { 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: `${l[0]}="${l[1]}"` }, l[0])));
|
|
35
37
|
const isMappingBuildIDAvailable = mappingBuildID !== null && mappingBuildID !== '';
|
|
36
38
|
const inlinedText = inlined === null ? 'merged' : inlined ? 'yes' : 'no';
|
|
37
|
-
return (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "
|
|
39
|
+
return (_jsxs(_Fragment, { children: [timestamp == null || timestamp === 0n ? (_jsx("div", { className: "pt-2" })) : (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Timestamp" }), _jsx("td", { className: "w-3/4 pt-2 break-all", children: formatDateTimeDownToMS(new Date(Number(timestamp / 1000000n)), timezone) }), ' '] })), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "File" }), _jsx("td", { className: "w-3/4 break-all", children: functionFilename === '' ? (_jsx(NoData, {})) : (_jsx("div", { className: "flex gap-4", children: _jsx("div", { className: "whitespace-nowrap text-left", children: _jsx(ExpandOnHover, { value: file, displayValue: truncateStringReverse(file, 30) }) }) })) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Address" }), _jsx("td", { className: "w-3/4 break-all", children: locationAddress === 0n ? _jsx(NoData, {}) : _jsx("div", { children: hexifyAddress(locationAddress) }) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Inlined" }), _jsx("td", { className: "w-3/4 break-all", children: inlinedText })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Binary" }), _jsx("td", { className: "w-3/4 break-all", children: (mappingFile != null ? getLastItem(mappingFile) : null) ?? _jsx(NoData, {}) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Build Id" }), _jsx("td", { className: "w-3/4 break-all", children: isMappingBuildIDAvailable ? _jsx("div", { children: truncateString(mappingBuildID, 28) }) : _jsx(NoData, {}) })] }), labelPairs.length > 0 && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Labels" }), _jsx("td", { className: "w-3/4 break-all", children: labels })] }))] }));
|
|
38
40
|
};
|
|
39
41
|
export default GraphTooltipArrowContent;
|
|
@@ -14,6 +14,7 @@ interface GraphTooltipMetaInfoData {
|
|
|
14
14
|
mappingFile: string | null;
|
|
15
15
|
mappingBuildID: string | null;
|
|
16
16
|
inlined: boolean | null;
|
|
17
|
+
timestamp: bigint | null;
|
|
17
18
|
}
|
|
18
19
|
export declare const useGraphTooltipMetaInfo: ({ table, row }: Props) => GraphTooltipMetaInfoData;
|
|
19
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAqBnC,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,wBAAwB;IAChC,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,uBAAuB,mBAAkB,KAAK,KAAG,wBA8F7D,CAAC"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { QueryRequest_ReportType } from '@parca/client';
|
|
14
14
|
import { useParcaContext, useURLState } from '@parca/components';
|
|
15
|
-
import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_START_LINE, FIELD_FUNCTION_SYSTEM_NAME, FIELD_INLINED, FIELD_LOCATION_ADDRESS, FIELD_LOCATION_LINE, FIELD_MAPPING_BUILD_ID, FIELD_MAPPING_FILE, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
15
|
+
import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_START_LINE, FIELD_FUNCTION_SYSTEM_NAME, FIELD_INLINED, FIELD_LOCATION_ADDRESS, FIELD_LOCATION_LINE, FIELD_MAPPING_BUILD_ID, FIELD_MAPPING_FILE, FIELD_TIMESTAMP, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
16
16
|
import { arrowToString } from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
|
|
17
17
|
import { useProfileViewContext } from '../../ProfileView/context/ProfileViewContext';
|
|
18
18
|
import { useQuery } from '../../useQuery';
|
|
@@ -28,6 +28,7 @@ export const useGraphTooltipMetaInfo = ({ table, row }) => {
|
|
|
28
28
|
const lineNumber = locationLine !== 0n ? locationLine : functionStartLine !== 0n ? functionStartLine : undefined;
|
|
29
29
|
const labelPrefix = 'labels.';
|
|
30
30
|
const labelColumnNames = table.schema.fields.filter(field => field.name.startsWith(labelPrefix));
|
|
31
|
+
const timestamp = table.getChild(FIELD_TIMESTAMP)?.get(row);
|
|
31
32
|
const { queryServiceClient, enableSourcesView } = useParcaContext();
|
|
32
33
|
const { profileSource } = useProfileViewContext();
|
|
33
34
|
const { isLoading: sourceLoading, response: sourceResponse } = useQuery(queryServiceClient, profileSource, QueryRequest_ReportType.SOURCE, {
|
|
@@ -84,5 +85,6 @@ export const useGraphTooltipMetaInfo = ({ table, row }) => {
|
|
|
84
85
|
mappingBuildID,
|
|
85
86
|
mappingFile,
|
|
86
87
|
inlined,
|
|
88
|
+
timestamp,
|
|
87
89
|
};
|
|
88
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IcicleChartRootNode.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IcicleChartRootNode.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAa,eAAe,EAAY,MAAM,oBAAoB,CAAC;AAG1E,UAAU,gCAAgC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,mBAAmB,gFAyH9B,CAAC"}
|
|
@@ -15,13 +15,14 @@ import React from 'react';
|
|
|
15
15
|
import cx from 'classnames';
|
|
16
16
|
import twColors from 'tailwindcss/colors';
|
|
17
17
|
import { scaleLinear } from '@parca/utilities';
|
|
18
|
-
import { FIELD_CHILDREN, FIELD_CUMULATIVE,
|
|
18
|
+
import { FIELD_CHILDREN, FIELD_CUMULATIVE, FIELD_DURATION, FIELD_TIMESTAMP } from '.';
|
|
19
19
|
import { IcicleNode, RowHeight } from './IcicleGraphNodes';
|
|
20
|
-
import {
|
|
20
|
+
import { boundsFromProfileSource } from './utils';
|
|
21
21
|
export const IcicleChartRootNode = React.memo(function IcicleChartRootNodeNonMemo({ table, row, colors, colorBy, y, height, setCurPath, curPath, level, path, total, totalWidth, xScale, searchString, setHoveringRow, setHoveringLevel, sortBy, darkMode, compareMode, profileType, isContextMenuOpen, hoveringName, setHoveringName, hoveringRow, colorForSimilarNodes, highlightSimilarStacksPreference, profileSource, }) {
|
|
22
22
|
// get the columns to read from
|
|
23
|
+
const durationColumn = table.getChild(FIELD_DURATION);
|
|
24
|
+
const timestampColumn = table.getChild(FIELD_TIMESTAMP);
|
|
23
25
|
const cumulativeColumn = table.getChild(FIELD_CUMULATIVE);
|
|
24
|
-
const groupByMetadata = table.getChild(FIELD_GROUPBY_METADATA);
|
|
25
26
|
const cumulative = cumulativeColumn?.get(row) !== null ? BigInt(cumulativeColumn?.get(row)) : 0n;
|
|
26
27
|
const childRows = Array.from(table.getChild(FIELD_CHILDREN)?.get(row) ?? []).sort((a, b) => a - b);
|
|
27
28
|
const tsBounds = boundsFromProfileSource(profileSource);
|
|
@@ -35,13 +36,10 @@ export const IcicleChartRootNode = React.memo(function IcicleChartRootNodeNonMem
|
|
|
35
36
|
return _jsx(_Fragment, { children: null });
|
|
36
37
|
}
|
|
37
38
|
return (_jsx(_Fragment, { children: childRows.map(row => {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const duration = parseInt(durationStr, 10);
|
|
43
|
-
const x = tsXScale(tsNanos);
|
|
44
|
-
const width = tsXScale(tsNanos + BigInt(Math.round(duration))) - x;
|
|
39
|
+
const duration = durationColumn?.get(row) !== null ? BigInt(durationColumn?.get(row)) : 0n;
|
|
40
|
+
const timestamp = timestampColumn?.get(row) !== null ? BigInt(timestampColumn?.get(row)) : 0n;
|
|
41
|
+
const x = tsXScale(timestamp);
|
|
42
|
+
const width = tsXScale(timestamp + BigInt(Math.round(Number(duration)))) - x;
|
|
45
43
|
const cumulative = cumulativeColumn?.get(row) !== null ? BigInt(cumulativeColumn?.get(row)) : 0n;
|
|
46
44
|
const newXScale = scaleLinear([0n, BigInt(cumulative)], [0, width]);
|
|
47
45
|
return (_jsxs(_Fragment, { children: [_jsxs("g", { transform: `translate(${x + 1}, ${y + 1})`, children: [_jsx("rect", { x: 0, y: 0, width: width, height: RowHeight, style: {
|
package/dist/ProfileSource.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileSource.d.ts","sourceRoot":"","sources":["../src/ProfileSource.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,oBAAoB,EAEpB,YAAY,EAIb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAqB,WAAW,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAGrE,MAAM,WAAW,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AAW;IAI1B,QAAQ,IAAI,GAAG,CAAC,OAAO;IAQvB,QAAQ,IAAI,MAAM;CAUnB;AAED,qBAAa,mBAAoB,YAAW,aAAa;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,WAAW,CAAC;gBAEb,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,MAAM;IAQlF,aAAa,IAAI,oBAAoB;IAcrC,YAAY,IAAI,YAAY;IAiB5B,WAAW,IAAI,WAAW;IAI1B,cAAc,IAAI,MAAM,EAAE;IAM1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM;CAmBpC"}
|
package/dist/ProfileSource.js
CHANGED
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
14
14
|
import { ProfileDiffSelection_Mode, QueryRequest_Mode, QueryRequest_ReportType, Timestamp, } from '@parca/client';
|
|
15
15
|
import { NewParser, ProfileType, Query } from '@parca/parser';
|
|
16
16
|
import { formatDate, formatDuration } from '@parca/utilities';
|
|
17
|
-
const timeFormat = (timezone) => {
|
|
17
|
+
export const timeFormat = (timezone) => {
|
|
18
18
|
if (timezone !== undefined) {
|
|
19
19
|
return 'yyyy-MM-dd HH:mm:ss';
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.470",
|
|
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.
|
|
9
|
+
"@parca/components": "0.16.321",
|
|
10
10
|
"@parca/dynamicsize": "0.16.65",
|
|
11
|
-
"@parca/hooks": "0.0.
|
|
11
|
+
"@parca/hooks": "0.0.79",
|
|
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.165",
|
|
15
|
+
"@parca/utilities": "0.0.91",
|
|
16
16
|
"@popperjs/core": "^2.11.8",
|
|
17
17
|
"@protobuf-ts/runtime-rpc": "^2.5.0",
|
|
18
18
|
"@storybook/preview-api": "^8.4.3",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"access": "public",
|
|
76
76
|
"registry": "https://registry.npmjs.org/"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "487d4b97e6da9903b123b9292c214c0b17796d93"
|
|
79
79
|
}
|
|
@@ -16,8 +16,9 @@ import React from 'react';
|
|
|
16
16
|
import {Icon} from '@iconify/react';
|
|
17
17
|
import {Table} from 'apache-arrow';
|
|
18
18
|
|
|
19
|
+
import {useParcaContext} from '@parca/components';
|
|
19
20
|
import {ProfileType} from '@parca/parser';
|
|
20
|
-
import {getLastItem} from '@parca/utilities';
|
|
21
|
+
import {formatDateTimeDownToMS, getLastItem} from '@parca/utilities';
|
|
21
22
|
|
|
22
23
|
import {hexifyAddress, truncateString, truncateStringReverse} from '../utils';
|
|
23
24
|
import {ExpandOnHover} from './ExpandOnHoverValue';
|
|
@@ -141,7 +142,9 @@ const TooltipMetaInfo = ({table, row}: {table: Table<any>; row: number}): React.
|
|
|
141
142
|
mappingFile,
|
|
142
143
|
mappingBuildID,
|
|
143
144
|
inlined,
|
|
145
|
+
timestamp,
|
|
144
146
|
} = useGraphTooltipMetaInfo({table, row});
|
|
147
|
+
const {timezone} = useParcaContext();
|
|
145
148
|
|
|
146
149
|
const labels = labelPairs.map(
|
|
147
150
|
(l): React.JSX.Element => (
|
|
@@ -159,9 +162,19 @@ const TooltipMetaInfo = ({table, row}: {table: Table<any>; row: number}): React.
|
|
|
159
162
|
|
|
160
163
|
return (
|
|
161
164
|
<>
|
|
165
|
+
{timestamp == null || timestamp === 0n ? (
|
|
166
|
+
<div className="pt-2" />
|
|
167
|
+
) : (
|
|
168
|
+
<tr>
|
|
169
|
+
<td className="w-1/4 pt-2">Timestamp</td>
|
|
170
|
+
<td className="w-3/4 pt-2 break-all">
|
|
171
|
+
{formatDateTimeDownToMS(new Date(Number(timestamp / 1000000n)), timezone)}
|
|
172
|
+
</td>{' '}
|
|
173
|
+
</tr>
|
|
174
|
+
)}
|
|
162
175
|
<tr>
|
|
163
|
-
<td className="w-1/4
|
|
164
|
-
<td className="w-3/4
|
|
176
|
+
<td className="w-1/4">File</td>
|
|
177
|
+
<td className="w-3/4 break-all">
|
|
165
178
|
{functionFilename === '' ? (
|
|
166
179
|
<NoData />
|
|
167
180
|
) : (
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
FIELD_LOCATION_LINE,
|
|
26
26
|
FIELD_MAPPING_BUILD_ID,
|
|
27
27
|
FIELD_MAPPING_FILE,
|
|
28
|
+
FIELD_TIMESTAMP,
|
|
28
29
|
} from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
29
30
|
import {arrowToString} from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
|
|
30
31
|
import {ProfileSource} from '../../ProfileSource';
|
|
@@ -47,6 +48,7 @@ interface GraphTooltipMetaInfoData {
|
|
|
47
48
|
mappingFile: string | null;
|
|
48
49
|
mappingBuildID: string | null;
|
|
49
50
|
inlined: boolean | null;
|
|
51
|
+
timestamp: bigint | null;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
export const useGraphTooltipMetaInfo = ({table, row}: Props): GraphTooltipMetaInfoData => {
|
|
@@ -66,6 +68,7 @@ export const useGraphTooltipMetaInfo = ({table, row}: Props): GraphTooltipMetaIn
|
|
|
66
68
|
locationLine !== 0n ? locationLine : functionStartLine !== 0n ? functionStartLine : undefined;
|
|
67
69
|
const labelPrefix = 'labels.';
|
|
68
70
|
const labelColumnNames = table.schema.fields.filter(field => field.name.startsWith(labelPrefix));
|
|
71
|
+
const timestamp = table.getChild(FIELD_TIMESTAMP)?.get(row);
|
|
69
72
|
|
|
70
73
|
const {queryServiceClient, enableSourcesView} = useParcaContext();
|
|
71
74
|
const {profileSource} = useProfileViewContext();
|
|
@@ -140,5 +143,6 @@ export const useGraphTooltipMetaInfo = ({table, row}: Props): GraphTooltipMetaIn
|
|
|
140
143
|
mappingBuildID,
|
|
141
144
|
mappingFile,
|
|
142
145
|
inlined,
|
|
146
|
+
timestamp,
|
|
143
147
|
};
|
|
144
148
|
};
|
|
@@ -13,16 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
|
|
16
|
-
import {Binary, StructRow} from 'apache-arrow';
|
|
17
16
|
import cx from 'classnames';
|
|
18
17
|
import twColors from 'tailwindcss/colors';
|
|
19
18
|
|
|
20
19
|
import {scaleLinear} from '@parca/utilities';
|
|
21
20
|
|
|
22
|
-
import {FIELD_CHILDREN, FIELD_CUMULATIVE,
|
|
21
|
+
import {FIELD_CHILDREN, FIELD_CUMULATIVE, FIELD_DURATION, FIELD_TIMESTAMP} from '.';
|
|
23
22
|
import {ProfileSource} from '../../ProfileSource';
|
|
24
23
|
import {IcicleNode, IcicleNodeProps, RowHeight} from './IcicleGraphNodes';
|
|
25
|
-
import {
|
|
24
|
+
import {boundsFromProfileSource} from './utils';
|
|
26
25
|
|
|
27
26
|
interface IcicleChartRootNodeSpecificProps {
|
|
28
27
|
profileSource?: ProfileSource;
|
|
@@ -58,8 +57,9 @@ export const IcicleChartRootNode = React.memo(function IcicleChartRootNodeNonMem
|
|
|
58
57
|
profileSource,
|
|
59
58
|
}: IcicleNodeProps & IcicleChartRootNodeSpecificProps): React.JSX.Element {
|
|
60
59
|
// get the columns to read from
|
|
60
|
+
const durationColumn = table.getChild(FIELD_DURATION);
|
|
61
|
+
const timestampColumn = table.getChild(FIELD_TIMESTAMP);
|
|
61
62
|
const cumulativeColumn = table.getChild(FIELD_CUMULATIVE);
|
|
62
|
-
const groupByMetadata = table.getChild(FIELD_GROUPBY_METADATA);
|
|
63
63
|
const cumulative = cumulativeColumn?.get(row) !== null ? BigInt(cumulativeColumn?.get(row)) : 0n;
|
|
64
64
|
const childRows: number[] = Array.from<number>(
|
|
65
65
|
table.getChild(FIELD_CHILDREN)?.get(row) ?? []
|
|
@@ -83,18 +83,12 @@ export const IcicleChartRootNode = React.memo(function IcicleChartRootNodeNonMem
|
|
|
83
83
|
return (
|
|
84
84
|
<>
|
|
85
85
|
{childRows.map(row => {
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const duration = durationColumn?.get(row) !== null ? BigInt(durationColumn?.get(row)) : 0n;
|
|
87
|
+
const timestamp =
|
|
88
|
+
timestampColumn?.get(row) !== null ? BigInt(timestampColumn?.get(row)) : 0n;
|
|
89
89
|
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const tsNanos = BigInt(parseInt(tsStr, 10));
|
|
93
|
-
const durationStr = arrowToString(groupByFields.duration) as string;
|
|
94
|
-
const duration = parseInt(durationStr, 10);
|
|
95
|
-
|
|
96
|
-
const x = tsXScale(tsNanos);
|
|
97
|
-
const width = tsXScale(tsNanos + BigInt(Math.round(duration))) - x;
|
|
90
|
+
const x = tsXScale(timestamp);
|
|
91
|
+
const width = tsXScale(timestamp + BigInt(Math.round(Number(duration)))) - x;
|
|
98
92
|
|
|
99
93
|
const cumulative =
|
|
100
94
|
cumulativeColumn?.get(row) !== null ? BigInt(cumulativeColumn?.get(row)) : 0n;
|
package/src/ProfileSource.tsx
CHANGED
|
@@ -35,7 +35,8 @@ export interface ProfileSelection {
|
|
|
35
35
|
ProfileSource: () => ProfileSource;
|
|
36
36
|
Type: () => string;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
export const timeFormat = (timezone?: string): string => {
|
|
39
40
|
if (timezone !== undefined) {
|
|
40
41
|
return 'yyyy-MM-dd HH:mm:ss';
|
|
41
42
|
}
|