@parca/profile 0.16.184 → 0.16.186
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/constants.js +2 -2
- package/dist/Callgraph/index.js +35 -45
- package/dist/Callgraph/mockData/index.js +28 -11
- package/dist/Callgraph/utils.js +51 -58
- package/dist/GraphTooltip/ExpandOnHoverValue.js +2 -14
- package/dist/GraphTooltip/index.d.ts +5 -5
- package/dist/GraphTooltip/index.js +96 -122
- package/dist/MatchersInput/SuggestionItem.js +5 -17
- package/dist/MatchersInput/SuggestionsList.js +29 -53
- package/dist/MatchersInput/index.js +58 -74
- package/dist/MetricsCircle/index.js +2 -16
- package/dist/MetricsGraph/MetricsTooltip/index.js +27 -53
- package/dist/MetricsGraph/index.js +79 -98
- package/dist/MetricsSeries/index.js +4 -19
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +4 -16
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +2 -14
- package/dist/ProfileExplorer/index.js +129 -88
- package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.js +15 -31
- package/dist/ProfileIcicleGraph/IcicleGraph/IcicleGraphNodes.d.ts +4 -4
- package/dist/ProfileIcicleGraph/IcicleGraph/IcicleGraphNodes.js +38 -54
- package/dist/ProfileIcicleGraph/IcicleGraph/index.d.ts +2 -2
- package/dist/ProfileIcicleGraph/IcicleGraph/index.js +15 -31
- package/dist/ProfileIcicleGraph/IcicleGraph/useColoredGraph.js +22 -26
- package/dist/ProfileIcicleGraph/IcicleGraph/useNodeColor.js +8 -9
- package/dist/ProfileIcicleGraph/IcicleGraph/utils.js +18 -20
- package/dist/ProfileIcicleGraph/index.d.ts +2 -2
- package/dist/ProfileIcicleGraph/index.js +18 -30
- package/dist/ProfileMetricsGraph/index.js +36 -88
- package/dist/ProfileSelector/CompareButton.js +8 -20
- package/dist/ProfileSelector/index.js +69 -69
- package/dist/ProfileSource.js +56 -65
- package/dist/ProfileTypeSelector/index.js +14 -28
- package/dist/ProfileView/FilterByFunctionButton.js +6 -7
- package/dist/ProfileView/ViewSelector.js +18 -31
- package/dist/ProfileView/VisualizationPanel.js +4 -16
- package/dist/ProfileView/index.js +72 -152
- package/dist/ProfileViewWithData.js +50 -101
- package/dist/TopTable/index.js +55 -63
- package/dist/components/DiffLegend.js +16 -28
- package/dist/components/ProfileShareButton/ResultBox.js +7 -21
- package/dist/components/ProfileShareButton/index.js +31 -90
- package/dist/useDelayedLoader.js +7 -8
- package/dist/useGrpcQuery/index.js +6 -48
- package/dist/useQuery.js +14 -58
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +16 -68
- package/package.json +6 -6
- package/src/Callgraph/index.tsx +3 -3
- package/src/Callgraph/utils.ts +1 -1
- package/src/GraphTooltip/index.tsx +17 -17
- package/src/MetricsGraph/index.tsx +3 -3
- package/src/ProfileIcicleGraph/IcicleGraph/IcicleGraphNodes.tsx +9 -10
- package/src/ProfileIcicleGraph/IcicleGraph/index.tsx +4 -8
- package/src/ProfileIcicleGraph/IcicleGraph/useNodeColor.ts +2 -2
- package/src/ProfileIcicleGraph/index.tsx +8 -8
- package/src/ProfileView/index.tsx +2 -2
- package/src/TopTable/index.tsx +3 -3
- package/src/utils.ts +2 -2
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
2
|
// Copyright 2022 The Parca Authors
|
|
14
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -32,96 +21,94 @@ import { formatDate, formatForTimespan, sanitizeHighlightedValues, valueFormatte
|
|
|
32
21
|
import MetricsCircle from '../MetricsCircle';
|
|
33
22
|
import MetricsSeries from '../MetricsSeries';
|
|
34
23
|
import MetricsTooltip from './MetricsTooltip';
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return (_jsx("div", __assign({ ref: ref }, { children: _jsx(RawMetricsGraph, { data: data, from: from, to: to, profile: profile, onSampleClick: onSampleClick, onLabelClick: onLabelClick, setTimeRange: setTimeRange, sampleUnit: sampleUnit, width: dimensions === null || dimensions === void 0 ? void 0 : dimensions.width }) })));
|
|
24
|
+
const MetricsGraph = ({ data, from, to, profile, onSampleClick, onLabelClick, setTimeRange, sampleUnit, }) => {
|
|
25
|
+
const { ref, dimensions } = useContainerDimensions();
|
|
26
|
+
return (_jsx("div", { ref: ref, children: _jsx(RawMetricsGraph, { data: data, from: from, to: to, profile: profile, onSampleClick: onSampleClick, onLabelClick: onLabelClick, setTimeRange: setTimeRange, sampleUnit: sampleUnit, width: dimensions?.width }) }));
|
|
39
27
|
};
|
|
40
28
|
export default MetricsGraph;
|
|
41
|
-
export
|
|
42
|
-
|
|
29
|
+
export const parseValue = (value) => {
|
|
30
|
+
const val = parseFloat(value);
|
|
43
31
|
// "+Inf", "-Inf", "+Inf" will be parsed into NaN by parseFloat(). They
|
|
44
32
|
// can't be graphed, so show them as gaps (null).
|
|
45
33
|
return isNaN(val) ? null : val;
|
|
46
34
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var isShiftDown = useKeyDown().isShiftDown;
|
|
35
|
+
const lineStroke = '1px';
|
|
36
|
+
const lineStrokeHover = '2px';
|
|
37
|
+
export const RawMetricsGraph = ({ data, from, to, profile, onSampleClick, onLabelClick, setTimeRange, width, sampleUnit, }) => {
|
|
38
|
+
const graph = useRef(null);
|
|
39
|
+
const [dragging, setDragging] = useState(false);
|
|
40
|
+
const [hovering, setHovering] = useState(false);
|
|
41
|
+
const [relPos, setRelPos] = useState(-1);
|
|
42
|
+
const [pos, setPos] = useState([0, 0]);
|
|
43
|
+
const metricPointRef = useRef(null);
|
|
44
|
+
const { isShiftDown } = useKeyDown();
|
|
58
45
|
// the time of the selected point is the start of the merge window
|
|
59
|
-
|
|
46
|
+
const time = parseFloat(profile?.HistoryParams().merge_from);
|
|
60
47
|
if (width === undefined || width == null) {
|
|
61
48
|
width = 0;
|
|
62
49
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
const height = Math.min(width / 2.5, 400);
|
|
51
|
+
const margin = 50;
|
|
52
|
+
const marginRight = 20;
|
|
53
|
+
const series = data.reduce(function (agg, s) {
|
|
67
54
|
if (s.labelset !== undefined) {
|
|
68
|
-
|
|
55
|
+
const metric = s.labelset.labels.sort((a, b) => a.name.localeCompare(b.name));
|
|
69
56
|
agg.push({
|
|
70
|
-
metric
|
|
57
|
+
metric,
|
|
71
58
|
values: s.samples.reduce(function (agg, d) {
|
|
72
59
|
if (d.timestamp !== undefined && d.valuePerSecond !== undefined) {
|
|
73
|
-
|
|
74
|
-
agg.push([t, d.valuePerSecond,
|
|
60
|
+
const t = (Number(d.timestamp.seconds) * 1e9 + d.timestamp.nanos) / 1e6; // https://github.com/microsoft/TypeScript/issues/5710#issuecomment-157886246
|
|
61
|
+
agg.push([t, d.valuePerSecond, Number(d.value), Number(d.duration)]);
|
|
75
62
|
}
|
|
76
63
|
return agg;
|
|
77
64
|
}, []),
|
|
78
|
-
labelset: metric.map(
|
|
65
|
+
labelset: metric.map(m => `${m.name}=${m.value}`).join(','),
|
|
79
66
|
});
|
|
80
67
|
}
|
|
81
68
|
return agg;
|
|
82
69
|
}, []);
|
|
83
70
|
// Sort series by id to make sure the colors are consistent
|
|
84
|
-
series.sort(
|
|
85
|
-
|
|
71
|
+
series.sort((a, b) => a.labelset.localeCompare(b.labelset));
|
|
72
|
+
const extentsY = series.map(function (s) {
|
|
86
73
|
return d3.extent(s.values, function (d) {
|
|
87
74
|
return d[1];
|
|
88
75
|
});
|
|
89
76
|
});
|
|
90
|
-
|
|
77
|
+
const minY = d3.min(extentsY, function (d) {
|
|
91
78
|
return d[0];
|
|
92
79
|
});
|
|
93
|
-
|
|
80
|
+
const maxY = d3.max(extentsY, function (d) {
|
|
94
81
|
return d[1];
|
|
95
82
|
});
|
|
96
83
|
/* Scale */
|
|
97
|
-
|
|
84
|
+
const xScale = d3
|
|
98
85
|
.scaleUtc()
|
|
99
86
|
.domain([from, to])
|
|
100
87
|
.range([0, width - margin - marginRight]);
|
|
101
|
-
|
|
88
|
+
const yScale = d3
|
|
102
89
|
.scaleLinear()
|
|
103
90
|
// tslint:disable-next-line
|
|
104
91
|
.domain([minY, maxY])
|
|
105
92
|
.range([height - margin, 0]);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
const color = d3.scaleOrdinal(d3.schemeCategory10);
|
|
94
|
+
const l = d3.line(d => xScale(d[0]), d => yScale(d[1]));
|
|
95
|
+
const getClosest = () => {
|
|
96
|
+
const closestPointPerSeries = series.map(function (s) {
|
|
97
|
+
const distances = s.values.map(d => {
|
|
98
|
+
const x = xScale(d[0]);
|
|
99
|
+
const y = yScale(d[1]);
|
|
113
100
|
return Math.sqrt(Math.pow(pos[0] - x, 2) + Math.pow(pos[1] - y, 2));
|
|
114
101
|
});
|
|
115
|
-
|
|
116
|
-
|
|
102
|
+
const pointIndex = d3.minIndex(distances);
|
|
103
|
+
const minDistance = distances[pointIndex];
|
|
117
104
|
return {
|
|
118
|
-
pointIndex
|
|
105
|
+
pointIndex,
|
|
119
106
|
distance: minDistance,
|
|
120
107
|
};
|
|
121
108
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
109
|
+
const closestSeriesIndex = d3.minIndex(closestPointPerSeries, s => s.distance);
|
|
110
|
+
const pointIndex = closestPointPerSeries[closestSeriesIndex].pointIndex;
|
|
111
|
+
const point = series[closestSeriesIndex].values[pointIndex];
|
|
125
112
|
return {
|
|
126
113
|
seriesIndex: closestSeriesIndex,
|
|
127
114
|
labels: series[closestSeriesIndex].metric,
|
|
@@ -133,8 +120,8 @@ export var RawMetricsGraph = function (_a) {
|
|
|
133
120
|
y: yScale(point[1]),
|
|
134
121
|
};
|
|
135
122
|
};
|
|
136
|
-
|
|
137
|
-
|
|
123
|
+
const highlighted = getClosest();
|
|
124
|
+
const onMouseDown = (e) => {
|
|
138
125
|
// if shift is down, disable mouse behavior
|
|
139
126
|
if (isShiftDown) {
|
|
140
127
|
return;
|
|
@@ -144,9 +131,9 @@ export var RawMetricsGraph = function (_a) {
|
|
|
144
131
|
return;
|
|
145
132
|
}
|
|
146
133
|
// X/Y coordinate array relative to svg
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
134
|
+
const rel = pointer(e);
|
|
135
|
+
const xCoordinate = rel[0];
|
|
136
|
+
const xCoordinateWithoutMargin = xCoordinate - margin;
|
|
150
137
|
if (xCoordinateWithoutMargin >= 0) {
|
|
151
138
|
setRelPos(xCoordinateWithoutMargin);
|
|
152
139
|
setDragging(true);
|
|
@@ -154,13 +141,13 @@ export var RawMetricsGraph = function (_a) {
|
|
|
154
141
|
e.stopPropagation();
|
|
155
142
|
e.preventDefault();
|
|
156
143
|
};
|
|
157
|
-
|
|
144
|
+
const openClosestProfile = () => {
|
|
158
145
|
if (highlighted != null) {
|
|
159
146
|
onSampleClick(Math.round(highlighted.timestamp), highlighted.value, sanitizeHighlightedValues(highlighted.labels) // When a user clicks on any sample in the graph, replace single `\` in the `labelValues` string with doubles `\\` if available.
|
|
160
147
|
);
|
|
161
148
|
}
|
|
162
149
|
};
|
|
163
|
-
|
|
150
|
+
const onMouseUp = (e) => {
|
|
164
151
|
if (isShiftDown) {
|
|
165
152
|
return;
|
|
166
153
|
}
|
|
@@ -176,8 +163,8 @@ export var RawMetricsGraph = function (_a) {
|
|
|
176
163
|
setRelPos(-1);
|
|
177
164
|
return;
|
|
178
165
|
}
|
|
179
|
-
|
|
180
|
-
|
|
166
|
+
const firstTime = xScale.invert(relPos).valueOf();
|
|
167
|
+
const secondTime = xScale.invert(pos[0]).valueOf();
|
|
181
168
|
if (firstTime > secondTime) {
|
|
182
169
|
setTimeRange(DateTimeRange.fromAbsoluteDates(secondTime, firstTime));
|
|
183
170
|
}
|
|
@@ -188,42 +175,36 @@ export var RawMetricsGraph = function (_a) {
|
|
|
188
175
|
e.stopPropagation();
|
|
189
176
|
e.preventDefault();
|
|
190
177
|
};
|
|
191
|
-
|
|
192
|
-
|
|
178
|
+
const throttledSetPos = throttle(setPos, 20);
|
|
179
|
+
const onMouseMove = (e) => {
|
|
193
180
|
// do not update position if shift is down because this means the user is locking the tooltip
|
|
194
181
|
if (isShiftDown) {
|
|
195
182
|
return;
|
|
196
183
|
}
|
|
197
184
|
// X/Y coordinate array relative to svg
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
185
|
+
const rel = pointer(e);
|
|
186
|
+
const xCoordinate = rel[0];
|
|
187
|
+
const xCoordinateWithoutMargin = xCoordinate - margin;
|
|
188
|
+
const yCoordinate = rel[1];
|
|
189
|
+
const yCoordinateWithoutMargin = yCoordinate - margin;
|
|
203
190
|
throttledSetPos([xCoordinateWithoutMargin, yCoordinateWithoutMargin]);
|
|
204
191
|
};
|
|
205
|
-
|
|
192
|
+
const findSelectedProfile = () => {
|
|
206
193
|
if (profile == null) {
|
|
207
194
|
return null;
|
|
208
195
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
outer: for (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
196
|
+
let s = null;
|
|
197
|
+
let seriesIndex = -1;
|
|
198
|
+
outer: for (let i = 0; i < series.length; i++) {
|
|
199
|
+
const keys = profile.query.matchers.map(e => e.key);
|
|
200
|
+
for (let j = 0; j < keys.length; j++) {
|
|
201
|
+
const matcherKey = keys[j];
|
|
202
|
+
const label = series[i].metric.find(e => e.name === matcherKey);
|
|
216
203
|
if (label === undefined) {
|
|
217
|
-
|
|
204
|
+
continue outer; // label doesn't exist to begin with
|
|
218
205
|
}
|
|
219
206
|
if (profile.query.matchers[j].value !== label.value) {
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
for (var j = 0; j < keys.length; j++) {
|
|
224
|
-
var state_1 = _loop_1(j);
|
|
225
|
-
switch (state_1) {
|
|
226
|
-
case "continue-outer": continue outer;
|
|
207
|
+
continue outer; // label values don't match
|
|
227
208
|
}
|
|
228
209
|
}
|
|
229
210
|
seriesIndex = i;
|
|
@@ -233,7 +214,7 @@ export var RawMetricsGraph = function (_a) {
|
|
|
233
214
|
return null;
|
|
234
215
|
}
|
|
235
216
|
// Find the sample that matches the timestamp
|
|
236
|
-
|
|
217
|
+
const sample = s.values.find(v => {
|
|
237
218
|
return Math.round(v[0]) === time;
|
|
238
219
|
});
|
|
239
220
|
if (sample === undefined) {
|
|
@@ -241,7 +222,7 @@ export var RawMetricsGraph = function (_a) {
|
|
|
241
222
|
}
|
|
242
223
|
return {
|
|
243
224
|
labels: [],
|
|
244
|
-
seriesIndex
|
|
225
|
+
seriesIndex,
|
|
245
226
|
timestamp: sample[0],
|
|
246
227
|
valuePerSecond: sample[1],
|
|
247
228
|
value: sample[2],
|
|
@@ -250,16 +231,16 @@ export var RawMetricsGraph = function (_a) {
|
|
|
250
231
|
y: yScale(sample[1]),
|
|
251
232
|
};
|
|
252
233
|
};
|
|
253
|
-
|
|
254
|
-
return (_jsxs(_Fragment, { children: [highlighted != null && hovering && !dragging && pos[0] !== 0 && pos[1] !== 0 && (_jsx("div",
|
|
234
|
+
const selected = findSelectedProfile();
|
|
235
|
+
return (_jsxs(_Fragment, { children: [highlighted != null && hovering && !dragging && pos[0] !== 0 && pos[1] !== 0 && (_jsx("div", { onMouseMove: onMouseMove, onMouseEnter: () => setHovering(true), onMouseLeave: () => setHovering(false), children: _jsx(MetricsTooltip, { x: pos[0] + margin, y: pos[1] + margin, highlighted: highlighted, onLabelClick: onLabelClick, contextElement: graph.current, sampleUnit: sampleUnit, delta: profile !== null ? profile?.query.profType.delta : false }) })), _jsx("div", { ref: graph, onMouseEnter: function () {
|
|
255
236
|
setHovering(true);
|
|
256
|
-
}, onMouseLeave:
|
|
237
|
+
}, onMouseLeave: () => setHovering(false), children: _jsxs("svg", { width: `${width}px`, height: `${height + margin}px`, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onMouseMove: onMouseMove, children: [_jsx("g", { transform: `translate(${margin}, 0)`, children: dragging && (_jsx("g", { className: "zoom-time-rect", children: _jsx("rect", { className: "bar", x: pos[0] - relPos < 0 ? pos[0] : relPos, y: 0, height: height, width: Math.abs(pos[0] - relPos), fill: 'rgba(0, 0, 0, 0.125)' }) })) }), _jsxs("g", { transform: `translate(${margin}, ${margin})`, children: [_jsx("g", { className: "lines fill-transparent", children: series.map((s, i) => (_jsx("g", { className: "line", children: _jsx(MetricsSeries, { data: s, line: l, color: color(i.toString()), strokeWidth: hovering && highlighted != null && i === highlighted.seriesIndex
|
|
257
238
|
? lineStrokeHover
|
|
258
|
-
: lineStroke, xScale: xScale, yScale: yScale }) }
|
|
239
|
+
: lineStroke, xScale: xScale, yScale: yScale }) }, i))) }), hovering && highlighted != null && (_jsx("g", { className: "circle-group", ref: metricPointRef, style: { fill: color(highlighted.seriesIndex.toString()) }, children: _jsx(MetricsCircle, { cx: highlighted.x, cy: highlighted.y }) })), selected != null && (_jsx("g", { className: "circle-group", style: selected?.seriesIndex != null
|
|
259
240
|
? { fill: color(selected.seriesIndex.toString()) }
|
|
260
|
-
: {}
|
|
241
|
+
: {}, children: _jsx(MetricsCircle, { cx: selected.x, cy: selected.y, radius: 5 }) })), _jsx("g", { className: "x axis", fill: "none", fontSize: "10", textAnchor: "middle", transform: `translate(0,${height - margin})`, children: xScale.ticks(5).map((d, i) => (_jsxs("g", { className: "tick",
|
|
261
242
|
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
|
|
262
|
-
transform:
|
|
243
|
+
transform: `translate(${xScale(d)}, 0)`, children: [_jsx("line", { y2: 6, stroke: "currentColor" }), _jsx("text", { fill: "currentColor", dy: ".71em", y: 9, children: formatDate(d, formatForTimespan(from, to)) })] }, i))) }), _jsx("g", { className: "y axis", textAnchor: "end", fontSize: "10", fill: "none", children: yScale.ticks(3).map((d, i) => (_jsxs("g", { className: "tick",
|
|
263
244
|
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
|
|
264
|
-
transform:
|
|
245
|
+
transform: `translate(0, ${yScale(d)})`, children: [_jsx("line", { stroke: "currentColor", x2: -6 }), _jsx("text", { fill: "currentColor", x: -9, dy: '0.32em', children: valueFormatter(1000, sampleUnit, 1) })] }, i))) })] })] }) })] }));
|
|
265
246
|
};
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
stroke: color,
|
|
18
|
-
strokeWidth: strokeWidth,
|
|
19
|
-
} }) })));
|
|
20
|
-
};
|
|
2
|
+
const MetricsSeries = ({ data, line, color, strokeWidth }) => (_jsx("g", { className: "line-group", children: _jsx("path", { className: "line", d: line(data.values) ?? undefined, style: {
|
|
3
|
+
stroke: color,
|
|
4
|
+
strokeWidth,
|
|
5
|
+
} }) }));
|
|
21
6
|
export default MetricsSeries;
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
2
|
import { Query } from '@parca/parser';
|
|
14
3
|
import { ProfileDiffSource, ProfileViewWithData } from '..';
|
|
15
4
|
import ProfileSelector from '../ProfileSelector';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var closeProfileA = function () {
|
|
5
|
+
const ProfileExplorerCompare = ({ queryClient, queryA, queryB, profileA, profileB, selectQueryA, selectQueryB, selectProfileA, selectProfileB, closeProfile, navigateTo, }) => {
|
|
6
|
+
const closeProfileA = () => {
|
|
19
7
|
closeProfile('A');
|
|
20
8
|
};
|
|
21
|
-
|
|
9
|
+
const closeProfileB = () => {
|
|
22
10
|
closeProfile('B');
|
|
23
11
|
};
|
|
24
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div",
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid grid-cols-2", children: [_jsx("div", { className: "pr-2", children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: queryA, profileSelection: profileA, selectProfile: selectProfileA, selectQuery: selectQueryA, closeProfile: closeProfileA, enforcedProfileName: '', comparing: true, onCompareProfile: () => { } }) }), _jsx("div", { className: "pl-2", children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: queryB, profileSelection: profileB, selectProfile: selectProfileB, selectQuery: selectQueryB, closeProfile: closeProfileB, enforcedProfileName: Query.parse(queryA.expression).profileName(), comparing: true, onCompareProfile: () => { } }) })] }), _jsx("div", { className: "grid grid-cols-1", children: profileA != null && profileB != null ? (_jsx(ProfileViewWithData, { navigateTo: navigateTo, queryClient: queryClient, profileSource: new ProfileDiffSource(profileA.ProfileSource(), profileB.ProfileSource()) })) : (_jsx("div", { children: _jsx("div", { className: "my-20 text-center", children: _jsx("p", { children: "Select a profile on both sides." }) }) })) })] }));
|
|
25
13
|
};
|
|
26
14
|
export default ProfileExplorerCompare;
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { ProfileViewWithData } from '..';
|
|
14
3
|
import ProfileSelector from '../ProfileSelector';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: "grid grid-cols-1" }, { children: _jsx("div", { children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: query, selectQuery: selectQuery, selectProfile: selectProfile, closeProfile: function () { }, profileSelection: profile, comparing: false, onCompareProfile: compareProfile, enforcedProfileName: '' }) }) })), _jsx("div", __assign({ className: "grid grid-cols-1" }, { children: _jsx("div", { children: profile != null ? (_jsx(ProfileViewWithData, { queryClient: queryClient, profileSource: profile.ProfileSource(), navigateTo: navigateTo })) : (_jsx(_Fragment, {})) }) }))] }));
|
|
4
|
+
const ProfileExplorerSingle = ({ queryClient, query, selectQuery, selectProfile, profile, compareProfile, navigateTo, }) => {
|
|
5
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-1", children: _jsx("div", { children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: query, selectQuery: selectQuery, selectProfile: selectProfile, closeProfile: () => { }, profileSelection: profile, comparing: false, onCompareProfile: compareProfile, enforcedProfileName: '' }) }) }), _jsx("div", { className: "grid grid-cols-1", children: _jsx("div", { children: profile != null ? (_jsx(ProfileViewWithData, { queryClient: queryClient, profileSource: profile.ProfileSource(), navigateTo: navigateTo })) : (_jsx(_Fragment, {})) }) })] }));
|
|
18
6
|
};
|
|
19
7
|
export default ProfileExplorerSingle;
|