@parca/profile 0.19.68 → 0.19.70
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/MatchersInput/SuggestionsList.d.ts +2 -2
- package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
- package/dist/MatchersInput/SuggestionsList.js +2 -2
- package/dist/MatchersInput/index.d.ts +1 -1
- package/dist/MatchersInput/index.d.ts.map +1 -1
- package/dist/MatchersInput/index.js +2 -2
- package/dist/ProfileSelector/index.d.ts +1 -1
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +21 -16
- package/dist/contexts/MatchersInputLabelsContext.d.ts +2 -2
- package/dist/contexts/MatchersInputLabelsContext.d.ts.map +1 -1
- package/dist/useHasProfileData.d.ts.map +1 -1
- package/dist/useHasProfileData.js +6 -2
- package/package.json +3 -3
- package/src/MatchersInput/SuggestionsList.tsx +4 -2
- package/src/MatchersInput/index.tsx +3 -3
- package/src/ProfileSelector/index.tsx +33 -23
- package/src/contexts/MatchersInputLabelsContext.tsx +2 -2
- package/src/useHasProfileData.ts +8 -2
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.19.70](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.69...@parca/profile@0.19.70) (2025-10-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.19.69](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.68...@parca/profile@0.19.69) (2025-10-21)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.19.68](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.67...@parca/profile@0.19.68) (2025-10-21)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -19,8 +19,8 @@ interface Props {
|
|
|
19
19
|
isLabelNamesLoading: boolean;
|
|
20
20
|
isLabelValuesLoading: boolean;
|
|
21
21
|
shouldTrimPrefix: boolean;
|
|
22
|
-
refetchLabelValues: () => void
|
|
23
|
-
refetchLabelNames: () => void
|
|
22
|
+
refetchLabelValues: () => Promise<void>;
|
|
23
|
+
refetchLabelNames: () => Promise<void>;
|
|
24
24
|
}
|
|
25
25
|
declare const SuggestionsList: ({ suggestions, applySuggestion, inputRef, runQuery, focusedInput, isLabelNamesLoading, isLabelValuesLoading, shouldTrimPrefix, refetchLabelValues, refetchLabelNames, }: Props) => JSX.Element;
|
|
26
26
|
export default SuggestionsList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionsList.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/SuggestionsList.tsx"],"names":[],"mappings":"AAuBA,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;gBAEF,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAK3D;AAED,qBAAa,WAAW;IACtB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;;CAO3B;AAED,UAAU,KAAK;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClD,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SuggestionsList.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/SuggestionsList.tsx"],"names":[],"mappings":"AAuBA,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;gBAEF,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAK3D;AAED,qBAAa,WAAW;IACtB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;;CAO3B;AAED,UAAU,KAAK;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClD,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAaD,QAAA,MAAM,eAAe,GAAI,yKAWtB,KAAK,KAAG,GAAG,CAAC,OAwUd,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -170,8 +170,8 @@ const SuggestionsList = ({ suggestions, applySuggestion, inputRef, runQuery, foc
|
|
|
170
170
|
i + suggestions.labelNames.length + suggestions.literals.length, onHighlight: () => setHighlightedSuggestionIndex(i + suggestions.labelNames.length + suggestions.literals.length), onApplySuggestion: () => applySuggestionWithIndex(i + suggestions.labelNames.length + suggestions.literals.length), onResetHighlight: () => resetHighlight(), value: l.value }, l.value)))) })) : (suggestions.labelValues.map((l, i) => (_jsx(SuggestionItem, { isHighlighted: highlightedSuggestionIndex ===
|
|
171
171
|
i + suggestions.labelNames.length + suggestions.literals.length, onHighlight: () => setHighlightedSuggestionIndex(i + suggestions.labelNames.length + suggestions.literals.length), onApplySuggestion: () => applySuggestionWithIndex(i + suggestions.labelNames.length + suggestions.literals.length), onResetHighlight: () => resetHighlight(), value: l.value }, l.value))))] }), suggestions.literals.length === 0 &&
|
|
172
172
|
suggestions.labelValues.length === 0 &&
|
|
173
|
-
!isLabelNamesLoading && (_jsx(RefreshButton, { onClick: () => void handleRefetchNames(), disabled: isRefetchingNames, title: "Refresh label names", testId: "suggestions-refresh-names-button" })), suggestions.labelNames.length === 0 &&
|
|
173
|
+
!isLabelNamesLoading && (_jsx(RefreshButton, { onClick: () => void handleRefetchNames(), disabled: isRefetchingNames, title: "Refresh label names", testId: "suggestions-refresh-names-button", loading: isRefetchingNames })), suggestions.labelNames.length === 0 &&
|
|
174
174
|
suggestions.literals.length === 0 &&
|
|
175
|
-
!isLabelValuesLoading && (_jsx(RefreshButton, { onClick: () => void handleRefetchValues(), disabled: isRefetchingValues, title: "Refresh label values", testId: "suggestions-refresh-values-button" }))] }) }) })) }));
|
|
175
|
+
!isLabelValuesLoading && (_jsx(RefreshButton, { onClick: () => void handleRefetchValues(), disabled: isRefetchingValues, title: "Refresh label values", testId: "suggestions-refresh-values-button", loading: isRefetchingValues }))] }) }) })) }));
|
|
176
176
|
};
|
|
177
177
|
export default SuggestionsList;
|
|
@@ -26,7 +26,7 @@ interface UseLabelValues {
|
|
|
26
26
|
error?: Error;
|
|
27
27
|
};
|
|
28
28
|
loading: boolean;
|
|
29
|
-
refetch: () => void
|
|
29
|
+
refetch: () => Promise<void>;
|
|
30
30
|
}
|
|
31
31
|
export declare const useLabelValues: (client: QueryServiceClient, labelName: string, profileType: string, start?: number, end?: number) => UseLabelValues;
|
|
32
32
|
export declare const useFetchUtilizationLabelValues: (labelName: string, utilizationLabels?: UtilizationLabels) => string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAgB,cAAc,EAAE,kBAAkB,EAAgB,MAAM,eAAe,CAAC;AAE/F,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAKrD,UAAU,kBAAkB;IAC1B,WAAW,EAAE,kBAAkB,CAAC;IAChC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,GACxB,QAAQ,kBAAkB,EAC1B,aAAa,MAAM,EACnB,QAAQ,MAAM,EACd,MAAM,MAAM,EACZ,QAAQ,MAAM,EAAE,KACf,aAgCF,CAAC;AAEF,UAAU,cAAc;IACtB,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version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,MAAM,MAAM,KACX,cAiCF,CAAC;AAEF,eAAO,MAAM,8BAA8B,GACzC,WAAW,MAAM,EACjB,oBAAoB,iBAAiB,KACpC,MAAM,EAWR,CAAC;AA2MF,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAWxF"}
|
|
@@ -77,8 +77,8 @@ export const useLabelValues = (client, labelName, profileType, start, end) => {
|
|
|
77
77
|
return {
|
|
78
78
|
result: { response: data ?? [], error: error },
|
|
79
79
|
loading: isLoading,
|
|
80
|
-
refetch: () => {
|
|
81
|
-
|
|
80
|
+
refetch: async () => {
|
|
81
|
+
await refetch();
|
|
82
82
|
},
|
|
83
83
|
};
|
|
84
84
|
};
|
|
@@ -64,7 +64,7 @@ export interface IProfileTypesResult {
|
|
|
64
64
|
data?: ProfileTypesResponse;
|
|
65
65
|
error?: RpcError;
|
|
66
66
|
}
|
|
67
|
-
export declare const useProfileTypes: (client: QueryServiceClient) => IProfileTypesResult;
|
|
67
|
+
export declare const useProfileTypes: (client: QueryServiceClient, start?: number, end?: number) => IProfileTypesResult;
|
|
68
68
|
declare const ProfileSelector: ({ queryClient, querySelection, selectProfile, selectQuery, closeProfile, enforcedProfileName, profileSelection, comparing, navigateTo, showMetricsGraph, showSumBySelector, showProfileTypeSelector, disableExplorativeQuerying, setDisplayHideMetricsGraphButton, utilizationMetrics, utilizationMetricsLoading, utilizationLabels, onUtilizationSeriesSelect, }: ProfileSelectorProps) => JSX.Element;
|
|
69
69
|
export default ProfileSelector;
|
|
70
70
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAuC,MAAM,OAAO,CAAC;AAErF,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAElD,O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AAM,KACX,mBAsBF,CAAC;AAEF,QAAA,MAAM,eAAe,GAAI,mWAmBtB,oBAAoB,KAAG,GAAG,CAAC,OAkO7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -16,32 +16,36 @@ import { DateTimeRange, IconButton, useGrpcMetadata, useParcaContext, useURLStat
|
|
|
16
16
|
import { CloseIcon } from '@parca/icons';
|
|
17
17
|
import { Query } from '@parca/parser';
|
|
18
18
|
import { TEST_IDS, testId } from '@parca/test-utils';
|
|
19
|
+
import { millisToProtoTimestamp } from '@parca/utilities';
|
|
19
20
|
import { useLabelNames } from '../MatchersInput/index';
|
|
20
21
|
import { useMetricsGraphDimensions } from '../MetricsGraph/useMetricsGraphDimensions';
|
|
21
22
|
import { UtilizationLabelsProvider } from '../contexts/UtilizationLabelsContext';
|
|
23
|
+
import useGrpcQuery from '../useGrpcQuery';
|
|
22
24
|
import { useDefaultSumBy, useSumBySelection } from '../useSumBy';
|
|
23
25
|
import { MetricsGraphSection } from './MetricsGraphSection';
|
|
24
26
|
import { QueryControls } from './QueryControls';
|
|
25
27
|
import { useAutoQuerySelector } from './useAutoQuerySelector';
|
|
26
|
-
export const useProfileTypes = (client) => {
|
|
27
|
-
const [result, setResult] = useState(undefined);
|
|
28
|
-
const [error, setError] = useState(undefined);
|
|
29
|
-
const [loading, setLoading] = useState(true);
|
|
28
|
+
export const useProfileTypes = (client, start, end) => {
|
|
30
29
|
const metadata = useGrpcMetadata();
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
const metadataString = useMemo(() => JSON.stringify(metadata), [metadata]);
|
|
31
|
+
const request = {};
|
|
32
|
+
if (start != null && end != null) {
|
|
33
|
+
request.start = millisToProtoTimestamp(start);
|
|
34
|
+
request.end = millisToProtoTimestamp(end);
|
|
35
|
+
}
|
|
36
|
+
const { isLoading, data, error } = useGrpcQuery({
|
|
37
|
+
key: ['profileTypes', metadataString, start, end],
|
|
38
|
+
queryFn: async (abort) => {
|
|
39
|
+
const { response } = await client.profileTypes(request, {
|
|
40
|
+
meta: metadata,
|
|
41
|
+
abort,
|
|
42
|
+
});
|
|
43
|
+
return response;
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
return { loading: isLoading, data, error: error };
|
|
42
47
|
};
|
|
43
48
|
const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQuery, closeProfile, enforcedProfileName, profileSelection, comparing, navigateTo, showMetricsGraph = true, showSumBySelector = true, showProfileTypeSelector = true, disableExplorativeQuerying = false, setDisplayHideMetricsGraphButton, utilizationMetrics, utilizationMetricsLoading, utilizationLabels, onUtilizationSeriesSelect, }) => {
|
|
44
|
-
const { loading: profileTypesLoading, data: profileTypesData, error, } = useProfileTypes(queryClient);
|
|
45
49
|
const { heightStyle } = useMetricsGraphDimensions(comparing, utilizationMetrics != null);
|
|
46
50
|
const { viewComponent } = useParcaContext();
|
|
47
51
|
const [queryBrowserMode, setQueryBrowserMode] = useURLState('query_browser_mode');
|
|
@@ -56,6 +60,7 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
|
|
|
56
60
|
}, [querySelection.expression]);
|
|
57
61
|
const from = timeRangeSelection.getFromMs();
|
|
58
62
|
const to = timeRangeSelection.getToMs();
|
|
63
|
+
const { loading: profileTypesLoading, data: profileTypesData, error, } = useProfileTypes(queryClient, from, to);
|
|
59
64
|
const { loading: labelNamesLoading, result, refetch, } = useLabelNames(queryClient, profileType.toString(), from, to);
|
|
60
65
|
const { loading: selectedLabelNamesLoading, result: selectedLabelNamesResult } = useLabelNames(queryClient, selectedProfileType.toString(), from, to);
|
|
61
66
|
const labels = useMemo(() => {
|
|
@@ -13,8 +13,8 @@ interface LabelsContextType {
|
|
|
13
13
|
currentLabelName: string | null;
|
|
14
14
|
setCurrentLabelName: (name: string | null) => void;
|
|
15
15
|
shouldHandlePrefixes: boolean;
|
|
16
|
-
refetchLabelValues: () => void
|
|
17
|
-
refetchLabelNames: () => void
|
|
16
|
+
refetchLabelValues: () => Promise<void>;
|
|
17
|
+
refetchLabelNames: () => Promise<void>;
|
|
18
18
|
}
|
|
19
19
|
interface LabelsProviderProps {
|
|
20
20
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatchersInputLabelsContext.d.ts","sourceRoot":"","sources":["../../src/contexts/MatchersInputLabelsContext.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAKjD,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"MatchersInputLabelsContext.d.ts","sourceRoot":"","sources":["../../src/contexts/MatchersInputLabelsContext.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAKjD,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAID,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAID,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,WAAW,EACX,WAAW,EACX,KAAK,EACL,GAAG,GACJ,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CA4EnC;AAED,wBAAgB,SAAS,IAAI,iBAAiB,CAM7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHasProfileData.d.ts","sourceRoot":"","sources":["../src/useHasProfileData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHasProfileData.d.ts","sourceRoot":"","sources":["../src/useHasProfileData.ts"],"names":[],"mappings":"AAeA,OAAO,EAAyB,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAKzE,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,kBAAkB,KACzB;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAA;CAatD,CAAC"}
|
|
@@ -10,12 +10,16 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
+
import { useMemo } from 'react';
|
|
14
|
+
import { useGrpcMetadata } from '@parca/components';
|
|
13
15
|
import useGrpcQuery from './useGrpcQuery';
|
|
14
16
|
export const useHasProfileData = (client) => {
|
|
17
|
+
const metadata = useGrpcMetadata();
|
|
18
|
+
const metadataString = useMemo(() => JSON.stringify(metadata), [metadata]);
|
|
15
19
|
const { data, isLoading, error } = useGrpcQuery({
|
|
16
|
-
key: ['hasProfileData'],
|
|
20
|
+
key: ['hasProfileData', metadataString],
|
|
17
21
|
queryFn: async (signal) => {
|
|
18
|
-
const { response } = await client.hasProfileData({}, { abort: signal });
|
|
22
|
+
const { response } = await client.hasProfileData({}, { abort: signal, meta: metadata });
|
|
19
23
|
return response;
|
|
20
24
|
},
|
|
21
25
|
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.70",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@floating-ui/react": "^0.27.12",
|
|
7
7
|
"@headlessui/react": "^1.7.19",
|
|
8
8
|
"@iconify/react": "^4.0.0",
|
|
9
9
|
"@parca/client": "0.17.7",
|
|
10
|
-
"@parca/components": "0.16.
|
|
10
|
+
"@parca/components": "0.16.379",
|
|
11
11
|
"@parca/dynamicsize": "0.16.67",
|
|
12
12
|
"@parca/hooks": "0.0.106",
|
|
13
13
|
"@parca/icons": "0.16.74",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"access": "public",
|
|
80
80
|
"registry": "https://registry.npmjs.org/"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "030fa6b9a9f8ea2b05931b605eeb07d11d2d3951"
|
|
83
83
|
}
|
|
@@ -54,8 +54,8 @@ interface Props {
|
|
|
54
54
|
isLabelNamesLoading: boolean;
|
|
55
55
|
isLabelValuesLoading: boolean;
|
|
56
56
|
shouldTrimPrefix: boolean;
|
|
57
|
-
refetchLabelValues: () => void
|
|
58
|
-
refetchLabelNames: () => void
|
|
57
|
+
refetchLabelValues: () => Promise<void>;
|
|
58
|
+
refetchLabelNames: () => Promise<void>;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const LoadingSpinner = (): JSX.Element => {
|
|
@@ -388,6 +388,7 @@ const SuggestionsList = ({
|
|
|
388
388
|
disabled={isRefetchingNames}
|
|
389
389
|
title="Refresh label names"
|
|
390
390
|
testId="suggestions-refresh-names-button"
|
|
391
|
+
loading={isRefetchingNames}
|
|
391
392
|
/>
|
|
392
393
|
)}
|
|
393
394
|
{suggestions.labelNames.length === 0 &&
|
|
@@ -398,6 +399,7 @@ const SuggestionsList = ({
|
|
|
398
399
|
disabled={isRefetchingValues}
|
|
399
400
|
title="Refresh label values"
|
|
400
401
|
testId="suggestions-refresh-values-button"
|
|
402
|
+
loading={isRefetchingValues}
|
|
401
403
|
/>
|
|
402
404
|
)}
|
|
403
405
|
</div>
|
|
@@ -95,7 +95,7 @@ interface UseLabelValues {
|
|
|
95
95
|
error?: Error;
|
|
96
96
|
};
|
|
97
97
|
loading: boolean;
|
|
98
|
-
refetch: () => void
|
|
98
|
+
refetch: () => Promise<void>;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
export const useLabelValues = (
|
|
@@ -133,8 +133,8 @@ export const useLabelValues = (
|
|
|
133
133
|
return {
|
|
134
134
|
result: {response: data ?? [], error: error as Error},
|
|
135
135
|
loading: isLoading,
|
|
136
|
-
refetch: () => {
|
|
137
|
-
|
|
136
|
+
refetch: async () => {
|
|
137
|
+
await refetch();
|
|
138
138
|
},
|
|
139
139
|
};
|
|
140
140
|
};
|
|
@@ -15,7 +15,7 @@ import {Dispatch, SetStateAction, useEffect, useMemo, useRef, useState} from 're
|
|
|
15
15
|
|
|
16
16
|
import {RpcError} from '@protobuf-ts/runtime-rpc';
|
|
17
17
|
|
|
18
|
-
import {ProfileTypesResponse, QueryServiceClient} from '@parca/client';
|
|
18
|
+
import {ProfileTypesRequest, ProfileTypesResponse, QueryServiceClient} from '@parca/client';
|
|
19
19
|
import {
|
|
20
20
|
DateTimeRange,
|
|
21
21
|
IconButton,
|
|
@@ -26,12 +26,13 @@ import {
|
|
|
26
26
|
import {CloseIcon} from '@parca/icons';
|
|
27
27
|
import {Query} from '@parca/parser';
|
|
28
28
|
import {TEST_IDS, testId} from '@parca/test-utils';
|
|
29
|
-
import {type NavigateFunction} from '@parca/utilities';
|
|
29
|
+
import {millisToProtoTimestamp, type NavigateFunction} from '@parca/utilities';
|
|
30
30
|
|
|
31
31
|
import {ProfileSelection} from '..';
|
|
32
32
|
import {useLabelNames} from '../MatchersInput/index';
|
|
33
33
|
import {useMetricsGraphDimensions} from '../MetricsGraph/useMetricsGraphDimensions';
|
|
34
34
|
import {UtilizationLabelsProvider} from '../contexts/UtilizationLabelsContext';
|
|
35
|
+
import useGrpcQuery from '../useGrpcQuery';
|
|
35
36
|
import {useDefaultSumBy, useSumBySelection} from '../useSumBy';
|
|
36
37
|
import {MetricsGraphSection} from './MetricsGraphSection';
|
|
37
38
|
import {QueryControls} from './QueryControls';
|
|
@@ -104,24 +105,32 @@ export interface IProfileTypesResult {
|
|
|
104
105
|
error?: RpcError;
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
export const useProfileTypes = (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
export const useProfileTypes = (
|
|
109
|
+
client: QueryServiceClient,
|
|
110
|
+
start?: number,
|
|
111
|
+
end?: number
|
|
112
|
+
): IProfileTypesResult => {
|
|
111
113
|
const metadata = useGrpcMetadata();
|
|
114
|
+
const metadataString = useMemo(() => JSON.stringify(metadata), [metadata]);
|
|
115
|
+
const request: ProfileTypesRequest = {};
|
|
116
|
+
|
|
117
|
+
if (start != null && end != null) {
|
|
118
|
+
request.start = millisToProtoTimestamp(start);
|
|
119
|
+
request.end = millisToProtoTimestamp(end);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const {isLoading, data, error} = useGrpcQuery({
|
|
123
|
+
key: ['profileTypes', metadataString, start, end],
|
|
124
|
+
queryFn: async abort => {
|
|
125
|
+
const {response} = await client.profileTypes(request, {
|
|
126
|
+
meta: metadata,
|
|
127
|
+
abort,
|
|
128
|
+
});
|
|
129
|
+
return response;
|
|
130
|
+
},
|
|
131
|
+
});
|
|
112
132
|
|
|
113
|
-
|
|
114
|
-
if (!loading) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const call = client.profileTypes({}, {meta: metadata});
|
|
118
|
-
call.response
|
|
119
|
-
.then(response => setResult(response))
|
|
120
|
-
.catch(error => setError(error))
|
|
121
|
-
.finally(() => setLoading(false));
|
|
122
|
-
}, [client, metadata, loading]);
|
|
123
|
-
|
|
124
|
-
return {loading, data: result, error};
|
|
133
|
+
return {loading: isLoading, data, error: error as RpcError};
|
|
125
134
|
};
|
|
126
135
|
|
|
127
136
|
const ProfileSelector = ({
|
|
@@ -144,11 +153,6 @@ const ProfileSelector = ({
|
|
|
144
153
|
utilizationLabels,
|
|
145
154
|
onUtilizationSeriesSelect,
|
|
146
155
|
}: ProfileSelectorProps): JSX.Element => {
|
|
147
|
-
const {
|
|
148
|
-
loading: profileTypesLoading,
|
|
149
|
-
data: profileTypesData,
|
|
150
|
-
error,
|
|
151
|
-
} = useProfileTypes(queryClient);
|
|
152
156
|
const {heightStyle} = useMetricsGraphDimensions(comparing, utilizationMetrics != null);
|
|
153
157
|
const {viewComponent} = useParcaContext();
|
|
154
158
|
const [queryBrowserMode, setQueryBrowserMode] = useURLState('query_browser_mode');
|
|
@@ -174,6 +178,12 @@ const ProfileSelector = ({
|
|
|
174
178
|
const from = timeRangeSelection.getFromMs();
|
|
175
179
|
const to = timeRangeSelection.getToMs();
|
|
176
180
|
|
|
181
|
+
const {
|
|
182
|
+
loading: profileTypesLoading,
|
|
183
|
+
data: profileTypesData,
|
|
184
|
+
error,
|
|
185
|
+
} = useProfileTypes(queryClient, from, to);
|
|
186
|
+
|
|
177
187
|
const {
|
|
178
188
|
loading: labelNamesLoading,
|
|
179
189
|
result,
|
|
@@ -32,8 +32,8 @@ interface LabelsContextType {
|
|
|
32
32
|
currentLabelName: string | null;
|
|
33
33
|
setCurrentLabelName: (name: string | null) => void;
|
|
34
34
|
shouldHandlePrefixes: boolean;
|
|
35
|
-
refetchLabelValues: () => void
|
|
36
|
-
refetchLabelNames: () => void
|
|
35
|
+
refetchLabelValues: () => Promise<void>;
|
|
36
|
+
refetchLabelNames: () => Promise<void>;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const LabelsContext = createContext<LabelsContextType | null>(null);
|
package/src/useHasProfileData.ts
CHANGED
|
@@ -11,17 +11,23 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
|
|
14
|
+
import {useMemo} from 'react';
|
|
15
|
+
|
|
14
16
|
import {HasProfileDataResponse, QueryServiceClient} from '@parca/client';
|
|
17
|
+
import {useGrpcMetadata} from '@parca/components';
|
|
15
18
|
|
|
16
19
|
import useGrpcQuery from './useGrpcQuery';
|
|
17
20
|
|
|
18
21
|
export const useHasProfileData = (
|
|
19
22
|
client: QueryServiceClient
|
|
20
23
|
): {loading: boolean; data: boolean; error: Error | any} => {
|
|
24
|
+
const metadata = useGrpcMetadata();
|
|
25
|
+
const metadataString = useMemo(() => JSON.stringify(metadata), [metadata]);
|
|
26
|
+
|
|
21
27
|
const {data, isLoading, error} = useGrpcQuery<HasProfileDataResponse>({
|
|
22
|
-
key: ['hasProfileData'],
|
|
28
|
+
key: ['hasProfileData', metadataString],
|
|
23
29
|
queryFn: async signal => {
|
|
24
|
-
const {response} = await client.hasProfileData({}, {abort: signal});
|
|
30
|
+
const {response} = await client.hasProfileData({}, {abort: signal, meta: metadata});
|
|
25
31
|
return response;
|
|
26
32
|
},
|
|
27
33
|
});
|