@parca/profile 0.16.57 → 0.16.59

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.59](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.58...@parca/profile@0.16.59) (2022-11-03)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.58](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.57...@parca/profile@0.16.58) (2022-11-02)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.57](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.56...@parca/profile@0.16.57) (2022-11-02)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface IEdge {
2
3
  source: number;
3
4
  target: number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface INode {
2
3
  id: number;
3
4
  x: number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Callgraph as CallgraphType } from '@parca/client';
2
3
  export interface Props {
3
4
  graph: CallgraphType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CallgraphNode, FlamegraphNode, FlamegraphNodeMeta, FlamegraphRootNode } from '@parca/client';
2
3
  import { Function, Location, Mapping } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
3
4
  interface GraphTooltipProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Flamegraph, FlamegraphNode, FlamegraphRootNode } from '@parca/client';
2
3
  import { Mapping, Function, Location } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
3
4
  interface IcicleGraphProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Query } from '@parca/parser';
2
3
  import { LabelsResponse, QueryServiceClient, ValuesResponse } from '@parca/client';
3
4
  interface MatchersInputProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface MetricsCircleProps {
2
3
  cx: number;
3
4
  cy: number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SingleProfileSelection } from '..';
2
3
  import { MetricsSeries as MetricsSeriesPb, Label } from '@parca/client';
3
4
  import { DateTimeRange } from '@parca/components';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as d3 from 'd3';
2
3
  interface MetricsSeriesProps {
3
4
  data: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ProfileSelection } from '..';
2
3
  import { QueryServiceClient } from '@parca/client';
3
4
  import { NavigateFunction } from '.';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { QueryServiceClient } from '@parca/client';
2
3
  import { ProfileSelection } from '..';
3
4
  import { NavigateFunction } from '../ProfileExplorer';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { QueryServiceClient } from '@parca/client';
2
3
  export declare type NavigateFunction = (path: string, queryParams: any) => void;
3
4
  interface ProfileExplorerProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Flamegraph } from '@parca/client';
2
3
  interface ProfileIcicleGraphProps {
3
4
  width?: number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ProfileSelection } from '..';
2
3
  import { QueryServiceClient, QueryRangeResponse } from '@parca/client';
