@parca/profile 0.19.44 → 0.19.45
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 +4 -0
- package/dist/GraphTooltipArrow/Content.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/Content.js +1 -1
- package/dist/MetricsGraph/MetricsContextMenu/index.d.ts +20 -11
- package/dist/MetricsGraph/MetricsContextMenu/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsContextMenu/index.js +16 -20
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts +2 -8
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.js +46 -55
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.d.ts +2 -5
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.js +126 -205
- package/dist/MetricsGraph/UtilizationMetrics/index.d.ts +9 -17
- package/dist/MetricsGraph/UtilizationMetrics/index.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/index.js +149 -208
- package/dist/MetricsGraph/index.d.ts +19 -26
- package/dist/MetricsGraph/index.d.ts.map +1 -1
- package/dist/MetricsGraph/index.js +50 -115
- package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/index.js +3 -1
- package/dist/ProfileMetricsGraph/index.d.ts +1 -1
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +232 -23
- package/dist/ProfileSelector/MetricsGraphSection.d.ts +1 -4
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +8 -4
- package/dist/ProfileSelector/index.d.ts +3 -6
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +2 -2
- package/dist/ProfileSource.d.ts +9 -6
- package/dist/ProfileSource.d.ts.map +1 -1
- package/dist/ProfileSource.js +23 -8
- package/dist/styles.css +1 -1
- package/dist/useQuery.js +1 -1
- package/package.json +6 -6
- package/src/GraphTooltipArrow/Content.tsx +2 -4
- package/src/MetricsGraph/MetricsContextMenu/index.tsx +78 -66
- package/src/MetricsGraph/MetricsTooltip/index.tsx +53 -210
- package/src/MetricsGraph/UtilizationMetrics/Throughput.tsx +242 -434
- package/src/MetricsGraph/UtilizationMetrics/index.tsx +312 -448
- package/src/MetricsGraph/index.tsx +99 -185
- package/src/ProfileFlameGraph/index.tsx +3 -1
- package/src/ProfileMetricsGraph/index.tsx +430 -37
- package/src/ProfileSelector/MetricsGraphSection.tsx +12 -8
- package/src/ProfileSelector/index.tsx +5 -5
- package/src/ProfileSource.tsx +34 -17
- package/src/useQuery.tsx +1 -1
package/src/ProfileSource.tsx
CHANGED
|
@@ -27,6 +27,7 @@ export interface ProfileSource {
|
|
|
27
27
|
ProfileType: () => ProfileType;
|
|
28
28
|
DiffSelection: () => ProfileDiffSelection;
|
|
29
29
|
toString: (timezone?: string) => string;
|
|
30
|
+
toKey: () => string;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export interface ProfileSelection {
|
|
@@ -79,23 +80,19 @@ export function ProfileSelectionFromParams(
|
|
|
79
80
|
return null;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
return new MergedProfileSelection(
|
|
83
|
-
parseInt(mergeFrom),
|
|
84
|
-
parseInt(mergeTo),
|
|
85
|
-
Query.parse(selection)
|
|
86
|
-
);
|
|
83
|
+
return new MergedProfileSelection(BigInt(mergeFrom), BigInt(mergeTo), Query.parse(selection));
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
return null;
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
export class MergedProfileSelection implements ProfileSelection {
|
|
93
|
-
mergeFrom:
|
|
94
|
-
mergeTo:
|
|
90
|
+
mergeFrom: bigint;
|
|
91
|
+
mergeTo: bigint;
|
|
95
92
|
query: Query;
|
|
96
93
|
profileSource: ProfileSource;
|
|
97
94
|
|
|
98
|
-
constructor(mergeFrom:
|
|
95
|
+
constructor(mergeFrom: bigint, mergeTo: bigint, query: Query) {
|
|
99
96
|
this.mergeFrom = mergeFrom;
|
|
100
97
|
this.mergeTo = mergeTo;
|
|
101
98
|
this.query = query;
|
|
@@ -178,15 +175,31 @@ export class ProfileDiffSource implements ProfileSource {
|
|
|
178
175
|
|
|
179
176
|
return `${this.a.toString()} compared with ${this.b.toString()}`;
|
|
180
177
|
}
|
|
178
|
+
|
|
179
|
+
toKey(): string {
|
|
180
|
+
return `${this.a.toKey()}-${this.b.toKey()}`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function nanosToTimestamp(nanos: bigint): Timestamp {
|
|
185
|
+
const NANOS_PER_SECOND = 1_000_000_000n;
|
|
186
|
+
|
|
187
|
+
const seconds = nanos / NANOS_PER_SECOND;
|
|
188
|
+
const remainingNanos = nanos % NANOS_PER_SECOND;
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
seconds,
|
|
192
|
+
nanos: Number(remainingNanos), // Safe since remainingNanos < 1e9
|
|
193
|
+
};
|
|
181
194
|
}
|
|
182
195
|
|
|
183
196
|
export class MergedProfileSource implements ProfileSource {
|
|
184
|
-
mergeFrom:
|
|
185
|
-
mergeTo:
|
|
197
|
+
mergeFrom: bigint;
|
|
198
|
+
mergeTo: bigint;
|
|
186
199
|
query: Query;
|
|
187
200
|
profileType: ProfileType;
|
|
188
201
|
|
|
189
|
-
constructor(mergeFrom:
|
|
202
|
+
constructor(mergeFrom: bigint, mergeTo: bigint, query: Query) {
|
|
190
203
|
this.mergeFrom = mergeFrom;
|
|
191
204
|
this.mergeTo = mergeTo;
|
|
192
205
|
this.query = query;
|
|
@@ -198,8 +211,8 @@ export class MergedProfileSource implements ProfileSource {
|
|
|
198
211
|
options: {
|
|
199
212
|
oneofKind: 'merge',
|
|
200
213
|
merge: {
|
|
201
|
-
start:
|
|
202
|
-
end:
|
|
214
|
+
start: nanosToTimestamp(this.mergeFrom),
|
|
215
|
+
end: nanosToTimestamp(this.mergeTo),
|
|
203
216
|
query: this.query.toString(),
|
|
204
217
|
},
|
|
205
218
|
},
|
|
@@ -212,8 +225,8 @@ export class MergedProfileSource implements ProfileSource {
|
|
|
212
225
|
options: {
|
|
213
226
|
oneofKind: 'merge',
|
|
214
227
|
merge: {
|
|
215
|
-
start:
|
|
216
|
-
end:
|
|
228
|
+
start: nanosToTimestamp(this.mergeFrom),
|
|
229
|
+
end: nanosToTimestamp(this.mergeTo),
|
|
217
230
|
query: this.query.toString(),
|
|
218
231
|
},
|
|
219
232
|
},
|
|
@@ -240,9 +253,9 @@ export class MergedProfileSource implements ProfileSource {
|
|
|
240
253
|
}
|
|
241
254
|
|
|
242
255
|
let timePart = '';
|
|
243
|
-
if (this.mergeFrom !==
|
|
256
|
+
if (this.mergeFrom !== 0n) {
|
|
244
257
|
timePart = `over ${formatDuration({
|
|
245
|
-
|
|
258
|
+
nanos: Number(this.mergeTo - this.mergeFrom),
|
|
246
259
|
})} from ${formatDate(this.mergeFrom, timeFormat(timezone), timezone)} to ${formatDate(
|
|
247
260
|
this.mergeTo,
|
|
248
261
|
timeFormat(timezone),
|
|
@@ -252,4 +265,8 @@ export class MergedProfileSource implements ProfileSource {
|
|
|
252
265
|
|
|
253
266
|
return `Merged profiles${queryPart}${timePart}`;
|
|
254
267
|
}
|
|
268
|
+
|
|
269
|
+
toKey(): string {
|
|
270
|
+
return `${this.mergeFrom.toString()}-${this.mergeTo.toString()}-${this.query.toString()}`;
|
|
271
|
+
}
|
|
255
272
|
}
|
package/src/useQuery.tsx
CHANGED