@parca/profile 0.12.5 → 0.12.8

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.12.8](https://github.com/parca-dev/parca/compare/ui-v0.12.7...ui-v0.12.8) (2022-03-30)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.12.6](https://github.com/parca-dev/parca/compare/ui-v0.12.5...ui-v0.12.6) (2022-03-24)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.12.5](https://github.com/parca-dev/parca/compare/ui-v0.12.4...ui-v0.12.5) (2022-03-24)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.12.5",
3
+ "version": "0.12.8",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
- "@parca/client": "^0.12.5",
6
+ "@parca/client": "^0.12.6",
7
7
  "@parca/dynamicsize": "^0.12.0",
8
8
  "@parca/parser": "^0.12.3",
9
9
  "d3-scale": "^4.0.2"
@@ -19,5 +19,5 @@
19
19
  "access": "public",
20
20
  "registry": "https://registry.npmjs.org/"
21
21
  },
22
- "gitHead": "beba5e0938216b286c0de9639b96b88eb8420c06"
22
+ "gitHead": "14acb288189bdc77077d992aa6c4e3736e6d07fa"
23
23
  }
@@ -2,12 +2,11 @@ import React, {useEffect, useState} from 'react';
2
2
  import {CalcWidth} from '@parca/dynamicsize';
3
3
  import {parseParams} from '@parca/functions';
4
4
  import {QueryRequest, QueryResponse, QueryServiceClient, ServiceError} from '@parca/client';
5
- import {Button} from '@parca/components';
5
+ import {Button, Card, useGrpcMetadata} from '@parca/components';
6
6
  import * as parca_query_v1alpha1_query_pb from '@parca/client/src/parca/query/v1alpha1/query_pb';
7
7
 
8
8
  import ProfileIcicleGraph from './ProfileIcicleGraph';
9
9
  import {ProfileSource} from './ProfileSource';
10
- import {Card} from '@parca/components';
11
10
  import TopTable from './TopTable';
12
11
 
13
12
  import './ProfileView.styles.css';
@@ -44,6 +43,7 @@ export const useQuery = (
44
43
  response: null,
45
44
  error: null,
46
45
  });
46
+ const metadata = useGrpcMetadata();
47
47
 
48
48
  useEffect(() => {
49
49
  setResult({
@@ -53,13 +53,17 @@ export const useQuery = (
53
53
  const req = profileSource.QueryRequest();
54
54
  req.setReportType(QueryRequest.ReportType.REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED);
55
55
 
56
- client.query(req, (error: ServiceError | null, responseMessage: QueryResponse | null) => {
57
- setResult({
58
- isLoading: false,
59
- response: responseMessage,
60
- error: error,
61
- });
62
- });
56
+ client.query(
57
+ req,
58
+ metadata,
59
+ (error: ServiceError | null, responseMessage: QueryResponse | null) => {
60
+ setResult({
61
+ isLoading: false,
62
+ response: responseMessage,
63
+ error: error,
64
+ });
65
+ }
66
+ );
63
67
  }, [client, profileSource]);
64
68
 
65
69
  return result;
@@ -76,6 +80,7 @@ export const ProfileView = ({
76
80
  const [isLoaderVisible, setIsLoaderVisible] = useState<boolean>(false);
77
81
  const {isLoading, response, error} = useQuery(queryClient, profileSource);
78
82
  const [currentView, setCurrentView] = useState<string | undefined>(currentViewFromURL);
83
+ const grpcMetadata = useGrpcMetadata();
79
84
 
80
85
  useEffect(() => {
81
86
  let showLoaderTimeout;
@@ -138,6 +143,7 @@ export const ProfileView = ({
138
143
 
139
144
  queryClient.query(
140
145
  req,
146
+ grpcMetadata,
141
147
  (
142
148
  error: ServiceError | null,
143
149
  responseMessage: parca_query_v1alpha1_query_pb.QueryResponse | null
package/src/TopTable.tsx CHANGED
@@ -1,6 +1,4 @@
1
1
  import React, {useEffect, useState} from 'react';
2
-
3
- import {ProfileSource} from './ProfileSource';
4
2
  import {
5
3
  QueryRequest,
6
4
  QueryResponse,
@@ -10,7 +8,9 @@ import {
10
8
  } from '@parca/client';
11
9
  import * as parca_query_v1alpha1_query_pb from '@parca/client/src/parca/query/v1alpha1/query_pb';
12
10
  import {getLastItem, valueFormatter} from '@parca/functions';
11
+ import {useGrpcMetadata} from '@parca/components';
13
12
 
13
+ import {ProfileSource} from './ProfileSource';
14
14
  import './TopTable.styles.css';
15
15
 
16
16
  interface ProfileViewProps {
@@ -90,6 +90,7 @@ export const useQuery = (
90
90
  response: null,
91
91
  error: null,
92
92
  });
93
+ const metadata = useGrpcMetadata();
93
94
 
94
95
  useEffect(() => {
95
96
  const req = profileSource.QueryRequest();
@@ -97,6 +98,7 @@ export const useQuery = (
97
98
 
98
99
  client.query(
99
100
  req,
101
+ metadata,
100
102
  (
101
103
  error: ServiceError | null,
102
104
  responseMessage: parca_query_v1alpha1_query_pb.QueryResponse | null