@parca/profile 0.16.57 → 0.16.59
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/Edge/index.d.ts +1 -0
- package/dist/Callgraph/Node/index.d.ts +1 -0
- package/dist/Callgraph/index.d.ts +1 -0
- package/dist/GraphTooltip/index.d.ts +1 -0
- package/dist/IcicleGraph.d.ts +1 -0
- package/dist/MatchersInput/index.d.ts +1 -0
- package/dist/MetricsCircle/index.d.ts +1 -0
- package/dist/MetricsGraph/index.d.ts +1 -0
- package/dist/MetricsSeries/index.d.ts +1 -0
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts +1 -0
- package/dist/ProfileExplorer/ProfileExplorerSingle.d.ts +1 -0
- package/dist/ProfileExplorer/index.d.ts +1 -0
- package/dist/ProfileIcicleGraph.d.ts +1 -0
- package/dist/ProfileMetricsGraph/index.d.ts +1 -0
- package/dist/ProfileSelector/CompareButton.d.ts +1 -0
- package/dist/ProfileSelector/MergeButton.d.ts +1 -0
- package/dist/ProfileSelector/index.d.ts +1 -0
- package/dist/ProfileSource.d.ts +1 -0
- package/dist/ProfileTypeSelector/index.d.ts +1 -0
- package/dist/ProfileView.d.ts +1 -0
- package/dist/ProfileViewWithData.d.ts +1 -0
- package/dist/TopTable.d.ts +1 -0
- package/dist/TopTable.js +8 -4
- package/dist/components/DiffLegend.d.ts +1 -0
- package/dist/components/ProfileShareButton/ResultBox.d.ts +1 -0
- package/dist/components/ProfileShareButton/index.d.ts +1 -0
- package/package.json +3 -3
- package/src/TopTable.tsx +18 -4
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.59](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.58...@parca/profile@0.16.59) (2022-11-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.16.58](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.57...@parca/profile@0.16.58) (2022-11-02)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.16.57](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.56...@parca/profile@0.16.57) (2022-11-02)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
package/dist/IcicleGraph.d.ts
CHANGED
package/dist/ProfileSource.d.ts
CHANGED
package/dist/ProfileView.d.ts
CHANGED
package/dist/TopTable.d.ts
CHANGED
package/dist/TopTable.js
CHANGED
|
@@ -33,7 +33,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
33
33
|
// limitations under the License.
|
|
34
34
|
import React from 'react';
|
|
35
35
|
import { getLastItem, valueFormatter, isSearchMatch } from '@parca/functions';
|
|
36
|
-
import { useAppSelector, selectCompareMode, selectSearchNodeString } from '@parca/store';
|
|
36
|
+
import { useAppSelector, selectCompareMode, selectSearchNodeString, setSearchNodeString, useAppDispatch, } from '@parca/store';
|
|
37
37
|
import { hexifyAddress } from './utils';
|
|
38
38
|
import './TopTable.styles.css';
|
|
39
39
|
var Arrow = function (_a) {
|
|
@@ -110,6 +110,7 @@ export var TopTable = function (_a) {
|
|
|
110
110
|
var _f = useSortableData(top), items = _f.items, requestSort = _f.requestSort, sortConfig = _f.sortConfig;
|
|
111
111
|
var currentSearchString = useAppSelector(selectSearchNodeString);
|
|
112
112
|
var compareMode = useAppSelector(selectCompareMode);
|
|
113
|
+
var dispatch = useAppDispatch();
|
|
113
114
|
var unit = sampleUnit;
|
|
114
115
|
var total = top != null ? top.list.length : 0;
|
|
115
116
|
if (total === 0)
|
|
@@ -126,15 +127,18 @@ export var TopTable = function (_a) {
|
|
|
126
127
|
}
|
|
127
128
|
return "+".concat(num);
|
|
128
129
|
};
|
|
129
|
-
|
|
130
|
+
var selectSpan = function (span) {
|
|
131
|
+
dispatch(setSearchNodeString(span.trim()));
|
|
132
|
+
};
|
|
133
|
+
return (_jsx(_Fragment, { children: _jsx("div", __assign({ className: "w-full font-robotoMono" }, { children: _jsxs("table", __assign({ className: "iciclegraph-table table-fixed text-left w-full divide-y divide-gray-200 dark:divide-gray-700", tabIndex: 1 }, { children: [_jsx("thead", __assign({ className: "bg-gray-50 dark:bg-gray-800" }, { children: _jsxs("tr", { children: [_jsxs("th", __assign({ className: "text-sm cursor-pointer pt-2 pb-2 pl-2", onClick: function () { return requestSort('name'); } }, { children: ["Name", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_b = getClassNamesFor('name')) !== null && _b !== void 0 ? _b : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('name') }) }))] })), _jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 w-[150px]", onClick: function () { return requestSort('flat'); } }, { children: ["Flat", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_c = getClassNamesFor('flat')) !== null && _c !== void 0 ? _c : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('flat') }) }))] })), _jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 pr-2 w-[150px]", onClick: function () { return requestSort('cumulative'); } }, { children: ["Cumulative", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_d = getClassNamesFor('cumulative')) !== null && _d !== void 0 ? _d : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('cumulative') }) }))] })), compareMode && (_jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 pr-2 w-[150px]", onClick: function () { return requestSort('diff'); } }, { children: ["Diff", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_e = getClassNamesFor('diff')) !== null && _e !== void 0 ? _e : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('diff') }) }))] })))] }) })), _jsx("tbody", __assign({ className: "bg-white divide-y divide-gray-200 dark:bg-gray-900 dark:divide-gray-700" }, { children: items === null || items === void 0 ? void 0 : items.map(function (report, index) {
|
|
130
134
|
var name = RowLabel(report.meta);
|
|
131
|
-
return (_jsxs("tr", __assign({ className: "hover:bg-[#62626212] dark:hover:bg-[#ffffff12]", style: {
|
|
135
|
+
return (_jsxs("tr", __assign({ className: "hover:bg-[#62626212] dark:hover:bg-[#ffffff12] cursor-pointer", style: {
|
|
132
136
|
opacity: currentSearchString !== undefined &&
|
|
133
137
|
currentSearchString !== '' &&
|
|
134
138
|
!isSearchMatch(currentSearchString, name)
|
|
135
139
|
? 0.5
|
|
136
140
|
: 1,
|
|
137
|
-
} }, { children: [_jsx("td", __assign({ className: "text-xs py-1.5 pl-2" }, { children: name })), _jsx("td", __assign({ className: "text-xs py-1.5 text-right" }, { children: valueFormatter(report.flat, unit, 2) })), _jsx("td", __assign({ className: "text-xs py-1.5 text-right pr-2" }, { children: valueFormatter(report.cumulative, unit, 2) })), compareMode && (_jsx("td", __assign({ className: "text-xs py-1.5 text-right pr-2" }, { children: addPlusSign(valueFormatter(report.diff, unit, 2)) })))] }), index));
|
|
141
|
+
}, onClick: function () { return selectSpan(name); } }, { children: [_jsx("td", __assign({ className: "text-xs py-1.5 pl-2" }, { children: name })), _jsx("td", __assign({ className: "text-xs py-1.5 text-right" }, { children: valueFormatter(report.flat, unit, 2) })), _jsx("td", __assign({ className: "text-xs py-1.5 text-right pr-2" }, { children: valueFormatter(report.cumulative, unit, 2) })), compareMode && (_jsx("td", __assign({ className: "text-xs py-1.5 text-right pr-2" }, { children: addPlusSign(valueFormatter(report.diff, unit, 2)) })))] }), index));
|
|
138
142
|
}) }))] })) })) }));
|
|
139
143
|
};
|
|
140
144
|
export default TopTable;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.59",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@iconify/react": "^3.2.2",
|
|
7
7
|
"@parca/client": "^0.16.53",
|
|
8
|
-
"@parca/components": "^0.16.
|
|
8
|
+
"@parca/components": "^0.16.55",
|
|
9
9
|
"@parca/dynamicsize": "^0.16.51",
|
|
10
10
|
"@parca/functions": "^0.16.51",
|
|
11
11
|
"@parca/parser": "^0.16.49",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"access": "public",
|
|
40
40
|
"registry": "https://registry.npmjs.org/"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "d1389b648874097c3eeb9143c94469847fedede2"
|
|
43
43
|
}
|
package/src/TopTable.tsx
CHANGED
|
@@ -14,7 +14,13 @@
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
|
|
16
16
|
import {getLastItem, valueFormatter, isSearchMatch} from '@parca/functions';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
useAppSelector,
|
|
19
|
+
selectCompareMode,
|
|
20
|
+
selectSearchNodeString,
|
|
21
|
+
setSearchNodeString,
|
|
22
|
+
useAppDispatch,
|
|
23
|
+
} from '@parca/store';
|
|
18
24
|
import {TopNode, TopNodeMeta, Top} from '@parca/client';
|
|
19
25
|
|
|
20
26
|
import {hexifyAddress} from './utils';
|
|
@@ -136,8 +142,8 @@ export const RowLabel = (meta: TopNodeMeta | undefined): string => {
|
|
|
136
142
|
export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element => {
|
|
137
143
|
const {items, requestSort, sortConfig} = useSortableData(top);
|
|
138
144
|
const currentSearchString = useAppSelector(selectSearchNodeString);
|
|
139
|
-
|
|
140
145
|
const compareMode = useAppSelector(selectCompareMode);
|
|
146
|
+
const dispatch = useAppDispatch();
|
|
141
147
|
|
|
142
148
|
const unit = sampleUnit;
|
|
143
149
|
|
|
@@ -159,10 +165,17 @@ export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element =>
|
|
|
159
165
|
return `+${num}`;
|
|
160
166
|
};
|
|
161
167
|
|
|
168
|
+
const selectSpan = (span: string): void => {
|
|
169
|
+
dispatch(setSearchNodeString(span.trim()));
|
|
170
|
+
};
|
|
171
|
+
|
|
162
172
|
return (
|
|
163
173
|
<>
|
|
164
174
|
<div className="w-full font-robotoMono">
|
|
165
|
-
<table
|
|
175
|
+
<table
|
|
176
|
+
className="iciclegraph-table table-fixed text-left w-full divide-y divide-gray-200 dark:divide-gray-700"
|
|
177
|
+
tabIndex={1}
|
|
178
|
+
>
|
|
166
179
|
<thead className="bg-gray-50 dark:bg-gray-800">
|
|
167
180
|
<tr>
|
|
168
181
|
<th
|
|
@@ -221,7 +234,7 @@ export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element =>
|
|
|
221
234
|
return (
|
|
222
235
|
<tr
|
|
223
236
|
key={index}
|
|
224
|
-
className="hover:bg-[#62626212] dark:hover:bg-[#ffffff12]"
|
|
237
|
+
className="hover:bg-[#62626212] dark:hover:bg-[#ffffff12] cursor-pointer"
|
|
225
238
|
style={{
|
|
226
239
|
opacity:
|
|
227
240
|
currentSearchString !== undefined &&
|
|
@@ -230,6 +243,7 @@ export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element =>
|
|
|
230
243
|
? 0.5
|
|
231
244
|
: 1,
|
|
232
245
|
}}
|
|
246
|
+
onClick={() => selectSpan(name)}
|
|
233
247
|
>
|
|
234
248
|
<td className="text-xs py-1.5 pl-2">{name}</td>
|
|
235
249
|
<td className="text-xs py-1.5 text-right">
|