@parca/profile 0.16.394 → 0.16.395

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/Callgraph/index.d.ts +0 -1
  3. package/dist/GraphTooltip/ExpandOnHoverValue.d.ts +0 -1
  4. package/dist/GraphTooltip/index.d.ts +0 -1
  5. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.d.ts +0 -1
  6. package/dist/GraphTooltipArrow/ExpandOnHoverValue.d.ts +0 -1
  7. package/dist/MatchersInput/SuggestionItem.d.ts +0 -1
  8. package/dist/MatchersInput/SuggestionsList.d.ts +0 -1
  9. package/dist/MatchersInput/index.d.ts +0 -1
  10. package/dist/MetricsCircle/index.d.ts +0 -1
  11. package/dist/MetricsGraph/MetricsContextMenu/index.d.ts +0 -1
  12. package/dist/MetricsGraph/MetricsInfoPanel/index.d.ts +0 -1
  13. package/dist/MetricsGraph/MetricsTooltip/index.d.ts +0 -1
  14. package/dist/MetricsGraph/index.d.ts +0 -1
  15. package/dist/MetricsSeries/index.d.ts +0 -1
  16. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts +0 -1
  17. package/dist/ProfileExplorer/ProfileExplorerSingle.d.ts +0 -1
  18. package/dist/ProfileExplorer/index.d.ts +0 -1
  19. package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.d.ts +0 -1
  20. package/dist/ProfileIcicleGraph/IcicleGraph/index.d.ts +0 -1
  21. package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts +0 -1
  22. package/dist/ProfileMetricsGraph/index.d.ts +0 -1
  23. package/dist/ProfileMetricsGraph/index.js +6 -13
  24. package/dist/ProfileSelector/CompareButton.d.ts +0 -1
  25. package/dist/ProfileSelector/index.d.ts +0 -1
  26. package/dist/ProfileSource.d.ts +0 -1
  27. package/dist/ProfileTypeSelector/index.d.ts +0 -1
  28. package/dist/ProfileView/FilterByFunctionButton.d.ts +0 -1
  29. package/dist/ProfileView/ViewSelector.d.ts +0 -1
  30. package/dist/ProfileView/index.d.ts +0 -1
  31. package/dist/ProfileViewWithData.d.ts +0 -1
  32. package/dist/SourceView/LineNo.d.ts +0 -1
  33. package/dist/components/DiffLegend.d.ts +0 -1
  34. package/dist/components/ProfileShareButton/ResultBox.d.ts +0 -1
  35. package/dist/components/ProfileShareButton/index.d.ts +0 -1
  36. package/package.json +2 -2
  37. package/src/ProfileMetricsGraph/index.tsx +5 -36
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.395 (2024-07-01)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.16.394](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.393...@parca/profile@0.16.394) (2024-06-27)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Callgraph as CallgraphType } from '@parca/client';
3
2
  import { ProfileType } from '@parca/parser';
4
3
  export interface Props {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  value: string | number | undefined;
4
3
  displayValue?: string | number | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CallgraphNode, CallgraphNodeMeta, FlamegraphNode, FlamegraphNodeMeta, FlamegraphRootNode } from '@parca/client';
3
2
  import { Location, Mapping, Function as ParcaFunction } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
4
3
  interface ExtendedCallgraphNodeMeta extends CallgraphNodeMeta {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Table } from 'apache-arrow';
3
2
  import { ProfileType } from '@parca/parser';
