@parca/profile 0.16.138 → 0.16.140

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.140](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.139...@parca/profile@0.16.140) (2023-03-16)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.139](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.138...@parca/profile@0.16.139) (2023-03-16)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## 0.16.138 (2023-03-16)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -102,12 +102,18 @@ var ProfileMetricsGraph = function (_a) {
102
102
  var queryClient = _a.queryClient, queryExpression = _a.queryExpression, profile = _a.profile, from = _a.from, to = _a.to, setTimeRange = _a.setTimeRange, addLabelMatcher = _a.addLabelMatcher, onPointClick = _a.onPointClick;
103
103
  var _b = useQueryRange(queryClient, queryExpression, from, to), isLoading = _b.isLoading, response = _b.response, error = _b.error;
104
104
  var isLoaderVisible = useDelayedLoader(isLoading);
105
- var _c = useParcaContext(), loader = _c.loader, onError = _c.onError;
105
+ var _c = useParcaContext(), loader = _c.loader, onError = _c.onError, perf = _c.perf;
106
106
  useEffect(function () {
107
107
  if (error !== null) {
108
108
  onError === null || onError === void 0 ? void 0 : onError(error, 'metricsGraph');
109
109
  }
110
110
  }, [error, onError]);
111
+ useEffect(function () {
112
+ if (response === null) {
113
+ return;
114
+ }
115
+ perf === null || perf === void 0 ? void 0 : perf.markInteraction('Metrics graph render', response.series[0].samples.length);
116
+ }, [perf, response]);
111
117
  if (isLoaderVisible) {
112
118
  return _jsx(_Fragment, { children: loader });
113
119
  }
@@ -82,22 +82,32 @@ export var ProfileViewWithData = function (_a) {
82
82
  nodeTrimThreshold: nodeTrimThreshold,
83
83
  }), flamegraphLoading = _e.isLoading, flamegraphResponse = _e.response, flamegraphError = _e.error;
84
84
  var perf = useParcaContext().perf;
85
- useEffect(function () {
86
- var _a;
87
- if (flamegraphLoading) {
88
- return;
89
- }
90
- if ((flamegraphResponse === null || flamegraphResponse === void 0 ? void 0 : flamegraphResponse.report.oneofKind) !== 'flamegraph') {
91
- return;
92
- }
93
- perf === null || perf === void 0 ? void 0 : perf.markInteraction('Flamegraph Render', (_a = flamegraphResponse === null || flamegraphResponse === void 0 ? void 0 : flamegraphResponse.report) === null || _a === void 0 ? void 0 : _a.flamegraph.total);
94
- }, [flamegraphLoading, flamegraphResponse, perf]);
95
85
  var _f = useQuery(queryClient, profileSource, QueryRequest_ReportType.TOP, {
96
86
  skip: !dashboardItems.includes('table'),
97
87
  }), topTableLoading = _f.isLoading, topTableResponse = _f.response, topTableError = _f.error;
98
88
  var _g = useQuery(queryClient, profileSource, QueryRequest_ReportType.CALLGRAPH, {
99
89
  skip: !dashboardItems.includes('callgraph'),
100
90
  }), callgraphLoading = _g.isLoading, callgraphResponse = _g.response, callgraphError = _g.error;
91
+ useEffect(function () {
92
+ var _a, _b;
93
+ if (!flamegraphLoading && (flamegraphResponse === null || flamegraphResponse === void 0 ? void 0 : flamegraphResponse.report.oneofKind) === 'flamegraph') {
94
+ perf === null || perf === void 0 ? void 0 : perf.markInteraction('Flamegraph render', flamegraphResponse.report.flamegraph.total);
95
+ }
96
+ if (!topTableLoading && (topTableResponse === null || topTableResponse === void 0 ? void 0 : topTableResponse.report.oneofKind) === 'top') {
97
+ perf === null || perf === void 0 ? void 0 : perf.markInteraction('Top table render', (_a = topTableResponse === null || topTableResponse === void 0 ? void 0 : topTableResponse.report) === null || _a === void 0 ? void 0 : _a.top.total);
98
+ }
99
+ if (!callgraphLoading && (callgraphResponse === null || callgraphResponse === void 0 ? void 0 : callgraphResponse.report.oneofKind) === 'callgraph') {
100
+ perf === null || perf === void 0 ? void 0 : perf.markInteraction('Callgraph render', (_b = callgraphResponse === null || callgraphResponse === void 0 ? void 0 : callgraphResponse.report) === null || _b === void 0 ? void 0 : _b.callgraph.cumulative);
101
+ }
102
+ }, [
103
+ flamegraphLoading,
104
+ flamegraphResponse,
105
+ callgraphResponse,
106
+ callgraphLoading,
107
+ topTableLoading,
108
+ topTableResponse,
109
+ perf,
110
+ ]);
101
111
  var sampleUnit = profileSource.ProfileType().sampleUnit;
