@parca/profile 0.16.363 → 0.16.367

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,22 @@
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.367](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.366...@parca/profile@0.16.367) (2024-05-09)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.366](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.365...@parca/profile@0.16.366) (2024-05-09)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
14
+ ## [0.16.365](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.364...@parca/profile@0.16.365) (2024-05-06)
15
+
16
+ **Note:** Version bump only for package @parca/profile
17
+
18
+ ## [0.16.364](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.363...@parca/profile@0.16.364) (2024-05-01)
19
+
20
+ **Note:** Version bump only for package @parca/profile
21
+
6
22
  ## [0.16.363](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.362...@parca/profile@0.16.363) (2024-05-01)
7
23
 
8
24
  **Note:** Version bump only for package @parca/profile
@@ -2,12 +2,12 @@ import { CallgraphEdge, CallgraphNode } from '@parca/client';
2
2
  export declare const pixelsToInches: (pixels: number) => number;
3
3
  export declare const getCurvePoints: ({ pos, xScale, yScale, source, target, offset, isSelfLoop, }: {
4
4
  pos: string;
5
- xScale?: (pos: number) => number;
6
- yScale?: (pos: number) => number;
7
- source?: number[];
8
- target?: number[];
9
- isSelfLoop?: boolean;
10
- offset?: number;
5
+ xScale?: ((pos: number) => number) | undefined;
6
+ yScale?: ((pos: number) => number) | undefined;
7
+ source?: number[] | undefined;
8
+ target?: number[] | undefined;
9
+ isSelfLoop?: boolean | undefined;
10
+ offset?: number | undefined;
11
11
  }) => number[];
