@parca/profile 0.12.36 → 0.13.0
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/package.json +5 -5
- package/src/IcicleGraph.tsx +2 -2
- package/src/ProfileIcicleGraph.tsx +12 -8
- package/src/ProfileView.tsx +18 -25
- package/src/testdata/test_flamegraph.json +26846 -0
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.13.0](https://github.com/parca-dev/parca/compare/ui-v0.12.38...ui-v0.13.0) (2022-05-30)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- useContainerDimensions hook for smooth chart resize ([3fe5670](https://github.com/parca-dev/parca/commit/3fe5670cb94e838d83e5cb10d453ee620c2dc3c1))
|
|
11
|
+
|
|
12
|
+
## [0.12.36](https://github.com/parca-dev/parca/compare/ui-v0.12.35...ui-v0.12.36) (2022-05-06)
|
|
13
|
+
|
|
6
14
|
## [0.12.36](https://github.com/parca-dev/parca/compare/ui-v0.12.35...ui-v0.12.36) (2022-05-06)
|
|
7
15
|
|
|
8
16
|
**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.0",
|
|
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": "4d00bb1f08c62bc8c33285f6844a0a4386f31442"
|
|
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, Spinner, useGrpcMetadata, useParcaTheme} 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';
|
|
@@ -172,14 +169,12 @@ export const ProfileView = ({
|
|
|
172
169
|
response !== null &&
|
|
173
170
|
response.report.oneofKind === 'flamegraph' && (
|
|
174
171
|
<div className="w-full">
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
/>
|
|
182
|
-
</CalcWidth>
|
|
172
|
+
<ProfileIcicleGraph
|
|
173
|
+
curPath={curPath}
|
|
174
|
+
setNewCurPath={setNewCurPath}
|
|
175
|
+
graph={response.report.flamegraph}
|
|
176
|
+
sampleUnit={sampleUnit}
|
|
177
|
+
/>
|
|
183
178
|
</div>
|
|
184
179
|
)}
|
|
185
180
|
|
|
@@ -204,18 +199,16 @@ export const ProfileView = ({
|
|
|
204
199
|
</div>
|
|
205
200
|
|
|
206
201
|
<div className="w-1/2">
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
response
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
/>
|
|
218
|
-
</CalcWidth>
|
|
202
|
+
<ProfileIcicleGraph
|
|
203
|
+
curPath={curPath}
|
|
204
|
+
setNewCurPath={setNewCurPath}
|
|
205
|
+
graph={
|
|
206
|
+
response?.report.oneofKind === 'flamegraph'
|
|
207
|
+
? response.report.flamegraph
|
|
208
|
+
: undefined
|
|
209
|
+
}
|
|
210
|
+
sampleUnit={sampleUnit}
|
|
211
|
+
/>
|
|
219
212
|
</div>
|
|
220
213
|
</>
|
|
221
214
|
)}
|