4
3
  interface Props {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  value: string | number | undefined;
4
3
  displayValue?: string | number | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  isHighlighted: boolean;
4
3
  onHighlight: () => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare class Suggestion {
3
2
  type: string;
4
3
  typeahead: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LabelsResponse, QueryServiceClient } from '@parca/client';
3
2
  import { Query } from '@parca/parser';
4
3
  interface MatchersInputProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface MetricsCircleProps {
3
2
  cx: number;
4
3
  cy: number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { HighlightedSeries } from '../';
3
2
  interface MetricsContextMenuProps {
4
3
  menuId: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface MetricsInfoPanelProps {
3
2
  isInfoPanelOpen: boolean;
4
3
  onInfoIconClick: () => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { HighlightedSeries } from '../';
3
2
  interface Props {
4
3
  x: number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Label, MetricsSeries as MetricsSeriesPb } from '@parca/client';
3
2
  import { DateTimeRange } from '@parca/components';
4
3
  import { MergedProfileSelection } from '..';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import * as d3 from 'd3';
3
2
  interface MetricsSeriesProps {
4
3
  data: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { QueryServiceClient } from '@parca/client';
3
2
  import type { NavigateFunction } from '@parca/utilities';
4
3
  import { ProfileSelection } from '..';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { QueryServiceClient } from '@parca/client';
3
2
  import type { NavigateFunction } from '@parca/utilities';
4
3
  import { ProfileSelection } from '..';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { QueryServiceClient } from '@parca/client';
3
2
  import { type NavigateFunction } from '@parca/utilities';
4
3
  interface ProfileExplorerProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { NavigateFunction } from '@parca/utilities';
3
2
  interface Props {
4
3
  navigateTo?: NavigateFunction;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Flamegraph } from '@parca/client';
3
2
  import { ProfileType } from '@parca/parser';
4
3
  import { type NavigateFunction } from '@parca/utilities';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Table } from 'apache-arrow';
3
2
  import { ProfileType } from '@parca/parser';
4
3
  import { type NavigateFunction } from '@parca/utilities';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { RpcError } from '@protobuf-ts/runtime-rpc';
3
2
  import { Label, QueryRangeResponse, QueryServiceClient } from '@parca/client';
4
3
  import { DateTimeRange } from '@parca/components';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // Copyright 2022 The Parca Authors
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -17,19 +17,17 @@ import { Duration, Timestamp } from '@parca/client';
17
17
  import { MetricsGraphSkeleton, useGrpcMetadata, useParcaContext, } from '@parca/components';
18
18
  import { Query } from '@parca/parser';
19
19
  import { capitalizeOnlyFirstLetter, getStepDuration } from '@parca/utilities';
20
- import { useLabelNames } from '../MatchersInput';
21
20
  import MetricsGraph from '../MetricsGraph';
22
21
  import { useMetricsGraphDimensions } from '../MetricsGraph/useMetricsGraphDimensions';
23
22
  import useDelayedLoader from '../useDelayedLoader';
24
- import { Toolbar } from './Toolbar';
25
- import { useSumBy } from './useSumBy';
26
23
  const ErrorContent = ({ errorMessage }) => {
27
24
  return (_jsx("div", { className: "relative rounded border border-red-400 bg-red-100 px-4 py-3 text-red-700", role: "alert", children: _jsx("span", { className: "block sm:inline", children: errorMessage }) }));
28
25
  };
29
26
  export const ProfileMetricsEmptyState = ({ message }) => {
30
27
  return (_jsx("div", { className: "flex h-full w-full flex-col items-center justify-center", children: _jsx("p", { children: message }) }));
31
28
  };
32
- export const useQueryRange = (client, queryExpression, start, end, sumBy = [], skip = false) => {
29
+ const EMPTY_SUM_BY = [];
30
+ export const useQueryRange = (client, queryExpression, start, end, sumBy = EMPTY_SUM_BY, skip = false) => {
33
31
  const [isLoading, setLoading] = useState(!skip);
34
32
  const [state, setState] = useState({
35
33
  response: null,
@@ -67,9 +65,7 @@ export const useQueryRange = (client, queryExpression, start, end, sumBy = [], s
67
65
  return { ...state, isLoading };
68
66
  };
69
67
  const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to, setTimeRange, addLabelMatcher, onPointClick, comparing = false, }) => {
70
- const { loading: labelNamesLoading, result: labelNamesResult } = useLabelNames(queryClient, from, to, profile?.ProfileSource()?.ProfileType()?.toString());
71
- const [sumBy, setSumBy] = useSumBy(profile?.ProfileSource()?.ProfileType(), labelNamesResult.response?.labelNames);
72
- const { isLoading, response, error } = useQueryRange(queryClient, queryExpression, from, to, sumBy, labelNamesLoading);
68
+ const { isLoading, response, error } = useQueryRange(queryClient, queryExpression, from, to);
73
69
  const isLoaderVisible = useDelayedLoader(isLoading);
74
70
  const { onError, perf, authenticationErrorMessage, isDarkMode } = useParcaContext();
75
71
  const { width, height, margin, heightStyle } = useMetricsGraphDimensions(comparing);
@@ -86,7 +82,7 @@ const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to,
86
82
  }, [perf, response]);
87
83
  const series = response?.series;
88
84
  const dataAvailable = series !== null && series !== undefined && series?.length > 0;
89
- const metricsGraphLoading = isLoaderVisible || (isLoading && !dataAvailable && !labelNamesLoading);
85
+ const metricsGraphLoading = isLoaderVisible || (isLoading && !dataAvailable);
90
86
  if (metricsGraphLoading) {
91
87
  return _jsx(MetricsGraphSkeleton, { heightStyle: heightStyle, isDarkMode: isDarkMode });
92
88
  }
@@ -96,9 +92,6 @@ const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to,
96
92
  }
97
93
  return _jsx(ErrorContent, { errorMessage: capitalizeOnlyFirstLetter(error.message) });
98
94
  }
99
- if (!labelNamesLoading && labelNamesResult?.error != null) {
100
- return (_jsx(ErrorContent, { errorMessage: capitalizeOnlyFirstLetter(labelNamesResult.error.message) }));
101
- }
102
95
  if (dataAvailable) {
103
96
  const handleSampleClick = (timestamp, _value, labels, duration) => {
104
97
  onPointClick(timestamp, labels, queryExpression, duration);
@@ -110,7 +103,7 @@ const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to,
110
103
  if (sampleUnit === '') {
111
104
  sampleUnit = Query.parse(queryExpression).profileType().sampleUnit;
112
105
  }
113
- return (_jsx(AnimatePresence, { children: _jsxs(motion.div, { className: "h-full w-full relative", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: [_jsx(Toolbar, { sumBy: sumBy, setSumBy: setSumBy, labels: labelNamesResult.response?.labelNames ?? [] }), _jsx(MetricsGraph, { data: series, from: from, to: to, profile: profile, setTimeRange: setTimeRange, onSampleClick: handleSampleClick, addLabelMatcher: addLabelMatcher, sampleUnit: sampleUnit, height: height, width: width, margin: margin })] }, "metrics-graph-loaded") }));
106
+ return (_jsx(AnimatePresence, { children: _jsx(motion.div, { className: "h-full w-full relative", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: _jsx(MetricsGraph, { data: series, from: from, to: to, profile: profile, setTimeRange: setTimeRange, onSampleClick: handleSampleClick, addLabelMatcher: addLabelMatcher, sampleUnit: sampleUnit, height: height, width: width, margin: margin }) }, "metrics-graph-loaded") }));
114
107
  }
115
108
  return _jsx(ProfileMetricsEmptyState, { message: "No data found. Try a different query." });
116
109
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const CompareButton: ({ disabled, onClick, }: {
3
2
  disabled: boolean;
4
3
  onClick: () => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { RpcError } from '@protobuf-ts/runtime-rpc';
3
2
  import { ProfileTypesResponse, QueryServiceClient } from '@parca/client';
4
3
  import { type NavigateFunction } from '@parca/utilities';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ProfileDiffSelection, QueryRequest } from '@parca/client';
3
2
  import { ProfileType, Query } from '@parca/parser';
4
3
  export interface ProfileSource {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { RpcError } from '@protobuf-ts/runtime-rpc';
3
2
  import { ProfileType, ProfileTypesResponse } from '@parca/client';
4
3
  import { type SelectElement } from '@parca/components';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { NavigateFunction } from '@parca/utilities';
3
2
  declare const FilterByFunctionButton: ({ navigateTo, }: {
4
3
  navigateTo: NavigateFunction | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { NavigateFunction } from '@parca/utilities';
3
2
  interface Props {
4
3
  position: number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Callgraph as CallgraphType, Flamegraph, FlamegraphArrow, QueryServiceClient, Source, TableArrow, Top } from '@parca/client';
3
2
  import { ProfileSource } from '../ProfileSource';
4
3
  type NavigateFunction = (path: string, queryParams: any, options?: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { QueryServiceClient } from '@parca/client';
3
2
  import { type NavigateFunction } from '@parca/utilities';
4
3
  import { ProfileSource } from './ProfileSource';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  value: number;
4
3
  isCurrent?: boolean;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const DiffLegend: () => JSX.Element;
3
2
  export default DiffLegend;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  value: string;
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { QueryRequest, QueryServiceClient } from '@parca/client';
3
2
  interface Props {
4
3
  queryRequest: QueryRequest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.394",
3
+ "version": "0.16.395",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@headlessui/react": "^1.7.19",
@@ -73,5 +73,5 @@
73
73
  "access": "public",
74
74
  "registry": "https://registry.npmjs.org/"
75
75
  },
76
- "gitHead": "e31e7af178ad704e179dd20f52ef093b79f7059b"
76
+ "gitHead": "93b2cfe8be8c6ffea045131594c8f6f5784bdfdc"
77
77
  }
@@ -27,12 +27,9 @@ import {Query} from '@parca/parser';
27
27
  import {capitalizeOnlyFirstLetter, getStepDuration} from '@parca/utilities';
28
28
 
29
29
  import {MergedProfileSelection, ProfileSelection} from '..';
30
- import {useLabelNames} from '../MatchersInput';
31
30
  import MetricsGraph from '../MetricsGraph';
32
31
  import {useMetricsGraphDimensions} from '../MetricsGraph/useMetricsGraphDimensions';
33
32
  import useDelayedLoader from '../useDelayedLoader';
34
- import {Toolbar} from './Toolbar';
35
- import {useSumBy} from './useSumBy';
36
33
 
37
34
  interface ProfileMetricsEmptyStateProps {
38
35
  message: string;
@@ -82,12 +79,14 @@ export interface IQueryRangeState {
82
79
  error: RpcError | null;
83
80
  }
84
81
 
82
+ const EMPTY_SUM_BY: string[] = [];
83
+
85
84
  export const useQueryRange = (
86
85
  client: QueryServiceClient,
87
86
  queryExpression: string,
88
87
  start: number,
89
88
  end: number,
90
- sumBy: string[] = [],
89
+ sumBy: string[] = EMPTY_SUM_BY,
91
90
  skip = false
92
91
  ): IQueryRangeState => {
93
92
  const [isLoading, setLoading] = useState<boolean>(!skip);
@@ -145,25 +144,7 @@ const ProfileMetricsGraph = ({
145
144
  onPointClick,
146
145
  comparing = false,
147
146
  }: ProfileMetricsGraphProps): JSX.Element => {
148
- const {loading: labelNamesLoading, result: labelNamesResult} = useLabelNames(
149
- queryClient,
150
- from,
151
- to,
152
- profile?.ProfileSource()?.ProfileType()?.toString()
153
- );
154
- const [sumBy, setSumBy] = useSumBy(
155
- profile?.ProfileSource()?.ProfileType(),
156
- labelNamesResult.response?.labelNames
157
- );
158
-
159
- const {isLoading, response, error} = useQueryRange(
160
- queryClient,
161
- queryExpression,
162
- from,
163
- to,
164
- sumBy,
165
- labelNamesLoading
166
- );
147
+ const {isLoading, response, error} = useQueryRange(queryClient, queryExpression, from, to);
167
148
  const isLoaderVisible = useDelayedLoader(isLoading);
168
149
  const {onError, perf, authenticationErrorMessage, isDarkMode} = useParcaContext();
169
150
  const {width, height, margin, heightStyle} = useMetricsGraphDimensions(comparing);
@@ -185,8 +166,7 @@ const ProfileMetricsGraph = ({
185
166
  const series = response?.series;
186
167
  const dataAvailable = series !== null && series !== undefined && series?.length > 0;
187
168
 
188
- const metricsGraphLoading =
189
- isLoaderVisible || (isLoading && !dataAvailable && !labelNamesLoading);
169
+ const metricsGraphLoading = isLoaderVisible || (isLoading && !dataAvailable);
190
170
 
191
171
  if (metricsGraphLoading) {
192
172
  return <MetricsGraphSkeleton heightStyle={heightStyle} isDarkMode={isDarkMode} />;
@@ -200,12 +180,6 @@ const ProfileMetricsGraph = ({
200
180
  return <ErrorContent errorMessage={capitalizeOnlyFirstLetter(error.message)} />;
201
181
  }
202
182
 
203
- if (!labelNamesLoading && labelNamesResult?.error != null) {
204
- return (
205
- <ErrorContent errorMessage={capitalizeOnlyFirstLetter(labelNamesResult.error.message)} />
206
- );
207
- }
208
-
209
183
  if (dataAvailable) {
210
184
  const handleSampleClick = (
211
185
  timestamp: number,
@@ -233,11 +207,6 @@ const ProfileMetricsGraph = ({
233
207
  animate={{display: 'block', opacity: 1}}
234
208
  transition={{duration: 0.5}}
235
209
  >
236
- <Toolbar
237
- sumBy={sumBy}
238
- setSumBy={setSumBy}
239
- labels={labelNamesResult.response?.labelNames ?? []}
240
- />
241
210
  <MetricsGraph
242
211
  data={series}
243
212
  from={from}