12
12
  export declare const jsonToDot: ({ graph, colorRange, }: {
13
13
  graph: {
@@ -31,11 +31,11 @@ export declare const GraphTooltipContent: ({ hoveringNode, unit, total, totalUnf
31
31
  total: bigint;
32
32
  totalUnfiltered: bigint;
33
33
  isFixed: boolean;
34
- strings?: string[];
35
- mappings?: Mapping[];
36
- locations?: Location[];
37
- functions?: ParcaFunction[];
38
- type?: string;
34
+ strings?: string[] | undefined;
35
+ mappings?: Mapping[] | undefined;
36
+ locations?: Location[] | undefined;
37
+ functions?: ParcaFunction[] | undefined;
38
+ type?: string | undefined;
39
39
  }) => JSX.Element;
40
40
  declare const GraphTooltip: ({ x, y, unit, total, totalUnfiltered, hoveringNode: hoveringNodeProp, contextElement, isFixed, virtualContextElement, strings, mappings, locations, functions, type, }: GraphTooltipProps) => JSX.Element;
41
41
  export default GraphTooltip;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const GroupByDropdown: ({ groupBy, toggleGroupBy, }: {
2
3
  groupBy: string[];
3
4
  toggleGroupBy: (key: string) => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const RuntimeFilterDropdown: ({ showRuntimeRuby, toggleShowRuntimeRuby, showRuntimePython, toggleShowRuntimePython, showInterpretedOnly, toggleShowInterpretedOnly, }: {
2
3
  showRuntimeRuby: boolean;
3
4
  toggleShowRuntimeRuby: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const SortBySelect: ({ sortBy, setSortBy, compareMode, }: {
2
3
  sortBy: string;
3
4
  setSortBy: (key: string) => void;
@@ -62,7 +62,7 @@ const ContextMenu = ({ menuId, table, total, totalUnfiltered, row, level, naviga
62
62
  {
63
63
  id: 'Function system name',
64
64
  value: functionSystemName === functionName ? '' : functionSystemName,
65
- }, // an empty string will be filtered out below
65
+ },
66
66
  { id: 'Cumulative', value: cumulativeText ?? '' },
67
67
  { id: 'Diff', value: diff !== 0n ? diffText : '' },
68
68
  {
@@ -89,6 +89,11 @@ const ProfileIcicleGraph = function ProfileIcicleGraphNonMemo({ graph, arrow, to
89
89
  param: 'sort_by',
90
90
  navigateTo,
91
91
  });
92
+ const [invertStack = '', setInvertStack] = useURLState({
93
+ param: 'invert_call_stack',
94
+ navigateTo,
95
+ });
96
+ const isInvert = invertStack === 'true';
92
97
  const [totalFormatted, totalUnfilteredFormatted, isTrimmed, trimmedFormatted, trimmedPercentage, isFiltered, filteredPercentage,] = useMemo(() => {
93
98
  if (graph === undefined && arrow === undefined) {
94
99
  return ['0', '0', false, '0', '0', false, '0', '0'];
@@ -115,8 +120,18 @@ const ProfileIcicleGraph = function ProfileIcicleGraphNonMemo({ graph, arrow, to
115
120
  if (setActionButtons === undefined) {
116
121
  return;
117
122
  }
118
- setActionButtons(_jsx("div", { className: "flex w-full justify-end gap-2 pb-2", children: _jsxs("div", { className: "ml-2 flex w-full flex-col items-start justify-between gap-2 md:flex-row md:items-end", children: [arrow !== undefined && _jsx(GroupAndSortActionButtons, { navigateTo: navigateTo }), _jsx(ShowHideLegendButton, { isHalfScreen: isHalfScreen, navigateTo: navigateTo }), isHalfScreen ? (_jsx(IconButton, { icon: "system-uicons:reset", disabled: curPath.length === 0, toolTipText: "Reset View", onClick: () => setNewCurPath([]), className: "rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 items-center flex border border-gray-200 dark:border-gray-600 dark:text-white justify-center py-2 px-3 cursor-pointer min-h-[38px]" })) : (_jsxs(Button, { variant: "neutral", className: "gap-2 w-max", onClick: () => setNewCurPath([]), disabled: curPath.length === 0, children: ["Reset View", _jsx(Icon, { icon: "system-uicons:reset", width: 20 })] }))] }) }));
119
- }, [navigateTo, arrow, curPath, setNewCurPath, setActionButtons, loading, isHalfScreen]);
123
+ setActionButtons(_jsx("div", { className: "flex w-full justify-end gap-2 pb-2", children: _jsxs("div", { className: "ml-2 flex w-full flex-col items-start justify-between gap-2 md:flex-row md:items-end", children: [arrow !== undefined && _jsx(GroupAndSortActionButtons, { navigateTo: navigateTo }), isHalfScreen ? (_jsx(IconButton, { icon: isInvert ? 'ph:sort-ascending' : 'ph:sort-descending', toolTipText: isInvert ? 'Original Call Stack' : 'Invert Call Stack', onClick: () => setInvertStack(isInvert ? '' : 'true'), className: "rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 items-center flex border border-gray-200 dark:border-gray-600 dark:text-white justify-center py-2 px-3 cursor-pointer min-h-[38px]" })) : (_jsxs(Button, { variant: "neutral", className: "gap-2 w-max", onClick: () => setInvertStack(isInvert ? '' : 'true'), children: [isInvert ? 'Original Call Stack' : 'Invert Call Stack', _jsx(Icon, { icon: isInvert ? 'ph:sort-ascending' : 'ph:sort-descending', width: 20 })] })), _jsx(ShowHideLegendButton, { isHalfScreen: isHalfScreen, navigateTo: navigateTo }), isHalfScreen ? (_jsx(IconButton, { icon: "system-uicons:reset", disabled: curPath.length === 0, toolTipText: "Reset View", onClick: () => setNewCurPath([]), className: "rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 items-center flex border border-gray-200 dark:border-gray-600 dark:text-white justify-center py-2 px-3 cursor-pointer min-h-[38px]" })) : (_jsxs(Button, { variant: "neutral", className: "gap-2 w-max", onClick: () => setNewCurPath([]), disabled: curPath.length === 0, children: ["Reset View", _jsx(Icon, { icon: "system-uicons:reset", width: 20 })] }))] }) }));
124
+ }, [
125
+ navigateTo,
126
+ isInvert,
127
+ setInvertStack,
128
+ arrow,
129
+ curPath,
130
+ setNewCurPath,
131
+ setActionButtons,
132
+ loading,
133
+ isHalfScreen,
134
+ ]);
120
135
  if (loading) {
121
136
  return (_jsx("div", { className: "h-auto overflow-clip", children: _jsx(IcicleGraphSkeleton, { isHalfScreen: isHalfScreen, isDarkMode: isDarkMode }) }));
122
137
  }
@@ -8,7 +8,7 @@ export declare const defaultValue: Props;
8
8
  declare const ProfileViewContext: import("react").Context<Props>;
9
9
  export declare const ProfileViewContextProvider: ({ children, value, }: {
10
10
  children: ReactNode;
11
- value?: Props;
11
+ value?: Props | undefined;
12
12
  }) => JSX.Element;
13
13
  export declare const useProfileViewContext: () => Props;
14
14
  export default ProfileViewContext;
@@ -1,4 +1,4 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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.
@@ -34,13 +34,10 @@ const ViewSelector = ({ defaultValue, navigateTo, position, placeholderText, pri
34
34
  });
35
35
  }
36
36
  const getOption = ({ key, supportingText, }) => {
37
- const capitalizeFirstLetter = (string) => {
38
- return `${string.charAt(0).toUpperCase()}${string.slice(1)}`;
39
- };
40
- const title = capitalizeFirstLetter(key);
37
+ const title = _jsx("span", { className: "capitalize", children: key.replaceAll('-', ' ') });
41
38
  return {
42
- active: _jsx(_Fragment, { children: title }),
43
- expanded: (_jsxs(_Fragment, { children: [_jsx("span", { children: title }), supportingText !== null && _jsx("span", { className: "text-xs", children: supportingText })] })),
39
+ active: title,
40
+ expanded: (_jsxs(_Fragment, { children: [title, supportingText !== null && _jsx("span", { className: "text-xs", children: supportingText })] })),
44
41
  };
45
42
  };
46
43
  const items = allItems.map(item => ({
@@ -31,6 +31,8 @@ export const ProfileViewWithData = ({ queryClient, profileSource, navigateTo, })
31
31
  const showRuntimePython = showRuntimePythonStr === 'true';
32
32
  const [showInterpretedOnlyStr] = useURLState({ param: 'show_interpreted_only', navigateTo });
33
33
  const showInterpretedOnly = showInterpretedOnlyStr === 'true';
34
+ const [invertStack] = useURLState({ param: 'invert_call_stack', navigateTo });
35
+ const invertCallStack = invertStack === 'true';
34
36
  const [pprofDownloading, setPprofDownloading] = useState(false);
35
37
  const nodeTrimThreshold = useMemo(() => {
36
38
  let width =
@@ -49,6 +51,7 @@ export const ProfileViewWithData = ({ queryClient, profileSource, navigateTo, })
49
51
  showRuntimeRuby,
50
52
  showRuntimePython,
51
53
  showInterpretedOnly,
54
+ invertCallStack,
52
55
  });
53
56
  const { perf } = useParcaContext();
54
57
  const { isLoading: tableLoading, response: tableResponse, error: tableError, } = useQuery(queryClient, profileSource, QueryRequest_ReportType.TABLE_ARROW, {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type VisibilityState } from '@tanstack/react-table';
2
3
  import { ColumnDef } from '.';
3
4
  declare const ColumnsVisibility: ({ columns, visibility, setVisibility, }: {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Props as CallgraphProps } from '@parca/profile/src/Callgraph';
1
+ import type { Props as CallgraphProps } from './Callgraph';
2
2
  import ProfileExplorer from './ProfileExplorer';
3
3
  import ProfileTypeSelector from './ProfileTypeSelector';
4
4
  export * from './ProfileIcicleGraph/IcicleGraph';
@@ -8,5 +8,5 @@ interface Props<IRes> {
8
8
  retry?: number | boolean;
9
9
  };
10
10
  }
11
- declare const useGrpcQuery: <IRes>({ key, queryFn, options: { enabled, staleTime, retry }, }: Props<IRes>) => UseQueryResult<IRes>;
11
+ declare const useGrpcQuery: <IRes>({ key, queryFn, options: { enabled, staleTime, retry }, }: Props<IRes>) => UseQueryResult<IRes, unknown>;
12
12
  export default useGrpcQuery;
@@ -16,6 +16,7 @@ interface UseQueryOptions {
16
16
  showRuntimeRuby?: boolean;
17
17
  showRuntimePython?: boolean;
18
18
  showInterpretedOnly?: boolean;
19
+ invertCallStack?: boolean;
19
20
  }
20
21
  export declare const useQuery: (client: QueryServiceClient, profileSource: ProfileSource, reportType: QueryRequest_ReportType, options?: UseQueryOptions) => IQueryResult;
21
22
  export {};
package/dist/useQuery.js CHANGED
@@ -28,6 +28,7 @@ export const useQuery = (client, profileSource, reportType, options) => {
28
28
  options?.showRuntimeRuby ?? false,
29
29
  options?.showRuntimePython ?? false,
30
30
  options?.showInterpretedOnly ?? false,
31
+ options?.invertCallStack ?? false,
31
32
  ],
32
33
  queryFn: async () => {
33
34
  const req = profileSource.QueryRequest();
@@ -48,6 +49,7 @@ export const useQuery = (client, profileSource, reportType, options) => {
48
49
  showPython: options?.showRuntimePython ?? false,
49
50
  showInterpretedOnly: options?.showInterpretedOnly ?? false,
50
51
  };
52
+ req.invertCallStack = options?.invertCallStack ?? false;
51
53
  try {
52
54
  const { response } = await client.query(req, { meta: metadata });
53
55
  return response;
package/package.json CHANGED
@@ -1,46 +1,67 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.363",
3
+ "version": "0.16.367",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
- "@parca/client": "^0.16.107",
7
- "@parca/components": "^0.16.268",
8
- "@parca/dynamicsize": "^0.16.61",
9
- "@parca/hooks": "^0.0.48",
10
- "@parca/parser": "^0.16.69",
11
- "@parca/store": "^0.16.137",
12
- "@parca/utilities": "^0.0.65",
6
+ "@headlessui/react": "^1.7.19",
7
+ "@iconify/react": "^4.0.0",
8
+ "@parca/client": "^0.16.111",
9
+ "@parca/components": "^0.16.272",
10
+ "@parca/dynamicsize": "^0.16.63",
11
+ "@parca/hooks": "^0.0.52",
12
+ "@parca/icons": "^0.16.67",
13
+ "@parca/parser": "^0.16.72",
14
+ "@parca/store": "^0.16.141",
15
+ "@parca/utilities": "^0.0.69",
16
+ "@popperjs/core": "^2.11.8",
17
+ "@protobuf-ts/runtime-rpc": "^2.5.0",
13
18
  "@tanstack/react-query": "^4.0.5",
19
+ "@tanstack/react-table": "^8.16.0",
20
+ "@tanstack/table-core": "^8.16.0",
21
+ "@types/d3": "^7.4.3",
22
+ "@types/d3-scale": "^4.0.8",
23
+ "@types/d3-selection": "^3.0.10",
14
24
  "@types/react-beautiful-dnd": "^13.1.8",
15
- "apache-arrow": "^12.0.0",
25
+ "apache-arrow": "^12.0.1",
26
+ "classnames": "^2.3.1",
16
27
  "d3": "7.9.0",
28
+ "d3-array": "^3.2.4",
29
+ "d3-color": "^3.1.0",
17
30
  "d3-scale": "^4.0.2",
31
+ "d3-scale-chromatic": "^3.1.0",
18
32
  "d3-selection": "3.0.0",
19
- "framer-motion": "^10.18.0",
33
+ "d3-shape": "^3.2.0",
34
+ "framer-motion": "6.5.1",
20
35
  "graphviz-wasm": "3.0.2",
36
+ "lodash.throttle": "^4.1.1",
37
+ "react": "18.3.1",
21
38
  "react-beautiful-dnd": "^13.1.1",
22
39
  "react-contexify": "^6.0.0",
40
+ "react-dom": "18.3.1",
23
41
  "react-flame-graph": "^1.4.0",
24
42
  "react-inlinesvg": "^3.0.2",
25
43
  "react-map-interaction": "^2.1.0",
44
+ "react-popper": "^2.3.0",
45
+ "react-redux": "^8.0.2",
26
46
  "react-syntax-highlighter": "^15.5.0",
27
47
  "react-textarea-autosize": "^8.4.0",
48
+ "react-tooltip": "^5.26.3",
49
+ "react-use": "^17.5.0",
50
+ "tailwindcss": "3.2.4",
51
+ "tsc-watch": "6.2.0",
28
52
  "with-alpha-hex": "^1.0.6"
29
53
  },
30
54
  "devDependencies": {
31
- "@types/d3": "7.4.3",
55
+ "@types/lodash.throttle": "4.1.9",
32
56
  "@types/react-syntax-highlighter": "15.5.11"
33
57
  },
34
- "resolutions": {
35
- "konva": "8.4.3"
36
- },
37
58
  "main": "dist/index.js",
38
59
  "scripts": {
39
60
  "test": "jest --coverage --config ../../../jest.config.js ./src/*",
40
- "prepublish": "yarn build",
41
- "build": "tsc && yarn compile:styles",
42
- "build-swc": "swc ./src -d dist --copy-files && yarn compile:styles",
43
- "watch": "tsc-watch --onCompilationComplete 'yarn compile:styles'",
61
+ "prepublish": "pnpm run build",
62
+ "build": "tsc && pnpm run compile:styles",
63
+ "build-swc": "swc ./src -d dist --copy-files && pnpm run compile:styles",
64
+ "watch": "tsc-watch --onCompilationComplete 'pnpm run compile:styles'",
44
65
  "compile:styles": "tailwindcss -o dist/styles.css --minify"
45
66
  },
46
67
  "keywords": [],
@@ -50,5 +71,5 @@
50
71
  "access": "public",
51
72
  "registry": "https://registry.npmjs.org/"
52
73
  },
53
- "gitHead": "28b15f3a6d24e2e47913e38a8a76a1d5704887b1"
74
+ "gitHead": "9e4b06ff8644fc74a98055e77b96f3d8e2d04278"
54
75
  }