@parca/profile 0.16.407 → 0.16.409

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.409](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.408...@parca/profile@0.16.409) (2024-07-10)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.408](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.407...@parca/profile@0.16.408) (2024-07-09)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.407](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.406...@parca/profile@0.16.407) (2024-07-09)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -12,7 +12,6 @@ interface ProfileMetricsGraphProps {
12
12
  profile: ProfileSelection | null;
13
13
  from: number;
14
14
  to: number;
15
- timeRange: DateTimeRange;
16
15
  setTimeRange: (range: DateTimeRange) => void;
17
16
  addLabelMatcher: (labels: {
18
17
  key: string;
@@ -27,10 +26,9 @@ interface ProfileMetricsGraphProps {
27
26
  export interface IQueryRangeState {
28
27
  response: QueryRangeResponse | null;
29
28
  isLoading: boolean;
30
- isRefreshing?: boolean;
31
29
  error: RpcError | null;
32
30
  }
33
- export declare const useQueryRange: (client: QueryServiceClient, queryExpression: string, start: number, end: number, timeRange: DateTimeRange, sumBy?: string[], skip?: boolean) => IQueryRangeState;
34
- declare const ProfileMetricsGraph: ({ queryClient, queryExpression, profile, from, to, setTimeRange, addLabelMatcher, onPointClick, comparing, timeRange, }: ProfileMetricsGraphProps) => JSX.Element;
31
+ export declare const useQueryRange: (client: QueryServiceClient, queryExpression: string, start: number, end: number, sumBy?: string[], skip?: boolean) => IQueryRangeState;
32
+ declare const ProfileMetricsGraph: ({ queryClient, queryExpression, profile, from, to, setTimeRange, addLabelMatcher, onPointClick, comparing, }: ProfileMetricsGraphProps) => JSX.Element;
35
33
  export default ProfileMetricsGraph;
36
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileMetricsGraph/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EAAW,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAY,MAAM,eAAe,CAAC;AACjG,OAAO,EACL,aAAa,EAKd,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAyB,gBAAgB,EAAC,MAAM,IAAI,CAAC;AAI5D,UAAU,6BAA6B;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAaD,eAAO,MAAM,wBAAwB,gBAAe,6BAA6B,KAAG,GAAG,CAAC,OAMvF,CAAC;AAEF,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,aAAa,CAAC;IACzB,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,CACf,MAAM,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,GAAG,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KACvE,IAAI,CAAC;IACV,YAAY,EAAE,CACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,KAAK,EAAE,EACf,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,SAAS,CAAC,EAA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AG,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KACvE,IAAI,CAAC;IACV,YAAY,EAAE,CACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,KAAK,EAAE,EACf,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB;AAcD,eAAO,MAAM,aAAa,WAChB,kBAAkB,mBACT,MAAM,SAChB,MAAM,OACR,MAAM,UACJ,MAAM,EAAE,qBAEd,gBAgEF,CAAC;AAEF,QAAA,MAAM,mBAAmB,iHAUtB,wBAAwB,KAAG,GAAG,CAAC,OAoFjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -11,7 +11,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { useEffect, useMemo, useRef, useState } from 'react';
14
+ import { useEffect, useMemo, useState } from 'react';
15
15
  import { AnimatePresence, motion } from 'framer-motion';
16
16
  import { Duration, Timestamp } from '@parca/client';
17
17
  import { MetricsGraphSkeleton, useGrpcMetadata, useParcaContext, useURLState, } from '@parca/components';
@@ -34,8 +34,7 @@ const getStepCountFromScreenWidth = (pixelsPerPoint) => {
34
34
  return Math.round(width / pixelsPerPoint);
35
35
  };
36
36
  const EMPTY_SUM_BY = [];
37
- export const useQueryRange = (client, queryExpression, start, end, timeRange, sumBy = EMPTY_SUM_BY, skip = false) => {
38
- const previousQueryParams = useRef({});
37
+ export const useQueryRange = (client, queryExpression, start, end, sumBy = EMPTY_SUM_BY, skip = false) => {
39
38
  const [isLoading, setLoading] = useState(!skip);
40
39
  const [state, setState] = useState({
41
40
  response: null,
@@ -64,15 +63,6 @@ export const useQueryRange = (client, queryExpression, start, end, timeRange, su
64
63
  if (skip) {
65
64
  return;
66
65
  }
67
- if (previousQueryParams.current.queryExpression !== queryExpression ||
68
- previousQueryParams.current.timeRange !== timeRange) {
69
- previousQueryParams.current.queryExpression = queryExpression;
70
- previousQueryParams.current.timeRange = timeRange;
71
- previousQueryParams.current.isRefresh = undefined;
72
- }
73
- else {
74
- previousQueryParams.current.isRefresh = true;
75
- }
76
66
  setLoading(true);
77
67
  const stepDuration = getStepDuration(start, end, stepCount);
78
68
  const call = client.queryRange({
@@ -92,18 +82,13 @@ export const useQueryRange = (client, queryExpression, start, end, timeRange, su
92
82
  .catch(error => {
93
83
  setState({ response: null, isLoading: false, error });
94
84
  setLoading(false);
95
- })
96
- .finally(() => {
97
- if (previousQueryParams.current.isRefresh !== undefined) {
98
- previousQueryParams.current.isRefresh = undefined;
99
- }
100
85
  });
101
86
  })();
102
- }, [client, queryExpression, start, end, metadata, timeRange, sumBy, skip, stepCount]);
103
- return { ...state, isLoading, isRefreshing: previousQueryParams.current.isRefresh };
87
+ }, [client, queryExpression, start, end, metadata, sumBy, skip, stepCount]);
88
+ return { ...state, isLoading };
104
89
  };
105
- const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to, setTimeRange, addLabelMatcher, onPointClick, comparing = false, timeRange, }) => {
106
- const { isLoading: metricsGraphLoading, response, error, } = useQueryRange(queryClient, queryExpression, from, to, timeRange);
90
+ const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to, setTimeRange, addLabelMatcher, onPointClick, comparing = false, }) => {
91
+ const { isLoading: metricsGraphLoading, response, error, } = useQueryRange(queryClient, queryExpression, from, to);
107
92
  const { onError, perf, authenticationErrorMessage, isDarkMode } = useParcaContext();
108
93
  const { width, height, margin, heightStyle } = useMetricsGraphDimensions(comparing);
109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Ae,CAAC"}
@@ -149,7 +149,7 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
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 &&
150
150
  querySelection.expression.length > 0 &&
151
151
  querySelection.from !== undefined &&
152
- querySelection.to !== undefined ? (_jsx("div", { className: "p-2", children: _jsx(ProfileMetricsGraph, { queryClient: queryClient, queryExpression: querySelection.expression, from: querySelection.from, to: querySelection.to, profile: profileSelection, comparing: comparing, timeRange: timeRangeSelection, setTimeRange: (range) => {
152
+ querySelection.to !== undefined ? (_jsx("div", { className: "p-2", children: _jsx(ProfileMetricsGraph, { queryClient: queryClient, queryExpression: querySelection.expression, from: querySelection.from, to: querySelection.to, profile: profileSelection, comparing: comparing, setTimeRange: (range) => {
153
153
  const from = range.getFromMs();
154
154
  const to = range.getToMs();
155
155
  let mergedProfileParams = {};
@@ -1 +1 @@
1
- {"version":3,"file":"useAutoQuerySelector.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/useAutoQuerySelector.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAGlD,UAAU,KAAK;IACb,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACnD,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,eAAO,MAAM,oBAAoB,+GAO9B,KAAK,KAAG,IAqHV,CAAC"}
1
+ {"version":3,"file":"useAutoQuerySelector.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/useAutoQuerySelector.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAGlD,UAAU,KAAK;IACb,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACnD,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,eAAO,MAAM,oBAAoB,+GAO9B,KAAK,KAAG,IA0HV,CAAC"}
@@ -71,7 +71,10 @@ export const useAutoQuerySelector = ({ selectedProfileName, profileTypesData, se
71
71
  return;
72
72
  }
73
73
  dispatch(setAutoQuery('true'));
74
- let profileType = profileTypesData.types.find(type => type.name === 'otel_profiling_agent_on_cpu' && type.delta);
74
+ let profileType = profileTypesData.types.find(type => type.name === 'parca_agent' && type.delta);
75
+ if (profileType == null) {
76
+ profileType = profileTypesData.types.find(type => type.name === 'otel_profiling_agent_on_cpu' && type.delta);
77
+ }
75
78
  if (profileType == null) {
76
79
  profileType = profileTypesData.types.find(type => type.name === 'parca_agent_cpu' && type.delta);
77
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileTypeSelector/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAC,WAAW,EAAE,oBAAoB,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,KAAK,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAE7D,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,iBAAiB;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACjC;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAyE/B,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAU3F;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,8BAA8B,EAAE,OAAO,GACtC,aAAa,CAiBf;AAED,eAAO,MAAM,oBAAoB,SAAU,WAAW,KAAG,MAIxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,UAAW,WAAW,EAAE,KAAG,MAAM,EAItE,CAAC;AAEF,UAAU,KAAK;IACb,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,mBAAmB,8GAQtB,KAAK,KAAG,GAAG,CAAC,OAyBd,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -82,6 +82,10 @@ export const wellKnownProfiles = {
82
82
  name: 'On-CPU Samples',
83
83
  help: 'On CPU profile samples observed by the Otel Profiling Agent.',
84
84
  },
85
+ 'parca_agent:samples:count:cpu:nanoseconds:delta': {
86
+ name: 'On-CPU',
87
+ help: 'On CPU profile samples observed by the Parca Agent.',
88
+ },
85
89
  };
86
90
  export function flexibleWellKnownProfileMatching(name) {
87
91
  const prefixExcludedName = name.split(':').slice(1).join(':');
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.407",
3
+ "version": "0.16.409",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@headlessui/react": "^1.7.19",
7
7
  "@iconify/react": "^4.0.0",
8
8
  "@parca/client": "0.16.122",
9
- "@parca/components": "0.16.292",
9
+ "@parca/components": "0.16.293",
10
10
  "@parca/dynamicsize": "0.16.65",
11
11
  "@parca/hooks": "0.0.67",
12
12
  "@parca/icons": "0.16.70",
@@ -73,5 +73,5 @@
73
73
  "access": "public",
74
74
  "registry": "https://registry.npmjs.org/"
75
75
  },
76
- "gitHead": "c8ebc13e7bf1f28e6ea1bd43d719bab85c6a28b1"
76
+ "gitHead": "897320af0eaf5565a62ff1ad05b463b426a915fa"
77
77
  }
@@ -11,7 +11,7 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
- import {useEffect, useMemo, useRef, useState} from 'react';
14
+ import {useEffect, useMemo, useState} from 'react';
15
15
 
16
16
  import {RpcError} from '@protobuf-ts/runtime-rpc';
17
17
  import {AnimatePresence, motion} from 'framer-motion';
@@ -60,7 +60,6 @@ interface ProfileMetricsGraphProps {
60
60
  profile: ProfileSelection | null;
61
61
  from: number;
62
62
  to: number;
63
- timeRange: DateTimeRange;
64
63
  setTimeRange: (range: DateTimeRange) => void;
65
64
  addLabelMatcher: (
66
65
  labels: {key: string; value: string} | Array<{key: string; value: string}>
@@ -77,7 +76,6 @@ interface ProfileMetricsGraphProps {
77
76
  export interface IQueryRangeState {
78
77
  response: QueryRangeResponse | null;
79
78
  isLoading: boolean;
80
- isRefreshing?: boolean;
81
79
  error: RpcError | null;
82
80
  }
83
81
 
@@ -98,15 +96,9 @@ export const useQueryRange = (
98
96
  queryExpression: string,
99
97
  start: number,
100
98
  end: number,
101
- timeRange: DateTimeRange,
102
99
  sumBy: string[] = EMPTY_SUM_BY,
103
100
  skip = false
104
101
  ): IQueryRangeState => {
105
- const previousQueryParams = useRef<{
106
- queryExpression?: string;
107
- timeRange?: DateTimeRange;
108
- isRefresh?: boolean;
109
- }>({});
110
102
  const [isLoading, setLoading] = useState<boolean>(!skip);
111
103
  const [state, setState] = useState<IQueryRangeState>({
112
104
  response: null,
@@ -141,17 +133,6 @@ export const useQueryRange = (
141
133
  return;
142
134
  }
143
135
 
144
- if (
145
- previousQueryParams.current.queryExpression !== queryExpression ||
146
- previousQueryParams.current.timeRange !== timeRange
147
- ) {
148
- previousQueryParams.current.queryExpression = queryExpression;
149
- previousQueryParams.current.timeRange = timeRange;
150
- previousQueryParams.current.isRefresh = undefined;
151
- } else {
152
- previousQueryParams.current.isRefresh = true;
153
- }
154
-
155
136
  setLoading(true);
156
137
 
157
138
  const stepDuration = getStepDuration(start, end, stepCount);
@@ -176,16 +157,11 @@ export const useQueryRange = (
176
157
  .catch(error => {
177
158
  setState({response: null, isLoading: false, error});
178
159
  setLoading(false);
179
- })
180
- .finally(() => {
181
- if (previousQueryParams.current.isRefresh !== undefined) {
182
- previousQueryParams.current.isRefresh = undefined;
183
- }
184
160
  });
185
161
  })();
186
- }, [client, queryExpression, start, end, metadata, timeRange, sumBy, skip, stepCount]);
162
+ }, [client, queryExpression, start, end, metadata, sumBy, skip, stepCount]);
187
163
 
188
- return {...state, isLoading, isRefreshing: previousQueryParams.current.isRefresh};
164
+ return {...state, isLoading};
189
165
  };
190
166
 
191
167
  const ProfileMetricsGraph = ({
@@ -198,13 +174,12 @@ const ProfileMetricsGraph = ({
198
174
  addLabelMatcher,
199
175
  onPointClick,
200
176
  comparing = false,
201
- timeRange,
202
177
  }: ProfileMetricsGraphProps): JSX.Element => {
203
178
  const {
204
179
  isLoading: metricsGraphLoading,
205
180
  response,
206
181
  error,
207
- } = useQueryRange(queryClient, queryExpression, from, to, timeRange);
182
+ } = useQueryRange(queryClient, queryExpression, from, to);
208
183
  const {onError, perf, authenticationErrorMessage, isDarkMode} = useParcaContext();
209
184
  const {width, height, margin, heightStyle} = useMetricsGraphDimensions(comparing);
210
185
 
@@ -288,7 +288,6 @@ const ProfileSelector = ({
288
288
  to={querySelection.to}
289
289
  profile={profileSelection}
290
290
  comparing={comparing}
291
- timeRange={timeRangeSelection}
292
291
  setTimeRange={(range: DateTimeRange) => {
293
292
  const from = range.getFromMs();
294
293
  const to = range.getToMs();
@@ -107,8 +107,13 @@ export const useAutoQuerySelector = ({
107
107
  }
108
108
  dispatch(setAutoQuery('true'));
109
109
  let profileType = profileTypesData.types.find(
110
- type => type.name === 'otel_profiling_agent_on_cpu' && type.delta
110
+ type => type.name === 'parca_agent' && type.delta
111
111
  );
112
+ if (profileType == null) {
113
+ profileType = profileTypesData.types.find(
114
+ type => type.name === 'otel_profiling_agent_on_cpu' && type.delta
115
+ );
116
+ }
112
117
  if (profileType == null) {
113
118
  profileType = profileTypesData.types.find(
114
119
  type => type.name === 'parca_agent_cpu' && type.delta
@@ -96,6 +96,10 @@ export const wellKnownProfiles: WellKnownProfiles = {
96
96
  name: 'On-CPU Samples',
97
97
  help: 'On CPU profile samples observed by the Otel Profiling Agent.',
98
98
  },
99
+ 'parca_agent:samples:count:cpu:nanoseconds:delta': {
100
+ name: 'On-CPU',
101
+ help: 'On CPU profile samples observed by the Parca Agent.',
102
+ },
99
103
  };
100
104
 
101
105
  export function flexibleWellKnownProfileMatching(name: string): WellKnownProfile | undefined {