@parca/profile 0.19.140 → 0.19.143
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 +9 -1
- package/dist/GraphTooltipArrow/Content.js +224 -30
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
- package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
- package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/index.js +86 -56
- package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +94 -68
- package/dist/MatchersInput/SuggestionItem.js +91 -12
- package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
- package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
- package/dist/MatchersInput/SuggestionsList.js +371 -157
- package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
- package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
- package/dist/MatchersInput/index.js +308 -115
- package/dist/MetricsCircle/index.js +39 -3
- package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
- package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
- package/dist/MetricsGraph/index.js +552 -203
- package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
- package/dist/MetricsGraph/utils/colorMapping.js +24 -17
- package/dist/MetricsSeries/index.js +70 -7
- package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
- package/dist/PreSelectedMatchers/index.js +249 -102
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -45
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
- package/dist/ProfileExplorer/index.js +183 -32
- package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
- package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
- package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
- package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
- package/dist/ProfileFlameChart/index.js +260 -126
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +283 -85
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
- package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
- package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
- package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
- package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
- package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
- package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
- package/dist/ProfileFlameGraph/index.js +322 -147
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
- package/dist/ProfileMetricsGraph/index.js +515 -256
- package/dist/ProfileSelector/CompareButton.js +132 -12
- package/dist/ProfileSelector/MetricsGraphSection.js +228 -63
- package/dist/ProfileSelector/index.d.ts +1 -1
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +734 -142
- package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
- package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
- package/dist/ProfileSelector/useAutoQuerySelector.js +280 -132
- package/dist/ProfileSource.js +230 -163
- package/dist/ProfileTypeSelector/index.js +214 -125
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +137 -32
- package/dist/ProfileView/components/ColorStackLegend.js +182 -54
- package/dist/ProfileView/components/DashboardItems/index.js +87 -28
- package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
- package/dist/ProfileView/components/DiffLegend.js +172 -29
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
- package/dist/ProfileView/components/InvertCallStack/index.js +97 -9
- package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
- package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
- package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +191 -118
- package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
- package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
- package/dist/ProfileView/components/ShareButton/index.js +352 -62
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +664 -192
- package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +196 -155
- package/dist/ProfileView/components/Toolbars/index.js +441 -21
- package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
- package/dist/ProfileView/components/ViewSelector/index.js +186 -82
- package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
- package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
- package/dist/ProfileView/components/VisualizationPanel.js +185 -8
- package/dist/ProfileView/context/DashboardContext.js +74 -26
- package/dist/ProfileView/context/ProfileViewContext.js +56 -15
- package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
- package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
- package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +53 -17
- package/dist/ProfileView/hooks/useVisualizationState.js +229 -69
- package/dist/ProfileView/index.js +383 -45
- package/dist/ProfileView/types/visualization.js +1 -13
- package/dist/ProfileView/utils/colorUtils.js +8 -7
- package/dist/ProfileViewWithData.js +319 -225
- package/dist/QueryControls/index.js +418 -47
- package/dist/Sandwich/components/CalleesSection.js +54 -4
- package/dist/Sandwich/components/CallersSection.js +97 -27
- package/dist/Sandwich/components/TableSection.js +77 -4
- package/dist/Sandwich/index.js +125 -12
- package/dist/Sandwich/utils/processRowData.js +48 -39
- package/dist/SelectWithRefresh/index.js +102 -28
- package/dist/SimpleMatchers/Select.js +520 -187
- package/dist/SimpleMatchers/index.js +590 -288
- package/dist/SourceView/Highlighter.js +230 -70
- package/dist/SourceView/LineNo.js +72 -17
- package/dist/SourceView/index.js +177 -101
- package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
- package/dist/SourceView/lang-detector/index.js +28 -14
- package/dist/SourceView/useSelectedLineRange.js +72 -20
- package/dist/Table/ColorCell.js +42 -1
- package/dist/Table/ColumnsVisibility.js +114 -6
- package/dist/Table/MoreDropdown.js +107 -21
- package/dist/Table/TableContextMenu.js +144 -134
- package/dist/Table/TableContextMenuWrapper.js +59 -14
- package/dist/Table/hooks/useColorManagement.js +58 -16
- package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
- package/dist/Table/hooks/useTableConfiguration.js +323 -167
- package/dist/Table/index.js +217 -123
- package/dist/Table/utils/functions.js +169 -144
- package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
- package/dist/TimelineGuide/index.js +209 -16
- package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
- package/dist/TopTable/index.js +325 -121
- package/dist/contexts/LabelsQueryProvider.js +94 -32
- package/dist/contexts/UnifiedLabelsContext.js +114 -49
- package/dist/contexts/utils.js +37 -15
- package/dist/hooks/urlParsers.js +27 -15
- package/dist/hooks/useColorBy.js +47 -10
- package/dist/hooks/useCompareModeMeta.js +112 -62
- package/dist/hooks/useDashboardItems.js +52 -11
- package/dist/hooks/useLabels.js +295 -52
- package/dist/hooks/useQueryState.d.ts +1 -1
- package/dist/hooks/useQueryState.d.ts.map +1 -1
- package/dist/hooks/useQueryState.js +375 -329
- package/dist/index.js +11 -6
- package/dist/testdata/fg-diff.json +3750 -0
- package/dist/testdata/fg-simple.json +1879 -0
- package/dist/testdata/link_data.json +56 -0
- package/dist/testdata/tabular.json +30 -0
- package/dist/testdata/test_flamegraph.json +26846 -0
- package/dist/testdata/test_graph.json +53 -0
- package/dist/useDelayedLoader.js +32 -18
- package/dist/useGrpcQuery/index.js +71 -11
- package/dist/useHasProfileData.js +90 -12
- package/dist/useQuery.js +205 -64
- package/dist/useSumBy.d.ts.map +1 -1
- package/dist/useSumBy.js +294 -138
- package/dist/utils.js +62 -30
- package/package.json +9 -9
- package/src/GraphTooltipArrow/index.tsx +3 -0
- package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
- package/src/MatchersInput/SuggestionsList.tsx +11 -10
- package/src/MatchersInput/index.tsx +1 -1
- package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
- package/src/PreSelectedMatchers/index.tsx +3 -0
- package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -2
- package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
- package/src/ProfileSelector/index.tsx +31 -9
- package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
- package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
- package/src/Table/hooks/useTableConfiguration.tsx +7 -13
- package/src/hooks/useQueryState.ts +18 -3
- package/src/useDelayedLoader.ts +10 -10
- package/src/useSumBy.ts +12 -18
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
- package/dist/hooks/useQueryState.test.js +0 -868
package/dist/TopTable/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
8
|
// Copyright 2022 The Parca Authors
|
|
3
9
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
10
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,133 +17,331 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
11
17
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
18
|
// See the License for the specific language governing permissions and
|
|
13
19
|
// limitations under the License.
|
|
20
|
+
|
|
14
21
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
15
22
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
16
23
|
import { Button, Table } from '@parca/components';
|
|
17
|
-
import { getLastItem, isSearchMatch, parseParams, valueFormatter
|
|
24
|
+
import { getLastItem, isSearchMatch, parseParams, valueFormatter } from '@parca/utilities';
|
|
18
25
|
import { useProfileViewContext } from '../ProfileView/context/ProfileViewContext';
|
|
19
26
|
import { useDashboardItems } from '../hooks/useDashboardItems';
|
|
20
27
|
import { hexifyAddress } from '../utils';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const fallback = `${mapping} ${address}`;
|
|
31
|
-
return fallback === '' ? '<unknown>' : fallback;
|
|
28
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
|
+
export var RowLabel = function RowLabel(meta) {
|
|
30
|
+
var _meta$mapping, _meta$mapping2, _getLastItem, _meta$function, _meta$function2, _meta$location;
|
|
31
|
+
if (meta === undefined) return '<unknown>';
|
|
32
|
+
var mapping = "".concat((meta === null || meta === void 0 || (_meta$mapping = meta.mapping) === null || _meta$mapping === void 0 ? void 0 : _meta$mapping.file) !== undefined && (meta === null || meta === void 0 || (_meta$mapping2 = meta.mapping) === null || _meta$mapping2 === void 0 ? void 0 : _meta$mapping2.file) !== '' ? "[".concat((_getLastItem = getLastItem(meta.mapping.file)) !== null && _getLastItem !== void 0 ? _getLastItem : '', "]") : '');
|
|
33
|
+
if (((_meta$function = meta["function"]) === null || _meta$function === void 0 ? void 0 : _meta$function.name) !== undefined && ((_meta$function2 = meta["function"]) === null || _meta$function2 === void 0 ? void 0 : _meta$function2.name) !== '') return "".concat(mapping, " ").concat(meta["function"].name);
|
|
34
|
+
var address = hexifyAddress((_meta$location = meta.location) === null || _meta$location === void 0 ? void 0 : _meta$location.address);
|
|
35
|
+
var fallback = "".concat(mapping, " ").concat(address);
|
|
36
|
+
return fallback === '' ? '<unknown>' : fallback;
|
|
32
37
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
var columnHelper = createColumnHelper();
|
|
39
|
+
var addPlusSign = function addPlusSign(num) {
|
|
40
|
+
if (num.charAt(0) === '0' || num.charAt(0) === '-') {
|
|
41
|
+
return num;
|
|
42
|
+
}
|
|
43
|
+
return "+".concat(num);
|
|
39
44
|
};
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
45
|
+
export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
|
|
46
|
+
var $ = _c(45);
|
|
47
|
+
var top = t0.data,
|
|
48
|
+
unit = t0.sampleUnit,
|
|
49
|
+
navigateTo = t0.navigateTo,
|
|
50
|
+
loading = t0.loading,
|
|
51
|
+
currentSearchString = t0.currentSearchString,
|
|
52
|
+
setActionButtons = t0.setActionButtons;
|
|
53
|
+
var t1;
|
|
54
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
55
|
+
var _window;
|
|
56
|
+
t1 = parseParams((_window = window) === null || _window === void 0 ? void 0 : _window.location.search);
|
|
57
|
+
$[0] = t1;
|
|
58
|
+
} else {
|
|
59
|
+
t1 = $[0];
|
|
60
|
+
}
|
|
61
|
+
var router = t1;
|
|
62
|
+
var _useDashboardItems = useDashboardItems(),
|
|
63
|
+
dashboardItems = _useDashboardItems.dashboardItems;
|
|
64
|
+
var _useProfileViewContex = useProfileViewContext(),
|
|
65
|
+
compareMode = _useProfileViewContex.compareMode;
|
|
66
|
+
var t2;
|
|
67
|
+
if ($[1] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
68
|
+
t2 = columnHelper.accessor("meta", {
|
|
69
|
+
header: _temp,
|
|
70
|
+
cell: _temp2,
|
|
71
|
+
sortingFn: _temp3
|
|
72
|
+
});
|
|
73
|
+
$[1] = t2;
|
|
74
|
+
} else {
|
|
75
|
+
t2 = $[1];
|
|
76
|
+
}
|
|
77
|
+
var t3;
|
|
78
|
+
if ($[2] !== unit) {
|
|
79
|
+
t3 = columnHelper.accessor("flat", {
|
|
80
|
+
header: _temp4,
|
|
81
|
+
cell: function cell(info_0) {
|
|
82
|
+
return valueFormatter(info_0.getValue(), unit, 2);
|
|
83
|
+
},
|
|
84
|
+
size: 150,
|
|
85
|
+
meta: {
|
|
86
|
+
align: "right"
|
|
87
|
+
},
|
|
88
|
+
sortDescFirst: true
|
|
89
|
+
});
|
|
90
|
+
$[2] = unit;
|
|
91
|
+
$[3] = t3;
|
|
92
|
+
} else {
|
|
93
|
+
t3 = $[3];
|
|
94
|
+
}
|
|
95
|
+
var t4;
|
|
96
|
+
if ($[4] !== unit) {
|
|
97
|
+
t4 = columnHelper.accessor("cumulative", {
|
|
98
|
+
header: _temp5,
|
|
99
|
+
cell: function cell(info_1) {
|
|
100
|
+
return valueFormatter(info_1.getValue(), unit, 2);
|
|
101
|
+
},
|
|
102
|
+
size: 150,
|
|
103
|
+
meta: {
|
|
104
|
+
align: "right"
|
|
105
|
+
},
|
|
106
|
+
sortDescFirst: true
|
|
107
|
+
});
|
|
108
|
+
$[4] = unit;
|
|
109
|
+
$[5] = t4;
|
|
110
|
+
} else {
|
|
111
|
+
t4 = $[5];
|
|
112
|
+
}
|
|
113
|
+
var cols;
|
|
114
|
+
if ($[6] !== compareMode || $[7] !== t3 || $[8] !== t4 || $[9] !== unit) {
|
|
115
|
+
cols = [t2, t3, t4];
|
|
116
|
+
if (compareMode) {
|
|
117
|
+
var _t;
|
|
118
|
+
if ($[11] !== unit) {
|
|
119
|
+
_t = columnHelper.accessor("diff", {
|
|
120
|
+
header: _temp6,
|
|
121
|
+
cell: function cell(info_2) {
|
|
122
|
+
return addPlusSign(valueFormatter(info_2.getValue(), unit, 2));
|
|
123
|
+
},
|
|
124
|
+
size: 150,
|
|
125
|
+
meta: {
|
|
126
|
+
align: "right"
|
|
127
|
+
},
|
|
128
|
+
sortDescFirst: true
|
|
129
|
+
});
|
|
130
|
+
$[11] = unit;
|
|
131
|
+
$[12] = _t;
|
|
132
|
+
} else {
|
|
133
|
+
_t = $[12];
|
|
134
|
+
}
|
|
135
|
+
cols.push(_t);
|
|
136
|
+
}
|
|
137
|
+
$[6] = compareMode;
|
|
138
|
+
$[7] = t3;
|
|
139
|
+
$[8] = t4;
|
|
140
|
+
$[9] = unit;
|
|
141
|
+
$[10] = cols;
|
|
142
|
+
} else {
|
|
143
|
+
cols = $[10];
|
|
144
|
+
}
|
|
145
|
+
var columns = cols;
|
|
146
|
+
var t5;
|
|
147
|
+
if ($[13] !== navigateTo) {
|
|
148
|
+
t5 = function t5(span) {
|
|
149
|
+
if (navigateTo != null) {
|
|
150
|
+
navigateTo("/", _objectSpread(_objectSpread({}, router), {
|
|
151
|
+
search_string: span.trim()
|
|
152
|
+
}), {
|
|
153
|
+
replace: true
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
$[13] = navigateTo;
|
|
158
|
+
$[14] = t5;
|
|
159
|
+
} else {
|
|
160
|
+
t5 = $[14];
|
|
161
|
+
}
|
|
162
|
+
var selectSpan = t5;
|
|
163
|
+
var t6;
|
|
164
|
+
if ($[15] !== dashboardItems.length || $[16] !== selectSpan) {
|
|
165
|
+
t6 = function t6(row) {
|
|
166
|
+
if (dashboardItems.length <= 1) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
var meta_0 = row.meta;
|
|
170
|
+
if (meta_0 === undefined) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
var name_0 = RowLabel(meta_0);
|
|
174
|
+
selectSpan(name_0);
|
|
175
|
+
};
|
|
176
|
+
$[15] = dashboardItems.length;
|
|
177
|
+
$[16] = selectSpan;
|
|
178
|
+
$[17] = t6;
|
|
179
|
+
} else {
|
|
180
|
+
t6 = $[17];
|
|
181
|
+
}
|
|
182
|
+
var onRowClick = t6;
|
|
183
|
+
var t7;
|
|
184
|
+
if ($[18] !== currentSearchString) {
|
|
185
|
+
t7 = function t7(row_0) {
|
|
186
|
+
var meta_1 = row_0.meta;
|
|
187
|
+
if (meta_1 === undefined) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
var name_1 = RowLabel(meta_1);
|
|
191
|
+
return isSearchMatch(currentSearchString, name_1);
|
|
192
|
+
};
|
|
193
|
+
$[18] = currentSearchString;
|
|
194
|
+
$[19] = t7;
|
|
195
|
+
} else {
|
|
196
|
+
t7 = $[19];
|
|
197
|
+
}
|
|
198
|
+
var shouldHighlightRow = t7;
|
|
199
|
+
var enableHighlighting = currentSearchString != null && (currentSearchString === null || currentSearchString === void 0 ? void 0 : currentSearchString.length) > 0;
|
|
200
|
+
var t8;
|
|
201
|
+
if ($[20] !== navigateTo) {
|
|
202
|
+
t8 = function t8() {
|
|
203
|
+
if (navigateTo != null) {
|
|
204
|
+
navigateTo("/", _objectSpread(_objectSpread({}, router), {
|
|
205
|
+
search_string: ""
|
|
206
|
+
}), {
|
|
207
|
+
replace: true
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
$[20] = navigateTo;
|
|
212
|
+
$[21] = t8;
|
|
213
|
+
} else {
|
|
214
|
+
t8 = $[21];
|
|
215
|
+
}
|
|
216
|
+
var clearSelection = t8;
|
|
217
|
+
var t9;
|
|
218
|
+
if ($[22] !== clearSelection || $[23] !== currentSearchString || $[24] !== dashboardItems.length || $[25] !== setActionButtons) {
|
|
219
|
+
t9 = function t9() {
|
|
220
|
+
if (setActionButtons === undefined) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
setActionButtons(dashboardItems.length > 1 ? /*#__PURE__*/_jsx("div", {
|
|
224
|
+
className: "ml-2",
|
|
225
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
226
|
+
color: "neutral",
|
|
227
|
+
onClick: clearSelection,
|
|
228
|
+
className: "w-auto",
|
|
229
|
+
variant: "neutral",
|
|
230
|
+
disabled: currentSearchString === undefined || currentSearchString.length === 0,
|
|
231
|
+
children: "Clear selection"
|
|
232
|
+
})
|
|
233
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {}));
|
|
234
|
+
};
|
|
235
|
+
$[22] = clearSelection;
|
|
236
|
+
$[23] = currentSearchString;
|
|
237
|
+
$[24] = dashboardItems.length;
|
|
238
|
+
$[25] = setActionButtons;
|
|
239
|
+
$[26] = t9;
|
|
240
|
+
} else {
|
|
241
|
+
t9 = $[26];
|
|
242
|
+
}
|
|
243
|
+
var t10;
|
|
244
|
+
if ($[27] !== clearSelection || $[28] !== currentSearchString || $[29] !== dashboardItems || $[30] !== setActionButtons) {
|
|
245
|
+
t10 = [dashboardItems, clearSelection, currentSearchString, setActionButtons];
|
|
246
|
+
$[27] = clearSelection;
|
|
247
|
+
$[28] = currentSearchString;
|
|
248
|
+
$[29] = dashboardItems;
|
|
249
|
+
$[30] = setActionButtons;
|
|
250
|
+
$[31] = t10;
|
|
251
|
+
} else {
|
|
252
|
+
t10 = $[31];
|
|
253
|
+
}
|
|
254
|
+
useEffect(t9, t10);
|
|
255
|
+
var t11 = compareMode ? "diff" : "cumulative";
|
|
256
|
+
var t12;
|
|
257
|
+
if ($[32] !== t11) {
|
|
258
|
+
t12 = [{
|
|
259
|
+
id: t11,
|
|
260
|
+
desc: true
|
|
261
|
+
}];
|
|
262
|
+
$[32] = t11;
|
|
263
|
+
$[33] = t12;
|
|
264
|
+
} else {
|
|
265
|
+
t12 = $[33];
|
|
266
|
+
}
|
|
267
|
+
var initialSorting = t12;
|
|
268
|
+
var total = top != null ? top.list.length : 0;
|
|
269
|
+
if (total === 0 && !loading) {
|
|
270
|
+
var _t2;
|
|
271
|
+
if ($[34] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
272
|
+
_t2 = /*#__PURE__*/_jsx("div", {
|
|
273
|
+
className: "mx-auto text-center",
|
|
274
|
+
children: "Profile has no samples"
|
|
275
|
+
});
|
|
276
|
+
$[34] = _t2;
|
|
277
|
+
} else {
|
|
278
|
+
_t2 = $[34];
|
|
279
|
+
}
|
|
280
|
+
return _t2;
|
|
281
|
+
}
|
|
282
|
+
var t13;
|
|
283
|
+
if ($[35] !== (top === null || top === void 0 ? void 0 : top.list)) {
|
|
284
|
+
var _top$list;
|
|
285
|
+
t13 = (_top$list = top === null || top === void 0 ? void 0 : top.list) !== null && _top$list !== void 0 ? _top$list : [];
|
|
286
|
+
$[35] = top === null || top === void 0 ? void 0 : top.list;
|
|
287
|
+
$[36] = t13;
|
|
288
|
+
} else {
|
|
289
|
+
t13 = $[36];
|
|
290
|
+
}
|
|
291
|
+
var t14 = dashboardItems.length > 1;
|
|
292
|
+
var t15;
|
|
293
|
+
if ($[37] !== columns || $[38] !== enableHighlighting || $[39] !== initialSorting || $[40] !== onRowClick || $[41] !== shouldHighlightRow || $[42] !== t13 || $[43] !== t14) {
|
|
294
|
+
t15 = /*#__PURE__*/_jsx("div", {
|
|
295
|
+
className: "relative",
|
|
296
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
297
|
+
className: "font-robotoMono h-[80vh] w-full overflow-scroll",
|
|
298
|
+
children: /*#__PURE__*/_jsx(Table, {
|
|
299
|
+
data: t13,
|
|
300
|
+
columns: columns,
|
|
301
|
+
initialSorting: initialSorting,
|
|
302
|
+
onRowClick: onRowClick,
|
|
303
|
+
enableHighlighting: enableHighlighting,
|
|
304
|
+
shouldHighlightRow: shouldHighlightRow,
|
|
305
|
+
usePointerCursor: t14
|
|
306
|
+
})
|
|
307
|
+
})
|
|
308
|
+
});
|
|
309
|
+
$[37] = columns;
|
|
310
|
+
$[38] = enableHighlighting;
|
|
311
|
+
$[39] = initialSorting;
|
|
312
|
+
$[40] = onRowClick;
|
|
313
|
+
$[41] = shouldHighlightRow;
|
|
314
|
+
$[42] = t13;
|
|
315
|
+
$[43] = t14;
|
|
316
|
+
$[44] = t15;
|
|
317
|
+
} else {
|
|
318
|
+
t15 = $[44];
|
|
319
|
+
}
|
|
320
|
+
return t15;
|
|
142
321
|
});
|
|
143
322
|
export default TopTable;
|
|
323
|
+
function _temp() {
|
|
324
|
+
return /*#__PURE__*/_jsx("span", {
|
|
325
|
+
className: "text-left",
|
|
326
|
+
children: "Name"
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
function _temp2(info) {
|
|
330
|
+
var meta = info.row.original.meta;
|
|
331
|
+
var name = RowLabel(meta);
|
|
332
|
+
return name;
|
|
333
|
+
}
|
|
334
|
+
function _temp3(a, b) {
|
|
335
|
+
var aName = RowLabel(a.original.meta);
|
|
336
|
+
var bName = RowLabel(b.original.meta);
|
|
337
|
+
return aName.localeCompare(bName);
|
|
338
|
+
}
|
|
339
|
+
function _temp4() {
|
|
340
|
+
return "Flat";
|
|
341
|
+
}
|
|
342
|
+
function _temp5() {
|
|
343
|
+
return "Cumulative";
|
|
344
|
+
}
|
|
345
|
+
function _temp6() {
|
|
346
|
+
return "Diff";
|
|
347
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
8
|
// Copyright 2022 The Parca Authors
|
|
3
9
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
10
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,6 +17,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
17
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
18
|
// See the License for the specific language governing permissions and
|
|
13
19
|
// limitations under the License.
|
|
20
|
+
|
|
14
21
|
/**
|
|
15
22
|
* LabelsQueryProvider - Data Fetching Layer
|
|
16
23
|
*
|
|
@@ -31,40 +38,95 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
31
38
|
*
|
|
32
39
|
* Consumer Hook: useLabelsQueryProvider()
|
|
33
40
|
*/
|
|
41
|
+
|
|
34
42
|
import { createContext, useContext, useState } from 'react';
|
|
35
43
|
import { useLabelNames, useLabelValues } from '../hooks/useLabels';
|
|
36
44
|
import { useExtractedLabelNames } from './utils';
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
46
|
+
var LabelsQueryProviderContext = /*#__PURE__*/createContext(null);
|
|
47
|
+
export function LabelsQueryProvider(t0) {
|
|
48
|
+
var $ = _c(19);
|
|
49
|
+
var children = t0.children,
|
|
50
|
+
queryClient = t0.queryClient,
|
|
51
|
+
setMatchersString = t0.setMatchersString,
|
|
52
|
+
runQuery = t0.runQuery,
|
|
53
|
+
currentQuery = t0.currentQuery,
|
|
54
|
+
profileType = t0.profileType,
|
|
55
|
+
start = t0.start,
|
|
56
|
+
end = t0.end,
|
|
57
|
+
suffix = t0.suffix;
|
|
58
|
+
var _useState = useState(null),
|
|
59
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
60
|
+
currentLabelName = _useState2[0],
|
|
61
|
+
setCurrentLabelName = _useState2[1];
|
|
62
|
+
var _useLabelNames = useLabelNames(queryClient, profileType, start, end),
|
|
63
|
+
labelNamesResponse = _useLabelNames.result,
|
|
64
|
+
isLabelNamesLoading = _useLabelNames.loading,
|
|
65
|
+
labelNamesRefetch = _useLabelNames.refetch;
|
|
66
|
+
var labelNames = useExtractedLabelNames(labelNamesResponse.response, labelNamesResponse.error);
|
|
67
|
+
var _useLabelValues = useLabelValues(queryClient, currentLabelName !== null && currentLabelName !== void 0 ? currentLabelName : "", profileType, start, end),
|
|
68
|
+
labelValuesOriginal = _useLabelValues.result,
|
|
69
|
+
isLabelValuesLoading = _useLabelValues.loading,
|
|
70
|
+
labelValuesRefetch = _useLabelValues.refetch;
|
|
71
|
+
var labelValues = labelValuesOriginal.response;
|
|
72
|
+
var t1;
|
|
73
|
+
if ($[0] !== currentLabelName || $[1] !== currentQuery || $[2] !== end || $[3] !== isLabelNamesLoading || $[4] !== isLabelValuesLoading || $[5] !== labelNames || $[6] !== labelNamesRefetch || $[7] !== labelValues || $[8] !== labelValuesRefetch || $[9] !== profileType || $[10] !== queryClient || $[11] !== runQuery || $[12] !== setMatchersString || $[13] !== start || $[14] !== suffix) {
|
|
74
|
+
t1 = {
|
|
75
|
+
labelNames: labelNames,
|
|
76
|
+
labelValues: labelValues,
|
|
77
|
+
isLabelNamesLoading: isLabelNamesLoading,
|
|
78
|
+
isLabelValuesLoading: isLabelValuesLoading,
|
|
79
|
+
refetchLabelValues: labelValuesRefetch,
|
|
80
|
+
refetchLabelNames: labelNamesRefetch,
|
|
81
|
+
queryClient: queryClient,
|
|
82
|
+
setMatchersString: setMatchersString,
|
|
83
|
+
runQuery: runQuery,
|
|
84
|
+
currentQuery: currentQuery,
|
|
85
|
+
profileType: profileType,
|
|
86
|
+
start: start,
|
|
87
|
+
end: end,
|
|
88
|
+
setCurrentLabelName: setCurrentLabelName,
|
|
89
|
+
currentLabelName: currentLabelName,
|
|
90
|
+
suffix: suffix
|
|
61
91
|
};
|
|
62
|
-
|
|
92
|
+
$[0] = currentLabelName;
|
|
93
|
+
$[1] = currentQuery;
|
|
94
|
+
$[2] = end;
|
|
95
|
+
$[3] = isLabelNamesLoading;
|
|
96
|
+
$[4] = isLabelValuesLoading;
|
|
97
|
+
$[5] = labelNames;
|
|
98
|
+
$[6] = labelNamesRefetch;
|
|
99
|
+
$[7] = labelValues;
|
|
100
|
+
$[8] = labelValuesRefetch;
|
|
101
|
+
$[9] = profileType;
|
|
102
|
+
$[10] = queryClient;
|
|
103
|
+
$[11] = runQuery;
|
|
104
|
+
$[12] = setMatchersString;
|
|
105
|
+
$[13] = start;
|
|
106
|
+
$[14] = suffix;
|
|
107
|
+
$[15] = t1;
|
|
108
|
+
} else {
|
|
109
|
+
t1 = $[15];
|
|
110
|
+
}
|
|
111
|
+
var value = t1;
|
|
112
|
+
var t2;
|
|
113
|
+
if ($[16] !== children || $[17] !== value) {
|
|
114
|
+
t2 = /*#__PURE__*/_jsx(LabelsQueryProviderContext.Provider, {
|
|
115
|
+
value: value,
|
|
116
|
+
children: children
|
|
117
|
+
});
|
|
118
|
+
$[16] = children;
|
|
119
|
+
$[17] = value;
|
|
120
|
+
$[18] = t2;
|
|
121
|
+
} else {
|
|
122
|
+
t2 = $[18];
|
|
123
|
+
}
|
|
124
|
+
return t2;
|
|
63
125
|
}
|
|
64
126
|
export function useLabelsQueryProvider() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
127
|
+
var context = useContext(LabelsQueryProviderContext);
|
|
128
|
+
if (context === null) {
|
|
129
|
+
throw new Error("useLabelsQueryProvider must be used within a LabelsQueryProvider");
|
|
130
|
+
}
|
|
131
|
+
return context;
|
|
132
|
+
}
|