3
4
  import { RpcError } from '@protobuf-ts/runtime-rpc';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const CompareButton: ({ disabled, onClick, }: {
2
3
  disabled: boolean;
3
4
  onClick: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const MergeButton: ({ disabled, onClick, }: {
2
3
  disabled: boolean;
3
4
  onClick: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { QueryServiceClient, ProfileTypesResponse } from '@parca/client';
2
3
  import { RpcError } from '@protobuf-ts/runtime-rpc';
3
4
  import { ProfileSelection } from '..';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ProfileType } from '@parca/parser';
2
3
  import { Label, QueryRequest, ProfileDiffSelection } from '@parca/client';
3
4
  export interface ProfileSource {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ProfileType, ProfileTypesResponse } from '@parca/client';
2
3
  import { RpcError } from '@protobuf-ts/runtime-rpc';
3
4
  interface WellKnownProfile {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { QueryServiceClient, Flamegraph, Top, Callgraph } from '@parca/client';
2
3
  import { ProfileSource } from './ProfileSource';
3
4
  import './ProfileView.styles.css';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { QueryServiceClient } from '@parca/client';
2
3
  import { ProfileSource } from './ProfileSource';
3
4
  declare type NavigateFunction = (path: string, queryParams: any) => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { TopNodeMeta, Top } from '@parca/client';
2
3
  import './TopTable.styles.css';
3
4
  interface TopTableProps {
package/dist/TopTable.js CHANGED
@@ -33,7 +33,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
33
33
  // limitations under the License.
34
34
  import React from 'react';
35
35
  import { getLastItem, valueFormatter, isSearchMatch } from '@parca/functions';
36
- import { useAppSelector, selectCompareMode, selectSearchNodeString } from '@parca/store';
36
+ import { useAppSelector, selectCompareMode, selectSearchNodeString, setSearchNodeString, useAppDispatch, } from '@parca/store';
37
37
  import { hexifyAddress } from './utils';
38
38
  import './TopTable.styles.css';
39
39
  var Arrow = function (_a) {
@@ -110,6 +110,7 @@ export var TopTable = function (_a) {
110
110
  var _f = useSortableData(top), items = _f.items, requestSort = _f.requestSort, sortConfig = _f.sortConfig;
111
111
  var currentSearchString = useAppSelector(selectSearchNodeString);
112
112
  var compareMode = useAppSelector(selectCompareMode);
113
+ var dispatch = useAppDispatch();
113
114
  var unit = sampleUnit;
114
115
  var total = top != null ? top.list.length : 0;
115
116
  if (total === 0)
@@ -126,15 +127,18 @@ export var TopTable = function (_a) {
126
127
  }
127
128
  return "+".concat(num);
128
129
  };
129
- return (_jsx(_Fragment, { children: _jsx("div", __assign({ className: "w-full font-robotoMono" }, { children: _jsxs("table", __assign({ className: "iciclegraph-table table-fixed text-left w-full divide-y divide-gray-200 dark:divide-gray-700" }, { children: [_jsx("thead", __assign({ className: "bg-gray-50 dark:bg-gray-800" }, { children: _jsxs("tr", { children: [_jsxs("th", __assign({ className: "text-sm cursor-pointer pt-2 pb-2 pl-2", onClick: function () { return requestSort('name'); } }, { children: ["Name", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_b = getClassNamesFor('name')) !== null && _b !== void 0 ? _b : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('name') }) }))] })), _jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 w-[150px]", onClick: function () { return requestSort('flat'); } }, { children: ["Flat", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_c = getClassNamesFor('flat')) !== null && _c !== void 0 ? _c : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('flat') }) }))] })), _jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 pr-2 w-[150px]", onClick: function () { return requestSort('cumulative'); } }, { children: ["Cumulative", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_d = getClassNamesFor('cumulative')) !== null && _d !== void 0 ? _d : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('cumulative') }) }))] })), compareMode && (_jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 pr-2 w-[150px]", onClick: function () { return requestSort('diff'); } }, { children: ["Diff", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_e = getClassNamesFor('diff')) !== null && _e !== void 0 ? _e : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('diff') }) }))] })))] }) })), _jsx("tbody", __assign({ className: "bg-white divide-y divide-gray-200 dark:bg-gray-900 dark:divide-gray-700" }, { children: items === null || items === void 0 ? void 0 : items.map(function (report, index) {
130
+ var selectSpan = function (span) {
131
+ dispatch(setSearchNodeString(span.trim()));
132
+ };
133
+ return (_jsx(_Fragment, { children: _jsx("div", __assign({ className: "w-full font-robotoMono" }, { children: _jsxs("table", __assign({ className: "iciclegraph-table table-fixed text-left w-full divide-y divide-gray-200 dark:divide-gray-700", tabIndex: 1 }, { children: [_jsx("thead", __assign({ className: "bg-gray-50 dark:bg-gray-800" }, { children: _jsxs("tr", { children: [_jsxs("th", __assign({ className: "text-sm cursor-pointer pt-2 pb-2 pl-2", onClick: function () { return requestSort('name'); } }, { children: ["Name", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_b = getClassNamesFor('name')) !== null && _b !== void 0 ? _b : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('name') }) }))] })), _jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 w-[150px]", onClick: function () { return requestSort('flat'); } }, { children: ["Flat", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_c = getClassNamesFor('flat')) !== null && _c !== void 0 ? _c : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('flat') }) }))] })), _jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 pr-2 w-[150px]", onClick: function () { return requestSort('cumulative'); } }, { children: ["Cumulative", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_d = getClassNamesFor('cumulative')) !== null && _d !== void 0 ? _d : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('cumulative') }) }))] })), compareMode && (_jsxs("th", __assign({ className: "text-right text-sm cursor-pointer pt-2 pb-2 pr-2 w-[150px]", onClick: function () { return requestSort('diff'); } }, { children: ["Diff", _jsx("span", __assign({ className: "inline-block align-middle ml-2 ".concat((_e = getClassNamesFor('diff')) !== null && _e !== void 0 ? _e : '') }, { children: _jsx(Arrow, { direction: getClassNamesFor('diff') }) }))] })))] }) })), _jsx("tbody", __assign({ className: "bg-white divide-y divide-gray-200 dark:bg-gray-900 dark:divide-gray-700" }, { children: items === null || items === void 0 ? void 0 : items.map(function (report, index) {
130
134
  var name = RowLabel(report.meta);
131
- return (_jsxs("tr", __assign({ className: "hover:bg-[#62626212] dark:hover:bg-[#ffffff12]", style: {
135
+ return (_jsxs("tr", __assign({ className: "hover:bg-[#62626212] dark:hover:bg-[#ffffff12] cursor-pointer", style: {
132
136
  opacity: currentSearchString !== undefined &&
133
137
  currentSearchString !== '' &&
134
138
  !isSearchMatch(currentSearchString, name)
135
139
  ? 0.5
136
140
  : 1,
137
- } }, { children: [_jsx("td", __assign({ className: "text-xs py-1.5 pl-2" }, { children: name })), _jsx("td", __assign({ className: "text-xs py-1.5 text-right" }, { children: valueFormatter(report.flat, unit, 2) })), _jsx("td", __assign({ className: "text-xs py-1.5 text-right pr-2" }, { children: valueFormatter(report.cumulative, unit, 2) })), compareMode && (_jsx("td", __assign({ className: "text-xs py-1.5 text-right pr-2" }, { children: addPlusSign(valueFormatter(report.diff, unit, 2)) })))] }), index));
141
+ }, onClick: function () { return selectSpan(name); } }, { children: [_jsx("td", __assign({ className: "text-xs py-1.5 pl-2" }, { children: name })), _jsx("td", __assign({ className: "text-xs py-1.5 text-right" }, { children: valueFormatter(report.flat, unit, 2) })), _jsx("td", __assign({ className: "text-xs py-1.5 text-right pr-2" }, { children: valueFormatter(report.cumulative, unit, 2) })), compareMode && (_jsx("td", __assign({ className: "text-xs py-1.5 text-right pr-2" }, { children: addPlusSign(valueFormatter(report.diff, unit, 2)) })))] }), index));
138
142
  }) }))] })) })) }));
