@parca/profile 0.16.61 → 0.16.63
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 +8 -0
- package/dist/Callgraph/index.js +17 -12
- package/dist/MatchersInput/index.d.ts +1 -5
- package/dist/MatchersInput/index.js +69 -280
- package/dist/ProfileMetricsGraph/index.d.ts +2 -2
- package/dist/ProfileMetricsGraph/index.js +22 -30
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/Callgraph/index.tsx +18 -12
- package/src/MatchersInput/index.tsx +173 -436
- package/src/ProfileMetricsGraph/index.tsx +26 -23
|
@@ -31,7 +31,7 @@ interface ProfileMetricsGraphProps {
|
|
|
31
31
|
addLabelMatcher: (key: string, value: string) => void;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export interface
|
|
34
|
+
export interface IQueryRangeState {
|
|
35
35
|
response: QueryRangeResponse | null;
|
|
36
36
|
isLoading: boolean;
|
|
37
37
|
error: RpcError | null;
|
|
@@ -42,36 +42,39 @@ export const useQueryRange = (
|
|
|
42
42
|
queryExpression: string,
|
|
43
43
|
start: number,
|
|
44
44
|
end: number
|
|
45
|
-
):
|
|
46
|
-
const [
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
): IQueryRangeState => {
|
|
46
|
+
const [state, setState] = useState<IQueryRangeState>({
|
|
47
|
+
response: null,
|
|
48
|
+
isLoading: true,
|
|
49
|
+
error: null,
|
|
50
|
+
});
|
|
49
51
|
const metadata = useGrpcMetadata();
|
|
50
52
|
|
|
51
53
|
useEffect(() => {
|
|
52
54
|
void (async () => {
|
|
53
|
-
|
|
55
|
+
setState({
|
|
56
|
+
response: null,
|
|
57
|
+
isLoading: true,
|
|
58
|
+
error: null,
|
|
59
|
+
});
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
} finally {
|
|
69
|
-
setIsLoading(false);
|
|
70
|
-
}
|
|
61
|
+
const call = client.queryRange(
|
|
62
|
+
{
|
|
63
|
+
query: queryExpression,
|
|
64
|
+
start: Timestamp.fromDate(new Date(start)),
|
|
65
|
+
end: Timestamp.fromDate(new Date(end)),
|
|
66
|
+
limit: 0,
|
|
67
|
+
},
|
|
68
|
+
{meta: metadata}
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
call.response
|
|
72
|
+
.then(response => setState({response, isLoading: false, error: null}))
|
|
73
|
+
.catch(error => setState({response: null, isLoading: false, error}));
|
|
71
74
|
})();
|
|
72
75
|
}, [client, queryExpression, start, end, metadata]);
|
|
73
76
|
|
|
74
|
-
return
|
|
77
|
+
return state;
|
|
75
78
|
};
|
|
76
79
|
|
|
77
80
|
const ProfileMetricsGraph = ({
|