@parca/profile 0.16.82 → 0.16.83
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/IcicleGraph.js +10 -4
- package/dist/ProfileView/index.js +3 -6
- package/dist/components/ProfileShareButton/index.d.ts +2 -1
- package/dist/components/ProfileShareButton/index.js +3 -3
- package/package.json +4 -4
- package/src/IcicleGraph.tsx +12 -5
- package/src/ProfileView/index.tsx +50 -48
- package/src/components/ProfileShareButton/index.tsx +3 -2
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.83](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.82...@parca/profile@0.16.83) (2022-12-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.16.82](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.81...@parca/profile@0.16.82) (2022-12-12)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
package/dist/IcicleGraph.js
CHANGED
|
@@ -22,7 +22,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
22
22
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
23
|
// See the License for the specific language governing permissions and
|
|
24
24
|
// limitations under the License.
|
|
25
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
25
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
26
26
|
import { throttle } from 'lodash';
|
|
27
27
|
import { pointer } from 'd3-selection';
|
|
28
28
|
import { scaleLinear } from 'd3-scale';
|
|
@@ -153,15 +153,21 @@ export default function IcicleGraph(_a) {
|
|
|
153
153
|
setHeight(ref === null || ref === void 0 ? void 0 : ref.current.getBoundingClientRect().height);
|
|
154
154
|
}
|
|
155
155
|
}, [width]);
|
|
156
|
-
|
|
156
|
+
var total = useMemo(function () { return parseFloat(graph.total); }, [graph.total]);
|
|
157
|
+
var xScale = useMemo(function () {
|
|
158
|
+
if (width === undefined) {
|
|
159
|
+
return function () { return 0; };
|
|
160
|
+
}
|
|
161
|
+
return scaleLinear().domain([0, total]).range([0, width]);
|
|
162
|
+
}, [total, width]);
|
|
163
|
+
if (graph.root === undefined || width === undefined) {
|
|
157
164
|
return _jsx(_Fragment, {});
|
|
165
|
+
}
|
|
158
166
|
var throttledSetPos = throttle(setPos, 20);
|
|
159
167
|
var onMouseMove = function (e) {
|
|
160
168
|
// X/Y coordinate array relative to svg
|
|
161
169
|
var rel = pointer(e);
|
|
162
170
|
throttledSetPos([rel[0], rel[1]]);
|
|
163
171
|
};
|
|
164
|
-
var total = parseFloat(graph.total);
|
|
165
|
-
var xScale = scaleLinear().domain([0, total]).range([0, width]);
|
|
166
172
|
return (_jsxs("div", __assign({ onMouseLeave: function () { return setHoveringNode(undefined); } }, { children: [_jsx(GraphTooltip, { unit: sampleUnit, total: total, x: pos[0], y: pos[1], hoveringNode: hoveringNode, contextElement: svg.current, strings: graph.stringTable, mappings: graph.mapping, locations: graph.locations, functions: graph.function }), _jsx("svg", __assign({ className: "font-robotoMono", width: width, height: height, onMouseMove: onMouseMove, preserveAspectRatio: "xMinYMid", ref: svg }, { children: _jsx("g", __assign({ ref: ref }, { children: _jsx(MemoizedIcicleGraphRootNode, { node: graph.root, strings: graph.stringTable, mappings: graph.mapping, locations: graph.locations, functions: graph.function, setHoveringNode: setHoveringNode, curPath: curPath, setCurPath: setCurPath, xScale: xScale, total: total, totalWidth: width }) })) }))] })));
|
|
167
173
|
}
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
// Copyright 2022 The Parca Authors
|
|
14
14
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
15
|
// you may not use this file except in compliance with the License.
|
|
@@ -109,9 +109,6 @@ export var ProfileView = function (_a) {
|
|
|
109
109
|
currentSearchString,
|
|
110
110
|
]);
|
|
111
111
|
var isLoaderVisible = useDelayedLoader(isLoading);
|
|
112
|
-
if (isLoaderVisible) {
|
|
113
|
-
return _jsx(_Fragment, { children: loader });
|
|
114
|
-
}
|
|
115
112
|
if ((flamegraphData === null || flamegraphData === void 0 ? void 0 : flamegraphData.error) != null) {
|
|
116
113
|
console.error('Error: ', flamegraphData === null || flamegraphData === void 0 ? void 0 : flamegraphData.error);
|
|
117
114
|
return (_jsxs("div", __assign({ className: "p-10 flex justify-center" }, { children: ["An error occurred: ", flamegraphData === null || flamegraphData === void 0 ? void 0 : flamegraphData.error.message] })));
|
|
@@ -137,8 +134,8 @@ export var ProfileView = function (_a) {
|
|
|
137
134
|
// TODO: fix colors for dark mode
|
|
138
135
|
var minColor = scaleLinear([isDarkMode ? 'black' : 'white', maxColor])(0.3);
|
|
139
136
|
var colorRange = [minColor, maxColor];
|
|
140
|
-
return (_jsx(_Fragment, { children: _jsx("div", __assign({ className: "py-3" }, { children: _jsx(Card, { children: _jsxs(Card.Body, { children: [_jsxs("div", __assign({ className: "flex py-3 w-full" }, { children: [_jsxs("div", __assign({ className: "w-2/5 flex space-x-4" }, { children: [_jsxs("div", __assign({ className: "flex space-x-1" }, { children: [profileSource != null && queryClient != null ? (_jsx(ProfileShareButton, { queryRequest: profileSource.QueryRequest(), queryClient: queryClient })) : null, _jsx(Button, __assign({ color: "neutral", onClick: function (e) {
|
|
137
|
+
return (_jsx(_Fragment, { children: _jsx("div", __assign({ className: "py-3" }, { children: _jsx(Card, { children: _jsxs(Card.Body, { children: [_jsxs("div", __assign({ className: "flex py-3 w-full" }, { children: [_jsxs("div", __assign({ className: "w-2/5 flex space-x-4" }, { children: [_jsxs("div", __assign({ className: "flex space-x-1" }, { children: [profileSource != null && queryClient != null ? (_jsx(ProfileShareButton, { queryRequest: profileSource.QueryRequest(), queryClient: queryClient, disabled: isLoading })) : null, _jsx(Button, __assign({ color: "neutral", onClick: function (e) {
|
|
141
138
|
e.preventDefault();
|
|
142
139
|
onDownloadPProf();
|
|
143
|
-
} }, { children: "Download pprof" }))] })), _jsx(FilterByFunctionButton, {})] })), _jsxs("div", __assign({ className: "flex ml-auto gap-2" }, { children: [_jsx(Button, __assign({ color: "neutral", onClick: resetIcicleGraph, disabled: curPath.length === 0, className: "whitespace-nowrap text-ellipsis" }, { children: "Reset View" })), callgraphEnabled ? (_jsx(Button, __assign({ variant: "".concat(currentView === 'callgraph' ? 'primary' : 'neutral'), onClick: function () { return switchProfileView('callgraph'); }, className: "whitespace-nowrap text-ellipsis" }, { children: "Callgraph" }))) : null, _jsxs("div", __assign({ className: "flex" }, { children: [_jsx(Button, __assign({ variant: "".concat(currentView === 'table' ? 'primary' : 'neutral'), className: "items-center rounded-tr-none rounded-br-none w-auto px-8 whitespace-nowrap text-ellipsis no-outline-on-buttons", onClick: function () { return switchProfileView('table'); } }, { children: "Table" })), _jsx(Button, __assign({ variant: "".concat(currentView === 'both' ? 'primary' : 'neutral'), className: "items-center rounded-tl-none rounded-tr-none rounded-bl-none rounded-br-none border-l-0 border-r-0 w-auto px-8 whitespace-nowrap no-outline-on-buttons text-ellipsis", onClick: function () { return switchProfileView('both'); } }, { children: "Both" })), _jsx(Button, __assign({ variant: "".concat(currentView === 'icicle' ? 'primary' : 'neutral'), className: "items-center rounded-tl-none rounded-bl-none w-auto px-8 whitespace-nowrap text-ellipsis no-outline-on-buttons", onClick: function () { return switchProfileView('icicle'); } }, { children: "Icicle Graph" }))] }))] }))] })), _jsxs("div", __assign({ ref: ref, className: "flex space-x-4 justify-between w-full" }, { children: [currentView === 'icicle' && (flamegraphData === null || flamegraphData === void 0 ? void 0 : flamegraphData.data) != null && (_jsx("div", __assign({ className: "w-full" }, { children: _jsx(Profiler, __assign({ id: "icicleGraph", onRender: perf === null || perf === void 0 ? void 0 : perf.onRender }, { children: _jsx(ProfileIcicleGraph, { curPath: curPath, setNewCurPath: setNewCurPath, graph: flamegraphData.data, sampleUnit: sampleUnit }) })) }))), currentView === 'callgraph' && (callgraphData === null || callgraphData === void 0 ? void 0 : callgraphData.data) != null && (_jsx("div", __assign({ className: "w-full" }, { children: (dimensions === null || dimensions === void 0 ? void 0 : dimensions.width) !== undefined && (_jsx(Callgraph, { graph: callgraphData.data, sampleUnit: sampleUnit, width: dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, colorRange: colorRange })) }))), currentView === 'table' && topTableData != null && (_jsx("div", __assign({ className: "w-full" }, { children: _jsx(TopTable, { data: topTableData.data, sampleUnit: sampleUnit }) }))), currentView === 'both' && (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: "w-1/2" }, { children: _jsx(TopTable, { data: topTableData === null || topTableData === void 0 ? void 0 : topTableData.data, sampleUnit: sampleUnit }) })), _jsx("div", __assign({ className: "w-1/2" }, { children: flamegraphData != null && (_jsx(ProfileIcicleGraph, { curPath: curPath, setNewCurPath: setNewCurPath, graph: flamegraphData.data, sampleUnit: sampleUnit })) }))] }))] }))] }) }) })) }));
|
|
140
|
+
}, disabled: isLoading }, { children: "Download pprof" }))] })), _jsx(FilterByFunctionButton, {})] })), _jsxs("div", __assign({ className: "flex ml-auto gap-2" }, { children: [_jsx(Button, __assign({ color: "neutral", onClick: resetIcicleGraph, disabled: curPath.length === 0, className: "whitespace-nowrap text-ellipsis" }, { children: "Reset View" })), callgraphEnabled ? (_jsx(Button, __assign({ variant: "".concat(currentView === 'callgraph' ? 'primary' : 'neutral'), onClick: function () { return switchProfileView('callgraph'); }, className: "whitespace-nowrap text-ellipsis" }, { children: "Callgraph" }))) : null, _jsxs("div", __assign({ className: "flex" }, { children: [_jsx(Button, __assign({ variant: "".concat(currentView === 'table' ? 'primary' : 'neutral'), className: "items-center rounded-tr-none rounded-br-none w-auto px-8 whitespace-nowrap text-ellipsis no-outline-on-buttons", onClick: function () { return switchProfileView('table'); } }, { children: "Table" })), _jsx(Button, __assign({ variant: "".concat(currentView === 'both' ? 'primary' : 'neutral'), className: "items-center rounded-tl-none rounded-tr-none rounded-bl-none rounded-br-none border-l-0 border-r-0 w-auto px-8 whitespace-nowrap no-outline-on-buttons text-ellipsis", onClick: function () { return switchProfileView('both'); } }, { children: "Both" })), _jsx(Button, __assign({ variant: "".concat(currentView === 'icicle' ? 'primary' : 'neutral'), className: "items-center rounded-tl-none rounded-bl-none w-auto px-8 whitespace-nowrap text-ellipsis no-outline-on-buttons", onClick: function () { return switchProfileView('icicle'); } }, { children: "Icicle Graph" }))] }))] }))] })), isLoaderVisible ? (_jsx(_Fragment, { children: loader })) : (_jsxs("div", __assign({ ref: ref, className: "flex space-x-4 justify-between w-full" }, { children: [currentView === 'icicle' && (flamegraphData === null || flamegraphData === void 0 ? void 0 : flamegraphData.data) != null && (_jsx("div", __assign({ className: "w-full" }, { children: _jsx(Profiler, __assign({ id: "icicleGraph", onRender: perf === null || perf === void 0 ? void 0 : perf.onRender }, { children: _jsx(ProfileIcicleGraph, { curPath: curPath, setNewCurPath: setNewCurPath, graph: flamegraphData.data, sampleUnit: sampleUnit }) })) }))), currentView === 'callgraph' && (callgraphData === null || callgraphData === void 0 ? void 0 : callgraphData.data) != null && (_jsx("div", __assign({ className: "w-full" }, { children: (dimensions === null || dimensions === void 0 ? void 0 : dimensions.width) !== undefined && (_jsx(Callgraph, { graph: callgraphData.data, sampleUnit: sampleUnit, width: dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, colorRange: colorRange })) }))), currentView === 'table' && topTableData != null && (_jsx("div", __assign({ className: "w-full" }, { children: _jsx(TopTable, { data: topTableData.data, sampleUnit: sampleUnit }) }))), currentView === 'both' && (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: "w-1/2" }, { children: _jsx(TopTable, { data: topTableData === null || topTableData === void 0 ? void 0 : topTableData.data, sampleUnit: sampleUnit }) })), _jsx("div", __assign({ className: "w-1/2" }, { children: flamegraphData != null && (_jsx(ProfileIcicleGraph, { curPath: curPath, setNewCurPath: setNewCurPath, graph: flamegraphData.data, sampleUnit: sampleUnit })) }))] }))] })))] }) }) })) }));
|
|
144
141
|
};
|
|
@@ -3,6 +3,7 @@ import { QueryRequest, QueryServiceClient } from '@parca/client';
|
|
|
3
3
|
interface Props {
|
|
4
4
|
queryRequest: QueryRequest;
|
|
5
5
|
queryClient: QueryServiceClient;
|
|
6
|
+
disabled?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const ProfileShareButton: ({ queryRequest, queryClient }: Props) => JSX.Element;
|
|
8
|
+
declare const ProfileShareButton: ({ queryRequest, queryClient, disabled }: Props) => JSX.Element;
|
|
8
9
|
export default ProfileShareButton;
|
|
@@ -112,8 +112,8 @@ var ProfileShareModal = function (_a) {
|
|
|
112
112
|
}, disabled: loading || !isFormDataValid(), type: "submit" }, { children: loading ? 'Sharing' : 'Share' })), error !== '' ? _jsx("p", { children: "Something went wrong please try again" }) : null] })) : (_jsxs(_Fragment, { children: [_jsx(ResultBox, { value: sharedLink, className: "mt-4" }), _jsx("div", __assign({ className: "flex justify-center mt-8" }, { children: _jsx(Button, __assign({ variant: "neutral", className: "w-fit", onClick: onClose }, { children: "Close" })) }))] }))] })) })));
|
|
113
113
|
};
|
|
114
114
|
var ProfileShareButton = function (_a) {
|
|
115
|
-
var queryRequest = _a.queryRequest, queryClient = _a.queryClient;
|
|
116
|
-
var
|
|
117
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button, __assign({ color: "neutral", className: "w-fit", onClick: function () { return setIsOpen(true); } }, { children: _jsx(Icon, { icon: "ei:share-apple", width: 20 }) })), _jsx(ProfileShareModal, { isOpen: isOpen, closeModal: function () { return setIsOpen(false); }, queryRequest: queryRequest, queryClient: queryClient })] }));
|
|
115
|
+
var queryRequest = _a.queryRequest, queryClient = _a.queryClient, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
116
|
+
var _c = useState(false), isOpen = _c[0], setIsOpen = _c[1];
|
|
117
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, __assign({ color: "neutral", className: "w-fit", onClick: function () { return setIsOpen(true); }, disabled: disabled }, { children: _jsx(Icon, { icon: "ei:share-apple", width: 20 }) })), _jsx(ProfileShareModal, { isOpen: isOpen, closeModal: function () { return setIsOpen(false); }, queryRequest: queryRequest, queryClient: queryClient })] }));
|
|
118
118
|
};
|
|
119
119
|
export default ProfileShareButton;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.83",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@parca/client": "^0.16.
|
|
7
|
-
"@parca/components": "^0.16.
|
|
6
|
+
"@parca/client": "^0.16.58",
|
|
7
|
+
"@parca/components": "^0.16.72",
|
|
8
8
|
"@parca/dynamicsize": "^0.16.51",
|
|
9
9
|
"@parca/functions": "^0.16.53",
|
|
10
10
|
"@parca/parser": "^0.16.51",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"access": "public",
|
|
43
43
|
"registry": "https://registry.npmjs.org/"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "5cb6f84f78525b2bffd1d498d99e83868d793333"
|
|
46
46
|
}
|
package/src/IcicleGraph.tsx
CHANGED
|
@@ -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 React, {MouseEvent, useEffect, useRef, useState} from 'react';
|
|
14
|
+
import React, {MouseEvent, useEffect, useMemo, useRef, useState} from 'react';
|
|
15
15
|
|
|
16
16
|
import {throttle} from 'lodash';
|
|
17
17
|
import {pointer} from 'd3-selection';
|
|
@@ -385,7 +385,17 @@ export default function IcicleGraph({
|
|
|
385
385
|
}
|
|
386
386
|
}, [width]);
|
|
387
387
|
|
|
388
|
-
|
|
388
|
+
const total = useMemo(() => parseFloat(graph.total), [graph.total]);
|
|
389
|
+
const xScale = useMemo(() => {
|
|
390
|
+
if (width === undefined) {
|
|
391
|
+
return () => 0;
|
|
392
|
+
}
|
|
393
|
+
return scaleLinear().domain([0, total]).range([0, width]);
|
|
394
|
+
}, [total, width]);
|
|
395
|
+
|
|
396
|
+
if (graph.root === undefined || width === undefined) {
|
|
397
|
+
return <></>;
|
|
398
|
+
}
|
|
389
399
|
|
|
390
400
|
const throttledSetPos = throttle(setPos, 20);
|
|
391
401
|
const onMouseMove = (e: React.MouseEvent<SVGSVGElement | HTMLDivElement>): void => {
|
|
@@ -395,9 +405,6 @@ export default function IcicleGraph({
|
|
|
395
405
|
throttledSetPos([rel[0], rel[1]]);
|
|
396
406
|
};
|
|
397
407
|
|
|
398
|
-
const total = parseFloat(graph.total);
|
|
399
|
-
const xScale = scaleLinear().domain([0, total]).range([0, width]);
|
|
400
|
-
|
|
401
408
|
return (
|
|
402
409
|
<div onMouseLeave={() => setHoveringNode(undefined)}>
|
|
403
410
|
<GraphTooltip
|
|
@@ -172,10 +172,6 @@ export const ProfileView = ({
|
|
|
172
172
|
|
|
173
173
|
const isLoaderVisible = useDelayedLoader(isLoading);
|
|
174
174
|
|
|
175
|
-
if (isLoaderVisible) {
|
|
176
|
-
return <>{loader}</>;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
175
|
if (flamegraphData?.error != null) {
|
|
180
176
|
console.error('Error: ', flamegraphData?.error);
|
|
181
177
|
return (
|
|
@@ -228,6 +224,7 @@ export const ProfileView = ({
|
|
|
228
224
|
<ProfileShareButton
|
|
229
225
|
queryRequest={profileSource.QueryRequest()}
|
|
230
226
|
queryClient={queryClient}
|
|
227
|
+
disabled={isLoading}
|
|
231
228
|
/>
|
|
232
229
|
) : null}
|
|
233
230
|
|
|
@@ -237,6 +234,7 @@ export const ProfileView = ({
|
|
|
237
234
|
e.preventDefault();
|
|
238
235
|
onDownloadPProf();
|
|
239
236
|
}}
|
|
237
|
+
disabled={isLoading}
|
|
240
238
|
>
|
|
241
239
|
Download pprof
|
|
242
240
|
</Button>
|
|
@@ -292,58 +290,62 @@ export const ProfileView = ({
|
|
|
292
290
|
</div>
|
|
293
291
|
</div>
|
|
294
292
|
|
|
295
|
-
|
|
296
|
-
{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
graph={flamegraphData.data}
|
|
306
|
-
sampleUnit={sampleUnit}
|
|
307
|
-
/>
|
|
308
|
-
</Profiler>
|
|
309
|
-
</div>
|
|
310
|
-
)}
|
|
311
|
-
{currentView === 'callgraph' && callgraphData?.data != null && (
|
|
312
|
-
<div className="w-full">
|
|
313
|
-
{dimensions?.width !== undefined && (
|
|
314
|
-
<Callgraph
|
|
315
|
-
graph={callgraphData.data}
|
|
316
|
-
sampleUnit={sampleUnit}
|
|
317
|
-
width={dimensions?.width}
|
|
318
|
-
colorRange={colorRange}
|
|
319
|
-
/>
|
|
320
|
-
)}
|
|
321
|
-
</div>
|
|
322
|
-
)}
|
|
323
|
-
{currentView === 'table' && topTableData != null && (
|
|
324
|
-
<div className="w-full">
|
|
325
|
-
<TopTable data={topTableData.data} sampleUnit={sampleUnit} />
|
|
326
|
-
</div>
|
|
327
|
-
)}
|
|
328
|
-
{currentView === 'both' && (
|
|
329
|
-
<>
|
|
330
|
-
<div className="w-1/2">
|
|
331
|
-
<TopTable data={topTableData?.data} sampleUnit={sampleUnit} />
|
|
332
|
-
</div>
|
|
333
|
-
|
|
334
|
-
<div className="w-1/2">
|
|
335
|
-
{flamegraphData != null && (
|
|
293
|
+
{isLoaderVisible ? (
|
|
294
|
+
<>{loader}</>
|
|
295
|
+
) : (
|
|
296
|
+
<div ref={ref} className="flex space-x-4 justify-between w-full">
|
|
297
|
+
{currentView === 'icicle' && flamegraphData?.data != null && (
|
|
298
|
+
<div className="w-full">
|
|
299
|
+
<Profiler
|
|
300
|
+
id="icicleGraph"
|
|
301
|
+
onRender={perf?.onRender as React.ProfilerOnRenderCallback}
|
|
302
|
+
>
|
|
336
303
|
<ProfileIcicleGraph
|
|
337
304
|
curPath={curPath}
|
|
338
305
|
setNewCurPath={setNewCurPath}
|
|
339
306
|
graph={flamegraphData.data}
|
|
340
307
|
sampleUnit={sampleUnit}
|
|
341
308
|
/>
|
|
309
|
+
</Profiler>
|
|
310
|
+
</div>
|
|
311
|
+
)}
|
|
312
|
+
{currentView === 'callgraph' && callgraphData?.data != null && (
|
|
313
|
+
<div className="w-full">
|
|
314
|
+
{dimensions?.width !== undefined && (
|
|
315
|
+
<Callgraph
|
|
316
|
+
graph={callgraphData.data}
|
|
317
|
+
sampleUnit={sampleUnit}
|
|
318
|
+
width={dimensions?.width}
|
|
319
|
+
colorRange={colorRange}
|
|
320
|
+
/>
|
|
342
321
|
)}
|
|
343
322
|
</div>
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
323
|
+
)}
|
|
324
|
+
{currentView === 'table' && topTableData != null && (
|
|
325
|
+
<div className="w-full">
|
|
326
|
+
<TopTable data={topTableData.data} sampleUnit={sampleUnit} />
|
|
327
|
+
</div>
|
|
328
|
+
)}
|
|
329
|
+
{currentView === 'both' && (
|
|
330
|
+
<>
|
|
331
|
+
<div className="w-1/2">
|
|
332
|
+
<TopTable data={topTableData?.data} sampleUnit={sampleUnit} />
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<div className="w-1/2">
|
|
336
|
+
{flamegraphData != null && (
|
|
337
|
+
<ProfileIcicleGraph
|
|
338
|
+
curPath={curPath}
|
|
339
|
+
setNewCurPath={setNewCurPath}
|
|
340
|
+
graph={flamegraphData.data}
|
|
341
|
+
sampleUnit={sampleUnit}
|
|
342
|
+
/>
|
|
343
|
+
)}
|
|
344
|
+
</div>
|
|
345
|
+
</>
|
|
346
|
+
)}
|
|
347
|
+
</div>
|
|
348
|
+
)}
|
|
347
349
|
</Card.Body>
|
|
348
350
|
</Card>
|
|
349
351
|
</div>
|
|
@@ -20,6 +20,7 @@ import ResultBox from './ResultBox';
|
|
|
20
20
|
interface Props {
|
|
21
21
|
queryRequest: QueryRequest;
|
|
22
22
|
queryClient: QueryServiceClient;
|
|
23
|
+
disabled?: boolean;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
interface ProfileShareModalProps {
|
|
@@ -117,12 +118,12 @@ const ProfileShareModal = ({
|
|
|
117
118
|
);
|
|
118
119
|
};
|
|
119
120
|
|
|
120
|
-
const ProfileShareButton = ({queryRequest, queryClient}: Props): JSX.Element => {
|
|
121
|
+
const ProfileShareButton = ({queryRequest, queryClient, disabled = false}: Props): JSX.Element => {
|
|
121
122
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
122
123
|
|
|
123
124
|
return (
|
|
124
125
|
<>
|
|
125
|
-
<Button color="neutral" className="w-fit" onClick={() => setIsOpen(true)}>
|
|
126
|
+
<Button color="neutral" className="w-fit" onClick={() => setIsOpen(true)} disabled={disabled}>
|
|
126
127
|
<Icon icon="ei:share-apple" width={20} />
|
|
127
128
|
</Button>
|
|
128
129
|
<ProfileShareModal
|