@parca/profile 0.16.155 → 0.16.156

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,12 @@
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.156 (2023-03-29)
7
+
8
+ # 0.17.0 (2023-03-29)
9
+
10
+ **Note:** Version bump only for package @parca/profile
11
+
6
12
  ## [0.16.155](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.154...@parca/profile@0.16.155) (2023-03-28)
7
13
 
8
14
  **Note:** Version bump only for package @parca/profile
@@ -15,14 +15,20 @@ export interface FlamegraphData {
15
15
  export interface TopTableData {
16
16
  loading: boolean;
17
17
  data?: Top;
18
+ total?: bigint;
19
+ filtered?: bigint;
18
20
  error?: any;
19
21
  }
20
22
  interface CallgraphData {
21
23
  loading: boolean;
22
24
  data?: CallgraphType;
25
+ total?: bigint;
26
+ filtered?: bigint;
23
27
  error?: any;
24
28
  }
25
29
  export interface ProfileViewProps {
30
+ total: bigint;
31
+ filtered: bigint;
26
32
  flamegraphData?: FlamegraphData;
27
33
  topTableData?: TopTableData;
28
34
  callgraphData?: CallgraphData;
@@ -34,5 +40,5 @@ export interface ProfileViewProps {
34
40
  onDownloadPProf: () => void;
35
41
  onFlamegraphContainerResize?: ResizeHandler;
36
42
  }
37
- export declare const ProfileView: ({ flamegraphData, topTableData, callgraphData, sampleUnit, profileSource, queryClient, navigateTo, onDownloadPProf, onFlamegraphContainerResize, }: ProfileViewProps) => JSX.Element;
43
+ export declare const ProfileView: ({ total, filtered, flamegraphData, topTableData, callgraphData, sampleUnit, profileSource, queryClient, navigateTo, onDownloadPProf, onFlamegraphContainerResize, }: ProfileViewProps) => JSX.Element;
38
44
  export {};
@@ -93,7 +93,7 @@ function arrayEquals(a, b) {
93
93
  a.every(function (val, index) { return val === b[index]; }));
94
94
  }
95
95
  export var ProfileView = function (_a) {
96
- var flamegraphData = _a.flamegraphData, topTableData = _a.topTableData, callgraphData = _a.callgraphData, sampleUnit = _a.sampleUnit, profileSource = _a.profileSource, queryClient = _a.queryClient, navigateTo = _a.navigateTo, onDownloadPProf = _a.onDownloadPProf, onFlamegraphContainerResize = _a.onFlamegraphContainerResize;
96
+ var total = _a.total, filtered = _a.filtered, flamegraphData = _a.flamegraphData, topTableData = _a.topTableData, callgraphData = _a.callgraphData, sampleUnit = _a.sampleUnit, profileSource = _a.profileSource, queryClient = _a.queryClient, navigateTo = _a.navigateTo, onDownloadPProf = _a.onDownloadPProf, onFlamegraphContainerResize = _a.onFlamegraphContainerResize;
97
97
  var _b = useContainerDimensions(), ref = _b.ref, dimensions = _b.dimensions;
98
98
  var _c = useState([]), curPath = _c[0], setCurPath = _c[1];
99
99
  var _d = useURLState({
@@ -202,14 +202,13 @@ export var ProfileView = function (_a) {
202
202
  }
203
203
  };
204
204
  var getDashboardItemByType = function (_a) {
205
- var _b, _c;
206
205
  var type = _a.type, isHalfScreen = _a.isHalfScreen, setActionButtons = _a.setActionButtons;
207
206
  switch (type) {
208
207
  case 'icicle': {
209
208
  return (flamegraphData === null || flamegraphData === void 0 ? void 0 : flamegraphData.data) != null ? (_jsx(ConditionalWrapper, __assign({ condition: (perf === null || perf === void 0 ? void 0 : perf.onRender) != null, WrapperComponent: Profiler, wrapperProps: {
210
209
  id: 'icicleGraph',
211
210
  onRender: perf === null || perf === void 0 ? void 0 : perf.onRender,
212
- } }, { children: _jsx(ProfileIcicleGraph, { curPath: curPath, setNewCurPath: setNewCurPath, graph: flamegraphData.data, total: (_b = Number(flamegraphData.total)) !== null && _b !== void 0 ? _b : 0, filtered: (_c = Number(flamegraphData === null || flamegraphData === void 0 ? void 0 : flamegraphData.filtered)) !== null && _c !== void 0 ? _c : 0, sampleUnit: sampleUnit, onContainerResize: onFlamegraphContainerResize, navigateTo: navigateTo, loading: flamegraphData.loading, setActionButtons: setActionButtons }) }))) : (_jsx(_Fragment, { children: " " }));
211
+ } }, { children: _jsx(ProfileIcicleGraph, { curPath: curPath, setNewCurPath: setNewCurPath, graph: flamegraphData.data, total: Number(total), filtered: Number(filtered), sampleUnit: sampleUnit, onContainerResize: onFlamegraphContainerResize, navigateTo: navigateTo, loading: flamegraphData.loading, setActionButtons: setActionButtons }) }))) : (_jsx(_Fragment, { children: " " }));
213
212
  }
