@parca/profile 0.16.112 → 0.16.113
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 +4 -0
- package/dist/ProfileExplorer/index.js +23 -2
- package/package.json +3 -3
- package/src/ProfileExplorer/index.tsx +18 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.113](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.112...@parca/profile@0.16.113) (2023-02-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.16.112](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.111...@parca/profile@0.16.112) (2023-02-09)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -9,13 +9,26 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
// Copyright 2022 The Parca Authors
|
|
14
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
// you may not use this file except in compliance with the License.
|
|
16
|
+
// You may obtain a copy of the License at
|
|
17
|
+
//
|
|
18
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
//
|
|
20
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
// See the License for the specific language governing permissions and
|
|
24
|
+
// limitations under the License.
|
|
25
|
+
import { useProfileTypes } from '../ProfileSelector';
|
|
13
26
|
import { ProfileSelectionFromParams, SuffixParams } from '..';
|
|
14
27
|
import ProfileExplorerSingle from './ProfileExplorerSingle';
|
|
15
28
|
import ProfileExplorerCompare from './ProfileExplorerCompare';
|
|
16
29
|
import { store } from '@parca/store';
|
|
17
30
|
import { Provider } from 'react-redux';
|
|
18
|
-
import { DateTimeRange } from '@parca/components';
|
|
31
|
+
import { DateTimeRange, useParcaContext } from '@parca/components';
|
|
19
32
|
var getExpressionAsAString = function (expression) {
|
|
20
33
|
var x = Array.isArray(expression) ? expression.join() : expression;
|
|
21
34
|
return x;
|
|
@@ -49,6 +62,8 @@ var swapQueryParameters = function (o) {
|
|
|
49
62
|
var ProfileExplorerApp = function (_a) {
|
|
50
63
|
var _b, _c;
|
|
51
64
|
var queryClient = _a.queryClient, queryParams = _a.queryParams, navigateTo = _a.navigateTo;
|
|
65
|
+
var _d = useProfileTypes(queryClient), profileTypesLoading = _d.loading, profileTypesData = _d.data, error = _d.error;
|
|
66
|
+
var _e = useParcaContext(), loader = _e.loader, noDataPrompt = _e.noDataPrompt;
|
|
52
67
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
53
68
|
var from_a = queryParams.from_a, to_a = queryParams.to_a, merge_a = queryParams.merge_a, profile_name_a = queryParams.profile_name_a, labels_a = queryParams.labels_a, time_a = queryParams.time_a, time_selection_a = queryParams.time_selection_a, compare_a = queryParams.compare_a, from_b = queryParams.from_b, to_b = queryParams.to_b, merge_b = queryParams.merge_b, profile_name_b = queryParams.profile_name_b, labels_b = queryParams.labels_b, time_b = queryParams.time_b, time_selection_b = queryParams.time_selection_b, compare_b = queryParams.compare_b, filter_by_function = queryParams.filter_by_function, dashboard_items = queryParams.dashboard_items;
|
|
54
69
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
@@ -75,6 +90,12 @@ var ProfileExplorerApp = function (_a) {
|
|
|
75
90
|
var selectProfileB = function (p) {
|
|
76
91
|
return selectProfile(p, '_b');
|
|
77
92
|
};
|
|
93
|
+
if (profileTypesLoading) {
|
|
94
|
+
return _jsx(_Fragment, { children: loader });
|
|
95
|
+
}
|
|
96
|
+
if ((profileTypesData === null || profileTypesData === void 0 ? void 0 : profileTypesData.types.length) === 0) {
|
|
97
|
+
return _jsx(_Fragment, { children: noDataPrompt });
|
|
98
|
+
}
|
|
78
99
|
// Show the SingleProfileExplorer when not comparing
|
|
79
100
|
if (compare_a !== 'true' && compare_b !== 'true') {
|
|
80
101
|
var query_1 = {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.113",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@parca/client": "^0.16.62",
|
|
7
|
-
"@parca/components": "^0.16.
|
|
7
|
+
"@parca/components": "^0.16.95",
|
|
8
8
|
"@parca/dynamicsize": "^0.16.52",
|
|
9
9
|
"@parca/functions": "^0.16.60",
|
|
10
10
|
"@parca/parser": "^0.16.53",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public",
|
|
46
46
|
"registry": "https://registry.npmjs.org/"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "425c828b992528c8588ad6992fcda1d9f160f170"
|
|
49
49
|
}
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
|
|
14
|
-
import {QuerySelection} from '../ProfileSelector';
|
|
14
|
+
import {QuerySelection, useProfileTypes} from '../ProfileSelector';
|
|
15
15
|
import {ProfileSelection, ProfileSelectionFromParams, SuffixParams} from '..';
|
|
16
16
|
import ProfileExplorerSingle from './ProfileExplorerSingle';
|
|
17
17
|
import ProfileExplorerCompare from './ProfileExplorerCompare';
|
|
18
18
|
import {QueryServiceClient} from '@parca/client';
|
|
19
19
|
import {store} from '@parca/store';
|
|
20
20
|
import {Provider} from 'react-redux';
|
|
21
|
-
import {DateTimeRange} from '@parca/components';
|
|
21
|
+
import {DateTimeRange, useParcaContext} from '@parca/components';
|
|
22
22
|
import type {NavigateFunction} from '@parca/functions';
|
|
23
23
|
|
|
24
24
|
interface ProfileExplorerProps {
|
|
@@ -71,6 +71,14 @@ const ProfileExplorerApp = ({
|
|
|
71
71
|
queryParams,
|
|
72
72
|
navigateTo,
|
|
73
73
|
}: ProfileExplorerProps): JSX.Element => {
|
|
74
|
+
const {
|
|
75
|
+
loading: profileTypesLoading,
|
|
76
|
+
data: profileTypesData,
|
|
77
|
+
error,
|
|
78
|
+
} = useProfileTypes(queryClient);
|
|
79
|
+
|
|
80
|
+
const {loader, noDataPrompt} = useParcaContext();
|
|
81
|
+
|
|
74
82
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
75
83
|
let {
|
|
76
84
|
from_a,
|
|
@@ -126,6 +134,14 @@ const ProfileExplorerApp = ({
|
|
|
126
134
|
return selectProfile(p, '_b');
|
|
127
135
|
};
|
|
128
136
|
|
|
137
|
+
if (profileTypesLoading) {
|
|
138
|
+
return <>{loader}</>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (profileTypesData?.types.length === 0) {
|
|
142
|
+
return <>{noDataPrompt}</>;
|
|
143
|
+
}
|
|
144
|
+
|
|
129
145
|
// Show the SingleProfileExplorer when not comparing
|
|
130
146
|
if (compare_a !== 'true' && compare_b !== 'true') {
|
|
131
147
|
const query = {
|