@parca/profile 0.16.76 → 0.16.78
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/dist/Callgraph/index.d.ts +0 -1
- package/dist/GraphTooltip/index.d.ts +0 -1
- package/dist/GraphTooltip/index.js +5 -6
- package/dist/IcicleGraph.d.ts +0 -1
- package/dist/MatchersInput/SuggestionItem.d.ts +0 -1
- package/dist/MatchersInput/SuggestionsList.d.ts +0 -1
- package/dist/MatchersInput/index.d.ts +0 -1
- package/dist/MetricsCircle/index.d.ts +0 -1
- package/dist/MetricsGraph/index.d.ts +0 -1
- package/dist/MetricsSeries/index.d.ts +0 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts +0 -1
- package/dist/ProfileExplorer/ProfileExplorerSingle.d.ts +0 -1
- package/dist/ProfileExplorer/index.d.ts +0 -1
- package/dist/{ProfileIcicleGraph.d.ts → ProfileIcicleGraph/index.d.ts} +0 -1
- package/dist/{ProfileIcicleGraph.js → ProfileIcicleGraph/index.js} +2 -2
- package/dist/ProfileMetricsGraph/index.d.ts +0 -1
- package/dist/ProfileSelector/CompareButton.d.ts +0 -1
- package/dist/ProfileSelector/MergeButton.d.ts +0 -1
- package/dist/ProfileSelector/index.d.ts +0 -1
- package/dist/ProfileSource.d.ts +0 -1
- package/dist/ProfileSource.js +1 -1
- package/dist/ProfileTypeSelector/index.d.ts +0 -1
- package/dist/ProfileView/FilterByFunctionButton.d.ts +0 -1
- package/dist/ProfileView/index.d.ts +0 -1
- package/dist/ProfileViewWithData.d.ts +0 -1
- package/dist/TopTable.d.ts +0 -1
- package/dist/components/DiffLegend.d.ts +0 -1
- package/dist/components/ProfileShareButton/ResultBox.d.ts +0 -1
- package/dist/components/ProfileShareButton/index.d.ts +0 -1
- package/package.json +4 -4
- package/src/GraphTooltip/index.tsx +1 -2
- package/src/{ProfileIcicleGraph.stories.mdx → ProfileIcicleGraph/ProfileIcicleGraph.stories.mdx} +0 -0
- package/src/ProfileIcicleGraph/benchmarks/ProfileIcicleGraph-10M.benchmark.tsx +38 -0
- package/src/ProfileIcicleGraph/benchmarks/ProfileIcicleGraph-1M.benchmark.tsx +38 -0
- package/src/ProfileIcicleGraph/benchmarks/ProfileIcicleGraph-20M.benchmark.tsx +38 -0
- package/src/ProfileIcicleGraph/benchmarks/benchdata/populateData.js +85 -0
- package/src/{ProfileIcicleGraph.tsx → ProfileIcicleGraph/index.tsx} +2 -2
- package/src/ProfileSource.tsx +1 -1
- package/tsconfig.json +1 -1
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.16.78](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.77...@parca/profile@0.16.78) (2022-12-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.16.77](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.76...@parca/profile@0.16.77) (2022-11-29)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.16.76](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.75...@parca/profile@0.16.76) (2022-11-29)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -107,14 +107,13 @@ var TooltipMetaInfo = function (_a) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
var getTextForFile = function (hoveringNode) {
|
|
110
|
-
var _a, _b, _c, _d;
|
|
111
|
-
if (hoveringNode.meta ===
|
|
110
|
+
var _a, _b, _c, _d, _e;
|
|
111
|
+
if (((_a = hoveringNode.meta) === null || _a === void 0 ? void 0 : _a.function) == null)
|
|
112
112
|
return '<unknown>';
|
|
113
|
-
|
|
114
|
-
return "".concat(hoveringNode.meta.function.filename, " ").concat(((_a = hoveringNode.meta.line) === null || _a === void 0 ? void 0 : _a.line) !== undefined && ((_b = hoveringNode.meta.line) === null || _b === void 0 ? void 0 : _b.line) !== '0'
|
|
113
|
+
return "".concat(hoveringNode.meta.function.filename, " ").concat(((_b = hoveringNode.meta.line) === null || _b === void 0 ? void 0 : _b.line) !== undefined && ((_c = hoveringNode.meta.line) === null || _c === void 0 ? void 0 : _c.line) !== '0'
|
|
115
114
|
? " +".concat(hoveringNode.meta.line.line.toString())
|
|
116
|
-
: "".concat(((
|
|
117
|
-
((
|
|
115
|
+
: "".concat(((_d = hoveringNode.meta.function) === null || _d === void 0 ? void 0 : _d.startLine) !== undefined &&
|
|
116
|
+
((_e = hoveringNode.meta.function) === null || _e === void 0 ? void 0 : _e.startLine) !== '0'
|
|
118
117
|
? " +".concat(hoveringNode.meta.function.startLine)
|
|
119
118
|
: ''));
|
|
120
119
|
};
|
package/dist/IcicleGraph.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useAppSelector, selectCompareMode } from '@parca/store';
|
|
14
14
|
import { useContainerDimensions } from '@parca/dynamicsize';
|
|
15
|
-
import DiffLegend from '
|
|
16
|
-
import IcicleGraph from '
|
|
15
|
+
import DiffLegend from '../components/DiffLegend';
|
|
16
|
+
import IcicleGraph from '../IcicleGraph';
|
|
17
17
|
var ProfileIcicleGraph = function (_a) {
|
|
18
18
|
var graph = _a.graph, curPath = _a.curPath, setNewCurPath = _a.setNewCurPath, sampleUnit = _a.sampleUnit;
|
|
19
19
|
var compareMode = useAppSelector(selectCompareMode);
|
package/dist/ProfileSource.d.ts
CHANGED
package/dist/ProfileSource.js
CHANGED
|
@@ -60,7 +60,7 @@ var SingleProfileSelection = /** @class */ (function () {
|
|
|
60
60
|
SingleProfileSelection.prototype.HistoryParams = function () {
|
|
61
61
|
return {
|
|
62
62
|
profile_name: this.profileName,
|
|
63
|
-
labels: this.labels.map(function (label) { return "".concat(label.name, "=").concat(label.value); }),
|
|
63
|
+
labels: this.labels.map(function (label) { return "".concat(label.name, "=").concat(encodeURIComponent(label.value)); }),
|
|
64
64
|
time: this.time,
|
|
65
65
|
};
|
|
66
66
|
};
|
package/dist/TopTable.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.78",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@parca/client": "^0.16.
|
|
7
|
-
"@parca/components": "^0.16.
|
|
6
|
+
"@parca/client": "^0.16.57",
|
|
7
|
+
"@parca/components": "^0.16.68",
|
|
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": "f9d9dea9b3c3c2c7f8ca3e53b8f6496e2848ac8c"
|
|
46
46
|
}
|
|
@@ -123,9 +123,8 @@ const TooltipMetaInfo = ({
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
const getTextForFile = (hoveringNode: FlamegraphNode): string => {
|
|
126
|
-
if (hoveringNode.meta
|
|
126
|
+
if (hoveringNode.meta?.function == null) return '<unknown>';
|
|
127
127
|
|
|
128
|
-
// @ts-expect-error
|
|
129
128
|
return `${hoveringNode.meta.function.filename} ${
|
|
130
129
|
hoveringNode.meta.line?.line !== undefined && hoveringNode.meta.line?.line !== '0'
|
|
131
130
|
? ` +${hoveringNode.meta.line.line.toString()}`
|
package/src/{ProfileIcicleGraph.stories.mdx → ProfileIcicleGraph/ProfileIcicleGraph.stories.mdx}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import ProfileIcicleGraph from '..';
|
|
16
|
+
import {Provider} from 'react-redux';
|
|
17
|
+
import {store} from '@parca/store';
|
|
18
|
+
import parca10mGraphData from './benchdata/parca-10m.json';
|
|
19
|
+
import {Flamegraph} from '@parca/client';
|
|
20
|
+
|
|
21
|
+
const {store: reduxStore} = store();
|
|
22
|
+
|
|
23
|
+
const parca10mGraph = parca10mGraphData as Flamegraph;
|
|
24
|
+
|
|
25
|
+
export default function ({callback = () => {}}): React.ReactElement {
|
|
26
|
+
return (
|
|
27
|
+
<div ref={callback}>
|
|
28
|
+
<Provider store={reduxStore}>
|
|
29
|
+
<ProfileIcicleGraph
|
|
30
|
+
graph={parca10mGraph}
|
|
31
|
+
sampleUnit={parca10mGraph.unit}
|
|
32
|
+
curPath={[]}
|
|
33
|
+
setNewCurPath={() => {}}
|
|
34
|
+
/>
|
|
35
|
+
</Provider>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import ProfileIcicleGraph from '../';
|
|
16
|
+
import {Provider} from 'react-redux';
|
|
17
|
+
import {store} from '@parca/store';
|
|
18
|
+
import {Flamegraph} from '@parca/client';
|
|
19
|
+
import parca1mGraphData from './benchdata/parca-1m.json';
|
|
20
|
+
|
|
21
|
+
const {store: reduxStore} = store();
|
|
22
|
+
|
|
23
|
+
const parca1mGraph = parca1mGraphData as Flamegraph;
|
|
24
|
+
|
|
25
|
+
export default function ({callback = () => {}}): React.ReactElement {
|
|
26
|
+
return (
|
|
27
|
+
<div ref={callback}>
|
|
28
|
+
<Provider store={reduxStore}>
|
|
29
|
+
<ProfileIcicleGraph
|
|
30
|
+
graph={parca1mGraph}
|
|
31
|
+
sampleUnit={parca1mGraph.unit}
|
|
32
|
+
curPath={[]}
|
|
33
|
+
setNewCurPath={() => {}}
|
|
34
|
+
/>
|
|
35
|
+
</Provider>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import ProfileIcicleGraph from '..';
|
|
16
|
+
import {Provider} from 'react-redux';
|
|
17
|
+
import {store} from '@parca/store';
|
|
18
|
+
import parca20mGraphData from './benchdata/parca-20m.json';
|
|
19
|
+
import {Flamegraph} from '@parca/client';
|
|
20
|
+
|
|
21
|
+
const {store: reduxStore} = store();
|
|
22
|
+
|
|
23
|
+
const parca20mGraph = parca20mGraphData as Flamegraph;
|
|
24
|
+
|
|
25
|
+
export default function ({callback = () => {}}): React.ReactElement {
|
|
26
|
+
return (
|
|
27
|
+
<div ref={callback}>
|
|
28
|
+
<Provider store={reduxStore}>
|
|
29
|
+
<ProfileIcicleGraph
|
|
30
|
+
graph={parca20mGraph}
|
|
31
|
+
sampleUnit={parca20mGraph.unit}
|
|
32
|
+
curPath={[]}
|
|
33
|
+
setNewCurPath={() => {}}
|
|
34
|
+
/>
|
|
35
|
+
</Provider>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
|
|
14
|
+
const {GrpcWebFetchTransport} = require('@protobuf-ts/grpcweb-transport');
|
|
15
|
+
const client = require('@parca/client');
|
|
16
|
+
const fs = require('fs-extra');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
// const {fileURLToPath} = require('url');
|
|
19
|
+
const fetch = require('node-fetch');
|
|
20
|
+
|
|
21
|
+
globalThis.fetch = fetch;
|
|
22
|
+
globalThis.Headers = fetch.Headers;
|
|
23
|
+
const DIR_NAME = __dirname; // path.dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
|
|
25
|
+
const apiEndpoint = 'https://demo.parca.dev';
|
|
26
|
+
|
|
27
|
+
const queryClient = new client.QueryServiceClient(
|
|
28
|
+
new GrpcWebFetchTransport({
|
|
29
|
+
baseUrl: `${apiEndpoint}/api`,
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const populateDataIfNeeded = async (from, filename) => {
|
|
34
|
+
const filePath = path.join(DIR_NAME, filename);
|
|
35
|
+
if (Object.keys(await readFile(filePath)).length > 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const {response} = await queryClient.query({
|
|
39
|
+
options: {
|
|
40
|
+
oneofKind: 'merge',
|
|
41
|
+
merge: {
|
|
42
|
+
start: client.Timestamp.fromDate(from),
|
|
43
|
+
end: client.Timestamp.fromDate(new Date()),
|
|
44
|
+
query: 'parca_agent_cpu:samples:count:cpu:nanoseconds:delta{container="parca"}',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
reportType: client.QueryRequest_ReportType.FLAMEGRAPH_TABLE,
|
|
48
|
+
mode: client.QueryRequest_Mode.MERGE,
|
|
49
|
+
});
|
|
50
|
+
if (response.report.oneofKind !== 'flamegraph') {
|
|
51
|
+
throw new Error('Expected flamegraph report');
|
|
52
|
+
}
|
|
53
|
+
await writeToFile(response.report.flamegraph, filePath);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const writeToFile = async (data, filename) => {
|
|
57
|
+
await fs.createFile(filename);
|
|
58
|
+
return await fs.writeFile(filename, JSON.stringify(data));
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const readFile = async filename => {
|
|
62
|
+
try {
|
|
63
|
+
return await fs.readJSON(filename);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
return {};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const run = async () => {
|
|
70
|
+
await Promise.all([
|
|
71
|
+
populateDataIfNeeded(new Date(new Date().getTime() - 1000 * 60), 'parca-1m.json'),
|
|
72
|
+
populateDataIfNeeded(new Date(new Date().getTime() - 1000 * 60 * 10), 'parca-10m.json'),
|
|
73
|
+
populateDataIfNeeded(new Date(new Date().getTime() - 1000 * 60 * 20), 'parca-20m.json'),
|
|
74
|
+
]);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
run()
|
|
78
|
+
.then(() => {
|
|
79
|
+
console.log('done');
|
|
80
|
+
process.exit(0);
|
|
81
|
+
})
|
|
82
|
+
.catch(err => {
|
|
83
|
+
console.error('Error:', err);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
|
@@ -15,8 +15,8 @@ import {Flamegraph} from '@parca/client';
|
|
|
15
15
|
import {useAppSelector, selectCompareMode} from '@parca/store';
|
|
16
16
|
import {useContainerDimensions} from '@parca/dynamicsize';
|
|
17
17
|
|
|
18
|
-
import DiffLegend from '
|
|
19
|
-
import IcicleGraph from '
|
|
18
|
+
import DiffLegend from '../components/DiffLegend';
|
|
19
|
+
import IcicleGraph from '../IcicleGraph';
|
|
20
20
|
|
|
21
21
|
interface ProfileIcicleGraphProps {
|
|
22
22
|
width?: number;
|
package/src/ProfileSource.tsx
CHANGED
|
@@ -113,7 +113,7 @@ export class SingleProfileSelection implements ProfileSelection {
|
|
|
113
113
|
HistoryParams(): {[key: string]: any} {
|
|
114
114
|
return {
|
|
115
115
|
profile_name: this.profileName,
|
|
116
|
-
labels: this.labels.map(label => `${label.name}=${label.value}`),
|
|
116
|
+
labels: this.labels.map(label => `${label.name}=${encodeURIComponent(label.value)}`),
|
|
117
117
|
time: this.time,
|
|
118
118
|
};
|
|
119
119
|
}
|
package/tsconfig.json
CHANGED