@parca/profile 0.16.404 → 0.16.406

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 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.406](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.405...@parca/profile@0.16.406) (2024-07-09)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.405](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.404...@parca/profile@0.16.405) (2024-07-09)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.404](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.402...@parca/profile@0.16.404) (2024-07-08)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -5,6 +5,7 @@ interface MatchersInputProps {
5
5
  setMatchersString: (arg: string) => void;
6
6
  runQuery: () => void;
7
7
  currentQuery: Query;
8
+ profileType: string;
8
9
  }
9
10
  export interface ILabelNamesResult {
10
11
  response?: LabelsResponse;
@@ -14,7 +15,7 @@ interface UseLabelNames {
14
15
  result: ILabelNamesResult;
15
16
  loading: boolean;
16
17
  }
17
- export declare const useLabelNames: (client: QueryServiceClient, start?: number, end?: number, profileType?: string) => UseLabelNames;
18
- declare const MatchersInput: ({ queryClient, setMatchersString, runQuery, currentQuery, }: MatchersInputProps) => JSX.Element;
18
+ export declare const useLabelNames: (client: QueryServiceClient, profileType: string, start?: number, end?: number) => UseLabelNames;
19
+ declare const MatchersInput: ({ queryClient, setMatchersString, runQuery, currentQuery, profileType, }: MatchersInputProps) => JSX.Element;
19
20
  export default MatchersInput;
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/index.tsx"],"names":[],"mappings":"AAkB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E,iBAAiB,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,WAChB,kBAAkB,eACb,MAAM,UACX,MAAM,QACR,MAAM,KACX,aA4BF,CAAC;AAEF,QAAA,MAAM,aAAa,6EAMhB,kBAAkB,KAAG,GAAG,CAAC,OAoL3B,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -18,11 +18,14 @@ import { useGrpcMetadata } from '@parca/components';
18
18
  import { Query } from '@parca/parser';
19
19
  import { millisToProtoTimestamp, sanitizeLabelValue } from '@parca/utilities';
20
20
  import SuggestionsList, { Suggestion, Suggestions } from './SuggestionsList';
21
- export const useLabelNames = (client, start, end, profileType) => {
21
+ export const useLabelNames = (client, profileType, start, end) => {
22
22
  const [loading, setLoading] = useState(true);
23
23
  const [result, setResult] = useState({});
24
24
  const metadata = useGrpcMetadata();
25
25
  useEffect(() => {
26
+ if (profileType === undefined || profileType === '') {
27
+ return;
28
+ }
26
29
  const request = { match: [] };
27
30
  if (start !== undefined && end !== undefined) {
28
31
  request.start = millisToProtoTimestamp(start);
@@ -40,7 +43,7 @@ export const useLabelNames = (client, start, end, profileType) => {
40
43
  }, [client, metadata, start, end, profileType]);
41
44
  return { result, loading };
42
45
  };
43
- const MatchersInput = ({ queryClient, setMatchersString, runQuery, currentQuery, }) => {
46
+ const MatchersInput = ({ queryClient, setMatchersString, runQuery, currentQuery, profileType, }) => {
44
47
  const inputRef = useRef(null);
45
48
  const [focusedInput, setFocusedInput] = useState(false);
46
49
  const [labelValuesLoading, setLabelValuesLoading] = useState(false);
@@ -48,11 +51,11 @@ const MatchersInput = ({ queryClient, setMatchersString, runQuery, currentQuery,
48
51
  const [labelValues, setLabelValues] = useState(null);
49
52
  const [currentLabelName, setCurrentLabelName] = useState(null);
50
53
  const metadata = useGrpcMetadata();
51
- const { loading: labelNamesLoading, result } = useLabelNames(queryClient);
54
+ const { loading: labelNamesLoading, result } = useLabelNames(queryClient, profileType);
52
55
  const { response: labelNamesResponse, error: labelNamesError } = result;
53
56
  useEffect(() => {
54
57
  if (currentLabelName !== null) {
55
- const call = queryClient.values({ labelName: currentLabelName, match: [] }, { meta: metadata });
58
+ const call = queryClient.values({ labelName: currentLabelName, match: [], profileType }, { meta: metadata });
56
59
  setLabelValuesLoading(true);
57
60
  call.response
58
61
  .then(response => {
@@ -63,7 +66,7 @@ const MatchersInput = ({ queryClient, setMatchersString, runQuery, currentQuery,
63
66
  .catch(() => setLabelValues(null))
64
67
  .finally(() => setLabelValuesLoading(false));
65
68
  }
66
- }, [currentLabelName, queryClient, metadata]);
69
+ }, [currentLabelName, metadata, profileType, queryClient]);
67
70
  const labelNames = useMemo(() => {
68
71
  return (labelNamesError === undefined || labelNamesError == null) &&
69
72
  labelNamesResponse !== undefined &&
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAQ,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAY9E,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAyB,gBAAgB,EAAC,MAAM,IAAI,CAAC;AAO5D,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,oBAAoB;IAC5B,WAAW,EAAE,kBAAkB,CAAC;IAChC,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAA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IAC7C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,WAAY,kBAAkB,KAAG,mBAkB5D,CAAC;AAEF,QAAA,MAAM,eAAe,6IAUlB,oBAAoB,KAAG,GAAG,CAAC,OA4P7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -143,7 +143,7 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
143
143
  queryExpressionString === '' ||
144
144
  queryExpressionString === '{}';
145
145
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 flex gap-2", children: [_jsxs("div", { className: "flex w-full flex-wrap content-start items-center gap-2", children: [_jsxs("div", { className: "pb-6", children: [_jsx("label", { className: "text-xs", children: "Profile type" }), _jsx(ProfileTypeSelector, { profileTypesData: profileTypesData, loading: profileTypesLoading, selectedKey: selectedProfileName, onSelection: setProfileName, error: error, disabled: viewComponent?.disableProfileTypesDropdown })] }), _jsxs("div", { className: "w-full flex-1 pb-6", children: [_jsxs("div", { className: "mb-0.5 mt-1.5 flex items-center justify-between", children: [_jsx("label", { className: "text-xs", children: "Query" }), (query.matchers.length > 0 || query.inputMatcherString.length > 0) &&
146
- viewComponent !== undefined && _jsx("div", { children: viewComponent?.createViewComponent })] }), _jsx(MatchersInput, { queryClient: queryClient, setMatchersString: setMatchersString, runQuery: setQueryExpression, currentQuery: query })] }), _jsx(DateTimeRangePicker, { onRangeSelection: setTimeRangeSelection, range: timeRangeSelection }), _jsx(ButtonGroup, { children: _jsx(Button, { disabled: searchDisabled, onClick: (e) => {
146
+ viewComponent !== undefined && _jsx("div", { children: viewComponent?.createViewComponent })] }), _jsx(MatchersInput, { queryClient: queryClient, setMatchersString: setMatchersString, runQuery: setQueryExpression, currentQuery: query, profileType: selectedProfileName })] }), _jsx(DateTimeRangePicker, { onRangeSelection: setTimeRangeSelection, range: timeRangeSelection }), _jsx(ButtonGroup, { children: _jsx(Button, { disabled: searchDisabled, onClick: (e) => {
147
147
  e.preventDefault();
148
148
  setQueryExpression(true);
149
149
  }, id: "h-matcher-search-button", children: "Search" }) })] }), _jsx("div", { children: comparing && _jsx(IconButton, { onClick: () => closeProfile(), icon: _jsx(CloseIcon, {}) }) })] }), _jsx("div", { className: "rounded bg-white shadow dark:border-gray-500 dark:bg-gray-700", children: _jsx("div", { style: { height: heightStyle }, children: querySelection.expression !== undefined &&
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.404",
3
+ "version": "0.16.406",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@headlessui/react": "^1.7.19",
7
7
  "@iconify/react": "^4.0.0",
8
- "@parca/client": "0.16.120",
9
- "@parca/components": "0.16.290",
8
+ "@parca/client": "0.16.121",
9
+ "@parca/components": "0.16.291",
10
10
  "@parca/dynamicsize": "0.16.65",
11
- "@parca/hooks": "0.0.65",
11
+ "@parca/hooks": "0.0.66",
12
12
  "@parca/icons": "0.16.70",
13
13
  "@parca/parser": "0.16.77",
14
- "@parca/store": "0.16.154",
15
- "@parca/utilities": "0.0.81",
14
+ "@parca/store": "0.16.155",
15
+ "@parca/utilities": "0.0.82",
16
16
  "@popperjs/core": "^2.11.8",
17
17
  "@protobuf-ts/runtime-rpc": "^2.5.0",
18
18
  "@tanstack/react-query": "^4.0.5",
@@ -73,5 +73,5 @@
73
73
  "access": "public",
74
74
  "registry": "https://registry.npmjs.org/"
75
75
  },
76
- "gitHead": "7c7035ef7c81ba140a28607e8a710f730857690d"
76
+ "gitHead": "08cdf31f7b1dc7eb96c36d2fd56008a0829fb1bc"
77
77
  }
@@ -28,6 +28,7 @@ interface MatchersInputProps {
28
28
  setMatchersString: (arg: string) => void;
29
29
  runQuery: () => void;
30
30
  currentQuery: Query;
31
+ profileType: string;
31
32
  }
32
33
 
33
34
  export interface ILabelNamesResult {
@@ -42,15 +43,19 @@ interface UseLabelNames {
42
43
 
43
44
  export const useLabelNames = (
44
45
  client: QueryServiceClient,
46
+ profileType: string,
45
47
  start?: number,
46
- end?: number,
47
- profileType?: string
48
+ end?: number
48
49
  ): UseLabelNames => {
49
50
  const [loading, setLoading] = useState(true);
50
51
  const [result, setResult] = useState<ILabelNamesResult>({});
51
52
  const metadata = useGrpcMetadata();
52
53
 
53
54
  useEffect(() => {
55
+ if (profileType === undefined || profileType === '') {
56
+ return;
57
+ }
58
+
54
59
  const request: LabelsRequest = {match: []};
55
60
  if (start !== undefined && end !== undefined) {
56
61
  request.start = millisToProtoTimestamp(start);
@@ -76,6 +81,7 @@ const MatchersInput = ({
76
81
  setMatchersString,
77
82
  runQuery,
78
83
  currentQuery,
84
+ profileType,
79
85
  }: MatchersInputProps): JSX.Element => {
80
86
  const inputRef = useRef<HTMLTextAreaElement | null>(null);
81
87
  const [focusedInput, setFocusedInput] = useState(false);
@@ -85,12 +91,15 @@ const MatchersInput = ({
85
91
  const [currentLabelName, setCurrentLabelName] = useState<string | null>(null);
86
92
  const metadata = useGrpcMetadata();
87
93
 
88
- const {loading: labelNamesLoading, result} = useLabelNames(queryClient);
94
+ const {loading: labelNamesLoading, result} = useLabelNames(queryClient, profileType);
89
95
  const {response: labelNamesResponse, error: labelNamesError} = result;
90
96
 
91
97
  useEffect(() => {
92
98
  if (currentLabelName !== null) {
93
- const call = queryClient.values({labelName: currentLabelName, match: []}, {meta: metadata});
99
+ const call = queryClient.values(
100
+ {labelName: currentLabelName, match: [], profileType},
101
+ {meta: metadata}
102
+ );
94
103
  setLabelValuesLoading(true);
95
104
 
96
105
  call.response
@@ -103,7 +112,7 @@ const MatchersInput = ({
103
112
  .catch(() => setLabelValues(null))
104
113
  .finally(() => setLabelValuesLoading(false));
105
114
  }
106
- }, [currentLabelName, queryClient, metadata]);
115
+ }, [currentLabelName, metadata, profileType, queryClient]);
107
116
 
108
117
  const labelNames = useMemo(() => {
109
118
  return (labelNamesError === undefined || labelNamesError == null) &&
@@ -252,6 +252,7 @@ const ProfileSelector = ({
252
252
  setMatchersString={setMatchersString}
253
253
  runQuery={setQueryExpression}
254
254
  currentQuery={query}
255
+ profileType={selectedProfileName}
255
256
  />
256
257
  </div>
257
258
  <DateTimeRangePicker