@parca/profile 0.16.229 → 0.16.230
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,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.230](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.229...@parca/profile@0.16.230) (2023-08-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.16.229](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.228...@parca/profile@0.16.229) (2023-08-23)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -12,6 +12,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { useState } from 'react';
|
|
15
|
+
import cx from 'classnames';
|
|
15
16
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
16
17
|
import { Tooltip } from 'react-tooltip';
|
|
17
18
|
import { QueryRequest_ReportType } from '@parca/client';
|
|
@@ -70,10 +71,10 @@ onCopy, row, navigateTo, }) => {
|
|
|
70
71
|
const functionStartLine = table.getChild(FIELD_FUNCTION_START_LINE)?.get(row) ?? 0n;
|
|
71
72
|
const pprofLabelPrefix = 'pprof_labels.';
|
|
72
73
|
const labelColumnNames = table.schema.fields.filter(field => field.name.startsWith(pprofLabelPrefix));
|
|
73
|
-
const { queryServiceClient } = useParcaContext();
|
|
74
|
+
const { queryServiceClient, enableSourcesView } = useParcaContext();
|
|
74
75
|
const { profileSource } = useProfileViewContext();
|
|
75
76
|
const { isLoading: sourceLoading, response: sourceResponse } = useQuery(queryServiceClient, profileSource, QueryRequest_ReportType.SOURCE, {
|
|
76
|
-
skip: profileSource === undefined,
|
|
77
|
+
skip: enableSourcesView === false || profileSource === undefined,
|
|
77
78
|
sourceBuildID: mappingBuildID,
|
|
78
79
|
sourceFilename: functionFilename,
|
|
79
80
|
sourceOnly: true,
|
|
@@ -119,6 +120,6 @@ onCopy, row, navigateTo, }) => {
|
|
|
119
120
|
setSourceFilename(functionFilename);
|
|
120
121
|
setSourceLine(locationLine.toString());
|
|
121
122
|
};
|
|
122
|
-
return (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "File" }), _jsx("td", { className: "w-3/4 break-all", children: functionFilename === '' ? (_jsx(NoData, {})) : (_jsxs("div", { className: "flex gap-4", children: [_jsx(CopyToClipboard, { onCopy: onCopy, text: file, children: _jsx("button", { className: "cursor-pointer whitespace-nowrap text-left", children: _jsx(ExpandOnHover, { value: file, displayValue: truncateStringReverse(file, 30) }) }) }), _jsxs("div", { className:
|
|
123
|
+
return (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "File" }), _jsx("td", { className: "w-3/4 break-all", children: functionFilename === '' ? (_jsx(NoData, {})) : (_jsxs("div", { className: "flex gap-4", children: [_jsx(CopyToClipboard, { onCopy: onCopy, text: file, children: _jsx("button", { className: "cursor-pointer whitespace-nowrap text-left", children: _jsx(ExpandOnHover, { value: file, displayValue: truncateStringReverse(file, 30) }) }) }), _jsxs("div", { className: cx('flex gap-2', { hidden: enableSourcesView === false }), children: [_jsx("div", { "data-tooltip-id": "open-source-button-help", "data-tooltip-content": "There is no source code uploaded for this build", children: _jsx(Button, { variant: 'neutral', onClick: () => openFile(), className: "shrink-0", disabled: !isSourceAvailable, children: "open" }) }), !isSourceAvailable ? _jsx(Tooltip, { id: "open-source-button-help" }) : null] })] })) })] }), _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(CopyToClipboard, { onCopy: onCopy, text: hexifyAddress(locationAddress), children: _jsx("button", { className: "cursor-pointer", children: hexifyAddress(locationAddress) }) })) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Binary" }), _jsx("td", { className: "w-3/4 break-all", children: mappingFile === '' ? (_jsx(NoData, {})) : (_jsx(CopyToClipboard, { onCopy: onCopy, text: mappingFile, children: _jsx("button", { className: "cursor-pointer", children: getLastItem(mappingFile) }) })) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Build Id" }), _jsx("td", { className: "w-3/4 break-all", children: mappingBuildID === '' ? (_jsx(NoData, {})) : (_jsx(CopyToClipboard, { onCopy: onCopy, text: mappingBuildID, children: _jsx("button", { className: "cursor-pointer", children: truncateString(getLastItem(mappingBuildID), 28) }) })) })] }), labelPairs.length > 0 && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Labels" }), _jsx("td", { className: "w-3/4 break-all", children: labels })] }))] }));
|
|
123
124
|
};
|
|
124
125
|
export default GraphTooltipArrowContent;
|
|
@@ -11,7 +11,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import { Select, useURLState } from '@parca/components';
|
|
14
|
+
import { Select, useParcaContext, useURLState } from '@parca/components';
|
|
15
15
|
import { useUIFeatureFlag } from '@parca/hooks';
|
|
16
16
|
const ViewSelector = ({ defaultValue, navigateTo, position, placeholderText, primary = false, addView = false, disabled = false, }) => {
|
|
17
17
|
const [callgraphEnabled] = useUIFeatureFlag('callgraph');
|
|
@@ -19,11 +19,14 @@ const ViewSelector = ({ defaultValue, navigateTo, position, placeholderText, pri
|
|
|
19
19
|
param: 'dashboard_items',
|
|
20
20
|
navigateTo,
|
|
21
21
|
});
|
|
22
|
+
const { enableSourcesView } = useParcaContext();
|
|
22
23
|
const allItems = [
|
|
23
24
|
{ key: 'table', canBeSelected: !dashboardItems.includes('table') },
|
|
24
25
|
{ key: 'icicle', canBeSelected: !dashboardItems.includes('icicle') },
|
|
25
|
-
{ key: 'source', canBeSelected: false },
|
|
26
26
|
];
|
|
27
|
+
if (enableSourcesView === true) {
|
|
28
|
+
allItems.push({ key: 'source', canBeSelected: false });
|
|
29
|
+
}
|
|
27
30
|
if (callgraphEnabled) {
|
|
28
31
|
allItems.push({
|
|
29
32
|
key: 'callgraph',
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.230",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@parca/client": "^0.16.86",
|
|
7
|
-
"@parca/components": "^0.16.
|
|
7
|
+
"@parca/components": "^0.16.183",
|
|
8
8
|
"@parca/dynamicsize": "^0.16.54",
|
|
9
9
|
"@parca/hooks": "^0.0.21",
|
|
10
10
|
"@parca/parser": "^0.16.55",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"access": "public",
|
|
50
50
|
"registry": "https://registry.npmjs.org/"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "79fbf41f87bbd157c49568591abe9bcea3a38afa"
|
|
53
53
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import React, {useState} from 'react';
|
|
15
15
|
|
|
16
16
|
import {Table} from 'apache-arrow';
|
|
17
|
+
import cx from 'classnames';
|
|
17
18
|
import {CopyToClipboard} from 'react-copy-to-clipboard';
|
|
18
19
|
import {Tooltip} from 'react-tooltip';
|
|
19
20
|
|
|
@@ -200,7 +201,7 @@ const TooltipMetaInfo = ({
|
|
|
200
201
|
field.name.startsWith(pprofLabelPrefix)
|
|
201
202
|
);
|
|
202
203
|
|
|
203
|
-
const {queryServiceClient} = useParcaContext();
|
|
204
|
+
const {queryServiceClient, enableSourcesView} = useParcaContext();
|
|
204
205
|
const {profileSource} = useProfileViewContext();
|
|
205
206
|
|
|
206
207
|
const {isLoading: sourceLoading, response: sourceResponse} = useQuery(
|
|
@@ -208,7 +209,7 @@ const TooltipMetaInfo = ({
|
|
|
208
209
|
profileSource as ProfileSource,
|
|
209
210
|
QueryRequest_ReportType.SOURCE,
|
|
210
211
|
{
|
|
211
|
-
skip: profileSource === undefined,
|
|
212
|
+
skip: enableSourcesView === false || profileSource === undefined,
|
|
212
213
|
sourceBuildID: mappingBuildID,
|
|
213
214
|
sourceFilename: functionFilename,
|
|
214
215
|
sourceOnly: true,
|
|
@@ -289,7 +290,7 @@ const TooltipMetaInfo = ({
|
|
|
289
290
|
<ExpandOnHover value={file} displayValue={truncateStringReverse(file, 30)} />
|
|
290
291
|
</button>
|
|
291
292
|
</CopyToClipboard>
|
|
292
|
-
<div className=
|
|
293
|
+
<div className={cx('flex gap-2', {hidden: enableSourcesView === false})}>
|
|
293
294
|
<div
|
|
294
295
|
data-tooltip-id="open-source-button-help"
|
|
295
296
|
data-tooltip-content="There is no source code uploaded for this build"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
|
|
14
|
-
import {Select, useURLState, type SelectElement} from '@parca/components';
|
|
14
|
+
import {Select, useParcaContext, useURLState, type SelectElement} from '@parca/components';
|
|
15
15
|
import {useUIFeatureFlag} from '@parca/hooks';
|
|
16
16
|
import type {NavigateFunction} from '@parca/utilities';
|
|
17
17
|
|
|
@@ -39,12 +39,15 @@ const ViewSelector = ({
|
|
|
39
39
|
param: 'dashboard_items',
|
|
40
40
|
navigateTo,
|
|
41
41
|
});
|
|
42
|
+
const {enableSourcesView} = useParcaContext();
|
|
42
43
|
|
|
43
44
|
const allItems: Array<{key: string; canBeSelected: boolean; supportingText?: string}> = [
|
|
44
45
|
{key: 'table', canBeSelected: !dashboardItems.includes('table')},
|
|
45
46
|
{key: 'icicle', canBeSelected: !dashboardItems.includes('icicle')},
|
|
46
|
-
{key: 'source', canBeSelected: false},
|
|
47
47
|
];
|
|
48
|
+
if (enableSourcesView === true) {
|
|
49
|
+
allItems.push({key: 'source', canBeSelected: false});
|
|
50
|
+
}
|
|
48
51
|
if (callgraphEnabled) {
|
|
49
52
|
allItems.push({
|
|
50
53
|
key: 'callgraph',
|