102
112
  var downloadPProfClick = function () { return __awaiter(void 0, void 0, void 0, function () {
103
113
  var blob, error_1;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.138",
3
+ "version": "0.16.140",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.66",
7
- "@parca/components": "^0.16.113",
7
+ "@parca/components": "^0.16.114",
8
8
  "@parca/dynamicsize": "^0.16.54",
9
9
  "@parca/functions": "^0.16.67",
10
10
  "@parca/parser": "^0.16.55",
@@ -45,5 +45,5 @@
45
45
  "access": "public",
46
46
  "registry": "https://registry.npmjs.org/"
47
47
  },
48
- "gitHead": "60d76589ffa445660989e296f0d245a3d6f340d5"
48
+ "gitHead": "6520407fe5da18f15d5de4e66dfc4241898f2139"
49
49
  }
@@ -3,9 +3,9 @@ import {Canvas, Meta, Story} from '@storybook/addon-docs';
3
3
 
4
4
  import {QueryResponse} from '@parca/client';
5
5
 
6
- import ProfileIcicleGraph from './ProfileIcicleGraph';
7
- import queryResponseDiff from './testdata/fg-diff.json';
8
- import queryResponseSimple from './testdata/fg-simple.json';
6
+ import ProfileIcicleGraph from './index';
7
+ import queryResponseDiff from '../testdata/fg-diff.json';
8
+ import queryResponseSimple from '../testdata/fg-simple.json';
9
9
 
10
10
  <Meta title="template/ProfileIcicleGraph" component={ProfileIcicleGraph} />
11
11
 
@@ -95,7 +95,7 @@ const ProfileMetricsGraph = ({
95
95
  }: ProfileMetricsGraphProps): JSX.Element => {
96
96
  const {isLoading, response, error} = useQueryRange(queryClient, queryExpression, from, to);
97
97
  const isLoaderVisible = useDelayedLoader(isLoading);
98
- const {loader, onError} = useParcaContext();
98
+ const {loader, onError, perf} = useParcaContext();
99
99
 
100
100
  useEffect(() => {
101
101
  if (error !== null) {
@@ -103,6 +103,14 @@ const ProfileMetricsGraph = ({
103
103
  }
104
104
  }, [error, onError]);
105
105
 
106
+ useEffect(() => {
107
+ if (response === null) {
108
+ return;
109
+ }
110
+
111
+ perf?.markInteraction('Metrics graph render', response.series[0].samples.length);
112
+ }, [perf, response]);
113
+
106
114
  if (isLoaderVisible) {
107
115
  return <>{loader}</>;
108
116
  }
@@ -67,18 +67,6 @@ export const ProfileViewWithData = ({
67
67
  });
68
68
  const {perf} = useParcaContext();
69
69
 
70
- useEffect(() => {
71
- if (flamegraphLoading) {
72
- return;
73
- }
74
-
75
- if (flamegraphResponse?.report.oneofKind !== 'flamegraph') {
76
- return;
77
- }
78
-
79
- perf?.markInteraction('Flamegraph Render', flamegraphResponse?.report?.flamegraph.total);
80
- }, [flamegraphLoading, flamegraphResponse, perf]);
81
-
82
70
  const {
83
71
  isLoading: topTableLoading,
84
72
  response: topTableResponse,
@@ -95,6 +83,28 @@ export const ProfileViewWithData = ({
95
83
  skip: !dashboardItems.includes('callgraph'),
96
84
  });
97
85
 
86
+ useEffect(() => {
87
+ if (!flamegraphLoading && flamegraphResponse?.report.oneofKind === 'flamegraph') {
88
+ perf?.markInteraction('Flamegraph render', flamegraphResponse.report.flamegraph.total);
89
+ }
90
+
91
+ if (!topTableLoading && topTableResponse?.report.oneofKind === 'top') {
92
+ perf?.markInteraction('Top table render', topTableResponse?.report?.top.total);
93
+ }
94
+
95
+ if (!callgraphLoading && callgraphResponse?.report.oneofKind === 'callgraph') {
96
+ perf?.markInteraction('Callgraph render', callgraphResponse?.report?.callgraph.cumulative);
97
+ }
98
+ }, [
99
+ flamegraphLoading,
100
+ flamegraphResponse,
101
+ callgraphResponse,
102
+ callgraphLoading,
103
+ topTableLoading,
104
+ topTableResponse,
105
+ perf,
106
+ ]);
107
+
98
108
  const sampleUnit = profileSource.ProfileType().sampleUnit;
99
109
 
100
110
  const downloadPProfClick = async (): Promise<void> => {