@parca/profile 0.12.35 → 0.13.1
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 +16 -0
- package/package.json +5 -5
- package/src/IcicleGraph.tsx +2 -2
- package/src/ProfileIcicleGraph.tsx +12 -8
- package/src/ProfileView.tsx +13 -53
- package/src/testdata/test_flamegraph.json +26846 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.13.1](https://github.com/parca-dev/parca/compare/ui-v0.13.0...ui-v0.13.1) (2022-05-31)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
# [0.13.0](https://github.com/parca-dev/parca/compare/ui-v0.12.38...ui-v0.13.0) (2022-05-30)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- useContainerDimensions hook for smooth chart resize ([3fe5670](https://github.com/parca-dev/parca/commit/3fe5670cb94e838d83e5cb10d453ee620c2dc3c1))
|
|
15
|
+
|
|
16
|
+
## [0.12.36](https://github.com/parca-dev/parca/compare/ui-v0.12.35...ui-v0.12.36) (2022-05-06)
|
|
17
|
+
|
|
18
|
+
## [0.12.36](https://github.com/parca-dev/parca/compare/ui-v0.12.35...ui-v0.12.36) (2022-05-06)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @parca/profile
|
|
21
|
+
|
|
6
22
|
## 0.12.35 (2022-05-05)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @parca/profile
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@parca/client": "^0.
|
|
7
|
-
"@parca/dynamicsize": "^0.
|
|
8
|
-
"@parca/parser": "^0.
|
|
6
|
+
"@parca/client": "^0.13.0",
|
|
7
|
+
"@parca/dynamicsize": "^0.13.0",
|
|
8
|
+
"@parca/parser": "^0.13.0",
|
|
9
9
|
"d3-scale": "^4.0.2"
|
|
10
10
|
},
|
|
11
11
|
"main": "src/index.tsx",
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"access": "public",
|
|
20
20
|
"registry": "https://registry.npmjs.org/"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "e44d25f6f2f07bcae5391f1da61995db723452fb"
|
|
23
23
|
}
|
package/src/IcicleGraph.tsx
CHANGED
|
@@ -521,9 +521,9 @@ export default function IcicleGraph({
|
|
|
521
521
|
/>
|
|
522
522
|
<svg
|
|
523
523
|
className="font-robotoMono"
|
|
524
|
-
width={width}
|
|
525
|
-
height={height}
|
|
526
524
|
onMouseMove={onMouseMove}
|
|
525
|
+
viewBox={`0 0 ${width} ${height}`}
|
|
526
|
+
preserveAspectRatio="xMinYMid"
|
|
527
527
|
ref={svg}
|
|
528
528
|
>
|
|
529
529
|
<g ref={ref}>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {Flamegraph} from '@parca/client';
|
|
2
2
|
import {useAppSelector, selectCompareMode} from '@parca/store';
|
|
3
|
+
import {useContainerDimensions} from '@parca/dynamicsize';
|
|
3
4
|
|
|
4
5
|
import DiffLegend from './components/DiffLegend';
|
|
5
6
|
import IcicleGraph from './IcicleGraph';
|
|
@@ -13,7 +14,6 @@ interface ProfileIcicleGraphProps {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const ProfileIcicleGraph = ({
|
|
16
|
-
width,
|
|
17
17
|
graph,
|
|
18
18
|
curPath,
|
|
19
19
|
setNewCurPath,
|
|
@@ -25,16 +25,20 @@ const ProfileIcicleGraph = ({
|
|
|
25
25
|
const total = graph.total;
|
|
26
26
|
if (parseFloat(total) === 0) return <>Profile has no samples</>;
|
|
27
27
|
|
|
28
|
+
const {ref, dimensions} = useContainerDimensions();
|
|
29
|
+
|
|
28
30
|
return (
|
|
29
31
|
<>
|
|
30
32
|
{compareMode && <DiffLegend />}
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
<div ref={ref}>
|
|
34
|
+
<IcicleGraph
|
|
35
|
+
width={dimensions?.width}
|
|
36
|
+
graph={graph}
|
|
37
|
+
curPath={curPath}
|
|
38
|
+
setCurPath={setNewCurPath}
|
|
39
|
+
sampleUnit={sampleUnit}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
38
42
|
</>
|
|
39
43
|
);
|
|
40
44
|
};
|
package/src/ProfileView.tsx
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React, {useEffect, useState} from 'react';
|
|
2
|
-
import {CalcWidth} from '@parca/dynamicsize';
|
|
3
2
|
import {parseParams} from '@parca/functions';
|
|
4
|
-
import {QueryServiceClient,
|
|
5
|
-
import {
|
|
6
|
-
import {Button, Card, useGrpcMetadata} from '@parca/components';
|
|
7
|
-
import * as parca_query_v1alpha1_query_pb from '@parca/client/src/parca/query/v1alpha1/query_pb';
|
|
3
|
+
import {QueryServiceClient, QueryRequest_ReportType} from '@parca/client';
|
|
4
|
+
import {Button, Card, useGrpcMetadata, useParcaTheme} from '@parca/components';
|
|
8
5
|
|
|
9
6
|
import ProfileIcicleGraph from './ProfileIcicleGraph';
|
|
10
7
|
import {ProfileSource} from './ProfileSource';
|
|
@@ -47,6 +44,7 @@ export const ProfileView = ({
|
|
|
47
44
|
);
|
|
48
45
|
const [currentView, setCurrentView] = useState<string | undefined>(currentViewFromURL);
|
|
49
46
|
const metadata = useGrpcMetadata();
|
|
47
|
+
const {loader} = useParcaTheme();
|
|
50
48
|
|
|
51
49
|
useEffect(() => {
|
|
52
50
|
let showLoaderTimeout;
|
|
@@ -62,39 +60,7 @@ export const ProfileView = ({
|
|
|
62
60
|
}, [isLoading]);
|
|
63
61
|
|
|
64
62
|
if (isLoaderVisible) {
|
|
65
|
-
return
|
|
66
|
-
<div
|
|
67
|
-
style={{
|
|
68
|
-
display: 'flex',
|
|
69
|
-
justifyContent: 'center',
|
|
70
|
-
alignItems: 'center',
|
|
71
|
-
height: 'inherit',
|
|
72
|
-
marginTop: 100,
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
<svg
|
|
76
|
-
className="animate-spin -ml-1 mr-3 h-5 w-5"
|
|
77
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
78
|
-
fill="none"
|
|
79
|
-
viewBox="0 0 24 24"
|
|
80
|
-
>
|
|
81
|
-
<circle
|
|
82
|
-
className="opacity-25"
|
|
83
|
-
cx="12"
|
|
84
|
-
cy="12"
|
|
85
|
-
r="10"
|
|
86
|
-
stroke="currentColor"
|
|
87
|
-
strokeWidth="4"
|
|
88
|
-
></circle>
|
|
89
|
-
<path
|
|
90
|
-
className="opacity-75"
|
|
91
|
-
fill="currentColor"
|
|
92
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
93
|
-
></path>
|
|
94
|
-
</svg>
|
|
95
|
-
<span>Loading...</span>
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
63
|
+
return <>{loader}</>;
|
|
98
64
|
}
|
|
99
65
|
|
|
100
66
|
if (error !== null) {
|
|
@@ -203,14 +169,12 @@ export const ProfileView = ({
|
|
|
203
169
|
response !== null &&
|
|
204
170
|
response.report.oneofKind === 'flamegraph' && (
|
|
205
171
|
<div className="w-full">
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
/>
|
|
213
|
-
</CalcWidth>
|
|
172
|
+
<ProfileIcicleGraph
|
|
173
|
+
curPath={curPath}
|
|
174
|
+
setNewCurPath={setNewCurPath}
|
|
175
|
+
graph={response.report.flamegraph}
|
|
176
|
+
sampleUnit={sampleUnit}
|
|
177
|
+
/>
|
|
214
178
|
</div>
|
|
215
179
|
)}
|
|
216
180
|
|
|
@@ -235,18 +199,14 @@ export const ProfileView = ({
|
|
|
235
199
|
</div>
|
|
236
200
|
|
|
237
201
|
<div className="w-1/2">
|
|
238
|
-
|
|
202
|
+
{response !== null && response.report.oneofKind === 'flamegraph' && (
|
|
239
203
|
<ProfileIcicleGraph
|
|
240
204
|
curPath={curPath}
|
|
241
205
|
setNewCurPath={setNewCurPath}
|
|
242
|
-
graph={
|
|
243
|
-
response?.report.oneofKind === 'flamegraph'
|
|
244
|
-
? response.report.flamegraph
|
|
245
|
-
: undefined
|
|
246
|
-
}
|
|
206
|
+
graph={response.report.flamegraph}
|
|
247
207
|
sampleUnit={sampleUnit}
|
|
248
208
|
/>
|
|
249
|
-
|
|
209
|
+
)}
|
|
250
210
|
</div>
|
|
251
211
|
</>
|
|
252
212
|
)}
|