139
143
  };
140
144
  export default TopTable;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const DiffLegend: () => JSX.Element;
2
3
  export default DiffLegend;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props {
2
3
  value: string;
3
4
  className?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { QueryRequest, QueryServiceClient } from '@parca/client';
2
3
  interface Props {
3
4
  queryRequest: QueryRequest;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.57",
3
+ "version": "0.16.59",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@iconify/react": "^3.2.2",
7
7
  "@parca/client": "^0.16.53",
8
- "@parca/components": "^0.16.54",
8
+ "@parca/components": "^0.16.55",
9
9
  "@parca/dynamicsize": "^0.16.51",
10
10
  "@parca/functions": "^0.16.51",
11
11
  "@parca/parser": "^0.16.49",
@@ -39,5 +39,5 @@
39
39
  "access": "public",
40
40
  "registry": "https://registry.npmjs.org/"
41
41
  },
42
- "gitHead": "4a84ba064260df403f1b84ae72737744d11ceafd"
42
+ "gitHead": "d1389b648874097c3eeb9143c94469847fedede2"
43
43
  }
package/src/TopTable.tsx CHANGED
@@ -14,7 +14,13 @@
14
14
  import React from 'react';
15
15
 
16
16
  import {getLastItem, valueFormatter, isSearchMatch} from '@parca/functions';
17
- import {useAppSelector, selectCompareMode, selectSearchNodeString} from '@parca/store';
17
+ import {
18
+ useAppSelector,
19
+ selectCompareMode,
20
+ selectSearchNodeString,
21
+ setSearchNodeString,
22
+ useAppDispatch,
23
+ } from '@parca/store';
18
24
  import {TopNode, TopNodeMeta, Top} from '@parca/client';
19
25
 
20
26
  import {hexifyAddress} from './utils';
@@ -136,8 +142,8 @@ export const RowLabel = (meta: TopNodeMeta | undefined): string => {
136
142
  export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element => {
137
143
  const {items, requestSort, sortConfig} = useSortableData(top);
138
144
  const currentSearchString = useAppSelector(selectSearchNodeString);
139
-
140
145
  const compareMode = useAppSelector(selectCompareMode);
146
+ const dispatch = useAppDispatch();
141
147
 
142
148
  const unit = sampleUnit;
143
149
 
@@ -159,10 +165,17 @@ export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element =>
159
165
  return `+${num}`;
160
166
  };
161
167
 
168
+ const selectSpan = (span: string): void => {
169
+ dispatch(setSearchNodeString(span.trim()));
170
+ };
171
+
162
172
  return (
163
173
  <>
164
174
  <div className="w-full font-robotoMono">
165
- <table className="iciclegraph-table table-fixed text-left w-full divide-y divide-gray-200 dark:divide-gray-700">
175
+ <table
176
+ className="iciclegraph-table table-fixed text-left w-full divide-y divide-gray-200 dark:divide-gray-700"
177
+ tabIndex={1}
178
+ >
166
179
  <thead className="bg-gray-50 dark:bg-gray-800">
167
180
  <tr>
168
181
  <th
@@ -221,7 +234,7 @@ export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element =>
221
234
  return (
222
235
  <tr
223
236
  key={index}
224
- className="hover:bg-[#62626212] dark:hover:bg-[#ffffff12]"
237
+ className="hover:bg-[#62626212] dark:hover:bg-[#ffffff12] cursor-pointer"
225
238
  style={{
226
239
  opacity:
227
240
  currentSearchString !== undefined &&
@@ -230,6 +243,7 @@ export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element =>
230
243
  ? 0.5
231
244
  : 1,
232
245
  }}
246
+ onClick={() => selectSpan(name)}
233
247
  >
234
248
  <td className="text-xs py-1.5 pl-2">{name}</td>
235
249
  <td className="text-xs py-1.5 text-right">