214
213
  case 'callgraph': {
215
214
  return (callgraphData === null || callgraphData === void 0 ? void 0 : callgraphData.data) !== undefined &&
@@ -133,7 +133,23 @@ export var ProfileViewWithData = function (_a) {
133
133
  }
134
134
  });
135
135
  }); };
136
- return (_jsx(ProfileView, { flamegraphData: {
136
+ // TODO: Refactor how we get responses such that we have a single response,
137
+ // regardless of the report type.
138
+ var total = BigInt(0);
139
+ var filtered = BigInt(0);
140
+ if (flamegraphResponse !== null) {
141
+ total = BigInt(flamegraphResponse.total);
142
+ filtered = BigInt(flamegraphResponse.filtered);
143
+ }
144
+ else if (topTableResponse !== null) {
145
+ total = BigInt(topTableResponse.total);
146
+ filtered = BigInt(topTableResponse.filtered);
147
+ }
148
+ else if (callgraphResponse !== null) {
149
+ total = BigInt(callgraphResponse.total);
150
+ filtered = BigInt(callgraphResponse.filtered);
151
+ }
152
+ return (_jsx(ProfileView, { total: total, filtered: filtered, flamegraphData: {
137
153
  loading: flamegraphLoading,
138
154
  data: (flamegraphResponse === null || flamegraphResponse === void 0 ? void 0 : flamegraphResponse.report.oneofKind) === 'flamegraph'
139
155
  ? (_b = flamegraphResponse === null || flamegraphResponse === void 0 ? void 0 : flamegraphResponse.report) === null || _b === void 0 ? void 0 : _b.flamegraph
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.155",
3
+ "version": "0.16.156",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.70",
@@ -46,5 +46,5 @@
46
46
  "access": "public",
47
47
  "registry": "https://registry.npmjs.org/"
48
48
  },
49
- "gitHead": "faeaf9b3126c2de1a982740d711eaf0162557d9a"
49
+ "gitHead": "d02246e4dc7e363e8921336fc3e49a64de0f6336"
50
50
  }
@@ -61,16 +61,22 @@ export interface FlamegraphData {
61
61
  export interface TopTableData {
62
62
  loading: boolean;
63
63
  data?: Top;
64
+ total?: bigint;
65
+ filtered?: bigint;
64
66
  error?: any;
65
67
  }
66
68
 
67
69
  interface CallgraphData {
68
70
  loading: boolean;
69
71
  data?: CallgraphType;
72
+ total?: bigint;
73
+ filtered?: bigint;
70
74
  error?: any;
71
75
  }
72
76
 
73
77
  export interface ProfileViewProps {
78
+ total: bigint;
79
+ filtered: bigint;
74
80
  flamegraphData?: FlamegraphData;
75
81
  topTableData?: TopTableData;
76
82
  callgraphData?: CallgraphData;
@@ -93,6 +99,8 @@ function arrayEquals<T>(a: T[], b: T[]): boolean {
93
99
  }
94
100
 
95
101
  export const ProfileView = ({
102
+ total,
103
+ filtered,
96
104
  flamegraphData,
97
105
  topTableData,
98
106
  callgraphData,
@@ -235,8 +243,8 @@ export const ProfileView = ({
235
243
  curPath={curPath}
236
244
  setNewCurPath={setNewCurPath}
237
245
  graph={flamegraphData.data}
238
- total={Number(flamegraphData.total) ?? 0}
239
- filtered={Number(flamegraphData?.filtered) ?? 0}
246
+ total={Number(total)}
247
+ filtered={Number(filtered)}
240
248
  sampleUnit={sampleUnit}
241
249
  onContainerResize={onFlamegraphContainerResize}
242
250
  navigateTo={navigateTo}
@@ -120,8 +120,25 @@ export const ProfileViewWithData = ({
120
120
  }
121
121
  };
122
122
 
123
+ // TODO: Refactor how we get responses such that we have a single response,
124
+ // regardless of the report type.
125
+ let total = BigInt(0);
126
+ let filtered = BigInt(0);
127
+ if (flamegraphResponse !== null) {
128
+ total = BigInt(flamegraphResponse.total);
129
+ filtered = BigInt(flamegraphResponse.filtered);
130
+ } else if (topTableResponse !== null) {
131
+ total = BigInt(topTableResponse.total);
132
+ filtered = BigInt(topTableResponse.filtered);
133
+ } else if (callgraphResponse !== null) {
134
+ total = BigInt(callgraphResponse.total);
135
+ filtered = BigInt(callgraphResponse.filtered);
136
+ }
137
+
123
138
  return (
124
139
  <ProfileView
140
+ total={total}
141
+ filtered={filtered}
125
142
  flamegraphData={{
126
143
  loading: flamegraphLoading,
127
144
  data: