Skip to content

Commit c57bc41

Browse files
chore: update boot progress schema
1 parent 455b577 commit c57bc41

File tree

5 files changed

+108
-184
lines changed

5 files changed

+108
-184
lines changed

src/api/entities.ts

Lines changed: 21 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -239,134 +239,66 @@ export const BootPhaseEnum = bootPhaseSchema.enum;
239239

240240
export const bootProgressSchema = z.object({
241241
phase: bootPhaseSchema,
242-
total_elapsed: z.number(),
243-
244-
// joining_gossip
245-
joining_gossip_elapsed: z.number().nullable(),
246-
247-
// loading_full_snapshot
248-
loading_full_snapshot_reset_cnt: z.number().nullable().optional(),
242+
joining_gossip_elapsed_seconds: z.number().nullable().optional(),
243+
loading_full_snapshot_elapsed_seconds: z.number().nullable().optional(),
244+
loading_full_snapshot_reset_count: z.number().nullable().optional(),
249245
loading_full_snapshot_slot: z.number().nullable().optional(),
250-
loading_full_snapshot_peer: z.string().nullable().optional(),
251-
loading_full_snapshot_peer_identity: z.string().nullable().optional(),
252-
loading_full_snapshot_total_bytes: z.coerce.number().nullable().optional(),
253-
loading_full_snapshot_elapsed: z.number().nullable().optional(),
254-
loading_full_snapshot_read_bytes: z.coerce.number().nullable().optional(),
255-
loading_full_snapshot_read_throughput: z.number().nullable().optional(),
256-
loading_full_snapshot_current_bytes: z.coerce.number().nullable().optional(),
257-
loading_full_snapshot_read_remaining: z.number().nullable().optional(),
258-
loading_full_snapshot_read_elapsed: z.number().nullable().optional(),
259-
loading_full_snapshot_read_path: z.string().nullable().optional(),
260-
loading_full_snapshot_decompress_bytes: z.number().nullable().optional(),
261-
loading_full_snapshot_decompress_elapsed: z.number().nullable().optional(),
262-
loading_full_snapshot_decompress_throughput: z.number().nullable().optional(),
263-
loading_full_snapshot_decompress_compressed_bytes: z.coerce
264-
.number()
265-
.nullable()
266-
.optional(),
267-
loading_full_snapshot_decompress_decompressed_bytes: z.coerce
268-
.number()
269-
.nullable()
270-
.optional(),
271-
loading_full_snapshot_decompress_remaining: z.number().nullable().optional(),
272-
loading_full_snapshot_insert_bytes: z.coerce.number().nullable().optional(),
273-
loading_full_snapshot_insert_throughput: z.number().nullable().optional(),
274-
loading_full_snapshot_insert_remaining: z.number().nullable().optional(),
275-
loading_full_snapshot_insert_path: z.string().nullable().optional(),
276-
loading_full_snapshot_insert_elapsed: z.number().nullable().optional(),
277-
loading_full_snapshot_insert_accounts_throughput: z
278-
.number()
279-
.nullable()
280-
.optional(),
281-
loading_full_snapshot_insert_accounts_current: z
282-
.number()
283-
.nullable()
284-
.optional(),
285-
286-
// loading_incremental_snapshot
287-
loading_incremental_snapshot_reset_cnt: z.number().nullable().optional(),
288-
loading_incremental_snapshot_peer_identity: z.string().nullable().optional(),
289-
loading_incremental_snapshot_slot: z.number().nullable().optional(),
290-
loading_incremental_snapshot_peer: z.string().nullable().optional(),
291-
loading_incremental_snapshot_total_bytes: z.coerce
246+
loading_full_snapshot_total_bytes_compressed: z.coerce
292247
.number()
293248
.nullable()
294249
.optional(),
295-
loading_incremental_snapshot_elapsed: z.number().nullable().optional(),
296-
loading_incremental_snapshot_read_bytes: z.coerce
250+
loading_full_snapshot_read_bytes_compressed: z.coerce
297251
.number()
298252
.nullable()
299253
.optional(),
300-
loading_incremental_snapshot_read_elapsed: z.number().nullable().optional(),
301-
loading_incremental_snapshot_read_throughput: z
254+
loading_full_snapshot_read_path: z.string().nullable().optional(),
255+
loading_full_snapshot_decompress_bytes_decompressed: z.coerce
302256
.number()
303257
.nullable()
304258
.optional(),
305-
loading_incremental_snapshot_read_remaining: z.number().nullable().optional(),
306-
loading_incremental_snapshot_read_path: z.string().nullable().optional(),
307-
loading_incremental_snapshot_current_bytes: z.coerce
259+
loading_full_snapshot_decompress_bytes_compressed: z.coerce
308260
.number()
309261
.nullable()
310262
.optional(),
311-
loading_incremental_snapshot_decompress_bytes: z.coerce
263+
loading_full_snapshot_insert_bytes_decompressed: z.coerce
312264
.number()
313265
.nullable()
314266
.optional(),
267+
loading_full_snapshot_insert_accounts: z.number().nullable().optional(),
315268

316-
loading_incremental_snapshot_decompress_elapsed: z
269+
loading_incremental_snapshot_elapsed_seconds: z
317270
.number()
318271
.nullable()
319272
.optional(),
320-
loading_incremental_snapshot_decompress_throughput: z
321-
.number()
322-
.nullable()
323-
.optional(),
324-
loading_incremental_snapshot_decompress_compressed_bytes: z.coerce
325-
.number()
326-
.nullable()
327-
.optional(),
328-
loading_incremental_snapshot_decompress_decompressed_bytes: z.coerce
329-
.number()
330-
.nullable()
331-
.optional(),
332-
loading_incremental_snapshot_decompress_remaining: z
273+
loading_incremental_snapshot_reset_count: z.number().nullable().optional(),
274+
loading_incremental_snapshot_slot: z.number().nullable().optional(),
275+
loading_incremental_snapshot_total_bytes_compressed: z.coerce
333276
.number()
334277
.nullable()
335278
.optional(),
336-
loading_incremental_snapshot_insert_bytes: z.coerce
279+
loading_incremental_snapshot_read_bytes_compressed: z.coerce
337280
.number()
338281
.nullable()
339282
.optional(),
340-
loading_incremental_snapshot_insert_elapsed: z.number().nullable().optional(),
341-
loading_incremental_snapshot_insert_throughput: z
283+
loading_incremental_snapshot_read_path: z.string().nullable().optional(),
284+
loading_incremental_snapshot_decompress_bytes_decompressed: z.coerce
342285
.number()
343286
.nullable()
344287
.optional(),
345-
loading_incremental_snapshot_insert_remaining: z
288+
loading_incremental_snapshot_decompress_bytes_compressed: z.coerce
346289
.number()
347290
.nullable()
348291
.optional(),
349-
loading_incremental_snapshot_insert_path: z.string().nullable().optional(),
350-
loading_incremental_snapshot_insert_accounts_throughput: z
292+
loading_incremental_snapshot_insert_bytes_decompressed: z.coerce
351293
.number()
352294
.nullable()
353295
.optional(),
354-
loading_incremental_snapshot_insert_accounts_current: z
296+
loading_incremental_snapshot_insert_accounts: z
355297
.number()
356298
.nullable()
357299
.optional(),
358300

359-
// catching_up
360-
catching_up_elapsed: z.number().nullable().optional(),
361-
catching_up_min_turbine_slot: z.number().nullable().optional(),
362-
catching_up_max_turbine_slot: z.number().nullable().optional(),
363-
catching_up_min_repair_slot: z.number().nullable().optional(),
364-
catching_up_max_repair_slot: z.number().nullable().optional(),
365-
catching_up_max_replay_slot: z.number().nullable().optional(),
366-
catching_up_first_turbine_slot: z.number().nullable().optional(),
367-
catching_up_latest_turbine_slot: z.number().nullable().optional(),
368-
catching_up_latest_repair_slot: z.number().nullable().optional(),
369-
catching_up_latest_replay_slot: z.number().nullable().optional(),
301+
catching_up_elapsed_seconds: z.number().nullable().optional(),
370302
});
371303

372304
export const slotTransactionsSchema = z.object({

src/features/StartupProgress/Firedancer/Body.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useAtomValue, useSetAtom } from "jotai";
2-
import { bootProgressAtom } from "../../../api/atoms";
32
import styles from "./body.module.css";
43
import { useEffect } from "react";
54
import {
65
bootProgressPhaseAtom,
6+
bootProgressTotalElapsedAtom,
77
isStartupProgressExpandedAtom,
88
showStartupProgressAtom,
99
} from "../atoms";
@@ -94,7 +94,7 @@ function BootProgressContent({ phase }: BootProgressContentProps) {
9494
}
9595

9696
function TotalDuration() {
97-
const totalElapsed = useAtomValue(bootProgressAtom)?.total_elapsed;
97+
const totalElapsed = useAtomValue(bootProgressTotalElapsedAtom);
9898
const duration = totalElapsed == null ? "--" : formatDuration(totalElapsed);
9999
return <Text>{duration}</Text>;
100100
}

src/features/StartupProgress/Firedancer/SnapshotLoadingCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ const MAX_THROUGHPUT = 300000000;
99

1010
interface SnapshotLoadingCardProps {
1111
title: string;
12-
estimatedRemaining?: number | null;
13-
throughput?: number | null;
1412
completed?: number | null;
1513
total?: number | null;
1614
}
1715
export function SnapshotLoadingCard({
1816
title,
19-
throughput,
2017
completed,
2118
total,
2219
}: SnapshotLoadingCardProps) {
20+
// TODO: calculate throughput
21+
const throughput = 0;
22+
2323
const throughputObj = throughput == null ? undefined : byteSize(throughput);
2424
const completedObj = completed == null ? undefined : byteSize(completed);
2525
const totalObj = total == null ? undefined : byteSize(total);

src/features/StartupProgress/Firedancer/SnapshotProgress.tsx

Lines changed: 41 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,42 @@ const rowGap = "5";
1010

1111
function getSnapshotValues(bootProgress: BootProgress) {
1212
const {
13-
loading_full_snapshot_total_bytes,
14-
loading_full_snapshot_read_remaining,
15-
loading_full_snapshot_read_bytes,
16-
loading_full_snapshot_read_throughput,
13+
loading_full_snapshot_total_bytes_compressed,
14+
loading_full_snapshot_read_bytes_compressed,
15+
loading_full_snapshot_decompress_bytes_compressed,
16+
loading_full_snapshot_decompress_bytes_decompressed,
17+
loading_full_snapshot_insert_bytes_decompressed,
1718

18-
loading_full_snapshot_decompress_remaining,
19-
loading_full_snapshot_decompress_throughput,
20-
loading_full_snapshot_decompress_compressed_bytes,
21-
loading_full_snapshot_decompress_decompressed_bytes,
22-
23-
loading_full_snapshot_insert_remaining,
24-
loading_full_snapshot_insert_bytes,
25-
loading_full_snapshot_insert_throughput,
26-
27-
loading_incremental_snapshot_total_bytes,
28-
loading_incremental_snapshot_read_remaining,
29-
loading_incremental_snapshot_read_bytes,
30-
loading_incremental_snapshot_read_throughput,
31-
32-
loading_incremental_snapshot_decompress_remaining,
33-
loading_incremental_snapshot_decompress_throughput,
34-
loading_incremental_snapshot_decompress_compressed_bytes,
35-
loading_incremental_snapshot_decompress_decompressed_bytes,
36-
37-
loading_incremental_snapshot_insert_remaining,
38-
loading_incremental_snapshot_insert_bytes,
39-
loading_incremental_snapshot_insert_throughput,
19+
loading_incremental_snapshot_total_bytes_compressed,
20+
loading_incremental_snapshot_read_bytes_compressed,
21+
loading_incremental_snapshot_decompress_bytes_compressed,
22+
loading_incremental_snapshot_decompress_bytes_decompressed,
23+
loading_incremental_snapshot_insert_bytes_decompressed,
4024
} = bootProgress;
4125

4226
if (
4327
bootProgress.phase === BootPhaseEnum.loading_full_snapshot ||
44-
!loading_incremental_snapshot_total_bytes
28+
!loading_incremental_snapshot_total_bytes_compressed
4529
) {
4630
return {
47-
total_bytes: loading_full_snapshot_total_bytes,
48-
read_remaining: loading_full_snapshot_read_remaining,
49-
read_bytes: loading_full_snapshot_read_bytes,
50-
read_throughput: loading_full_snapshot_read_throughput,
51-
decompress_remaining: loading_full_snapshot_decompress_remaining,
52-
decompress_throughput: loading_full_snapshot_decompress_throughput,
53-
decompress_compressed_bytes:
54-
loading_full_snapshot_decompress_compressed_bytes,
55-
decompress_decompressed_bytes:
56-
loading_full_snapshot_decompress_decompressed_bytes,
57-
insert_remaining: loading_full_snapshot_insert_remaining,
58-
insert_bytes: loading_full_snapshot_insert_bytes,
59-
insert_throughput: loading_full_snapshot_insert_throughput,
31+
totalBytes: loading_full_snapshot_total_bytes_compressed,
32+
readBytes: loading_full_snapshot_read_bytes_compressed,
33+
decompressCompressedBytes:
34+
loading_full_snapshot_decompress_bytes_compressed,
35+
decompressDecompressedBytes:
36+
loading_full_snapshot_decompress_bytes_decompressed,
37+
insertBytes: loading_full_snapshot_insert_bytes_decompressed,
6038
};
6139
}
6240

6341
return {
64-
total_bytes: loading_incremental_snapshot_total_bytes,
65-
read_remaining: loading_incremental_snapshot_read_remaining,
66-
read_bytes: loading_incremental_snapshot_read_bytes,
67-
read_throughput: loading_incremental_snapshot_read_throughput,
68-
decompress_remaining: loading_incremental_snapshot_decompress_remaining,
69-
decompress_throughput: loading_incremental_snapshot_decompress_throughput,
70-
decompress_compressed_bytes:
71-
loading_incremental_snapshot_decompress_compressed_bytes,
72-
decompress_decompressed_bytes:
73-
loading_incremental_snapshot_decompress_decompressed_bytes,
74-
insert_remaining: loading_incremental_snapshot_insert_remaining,
75-
insert_bytes: loading_incremental_snapshot_insert_bytes,
76-
insert_throughput: loading_incremental_snapshot_insert_throughput,
42+
totalBytes: loading_incremental_snapshot_total_bytes_compressed,
43+
readBytes: loading_incremental_snapshot_read_bytes_compressed,
44+
decompressCompressedBytes:
45+
loading_incremental_snapshot_decompress_bytes_compressed,
46+
decompressDecompressedBytes:
47+
loading_incremental_snapshot_decompress_bytes_decompressed,
48+
insertBytes: loading_incremental_snapshot_insert_bytes_decompressed,
7749
};
7850
}
7951

@@ -82,73 +54,60 @@ export function SnapshotProgress() {
8254
if (!bootProgress) return;
8355

8456
const {
85-
total_bytes,
86-
read_remaining,
87-
read_bytes,
88-
read_throughput,
89-
decompress_remaining,
90-
decompress_throughput,
91-
decompress_compressed_bytes,
92-
decompress_decompressed_bytes,
93-
insert_remaining,
94-
insert_bytes,
95-
insert_throughput,
57+
totalBytes,
58+
readBytes,
59+
decompressCompressedBytes,
60+
decompressDecompressedBytes,
61+
insertBytes,
9662
} = getSnapshotValues(bootProgress);
9763

9864
const insertCompletedBytes =
99-
insert_bytes && decompress_compressed_bytes && decompress_decompressed_bytes
100-
? insert_bytes *
101-
(decompress_compressed_bytes / decompress_decompressed_bytes)
65+
insertBytes && decompressCompressedBytes && decompressDecompressedBytes
66+
? insertBytes * (decompressCompressedBytes / decompressDecompressedBytes)
10267
: 0;
10368

10469
return (
10570
<Flex direction="column" gap="40px">
10671
<Flex gap={rowGap}>
10772
<SnapshotLoadingCard
10873
title="Reading"
109-
estimatedRemaining={read_remaining}
110-
throughput={read_throughput}
111-
completed={read_bytes}
112-
total={total_bytes}
74+
completed={readBytes}
75+
total={totalBytes}
11376
/>
11477
<SnapshotSparklineCard
11578
title="CPU Utilization"
11679
tileType="snaprd"
117-
isComplete={!!read_remaining && read_remaining === total_bytes}
80+
isComplete={!!readBytes && readBytes === totalBytes}
11881
/>
11982
</Flex>
12083

12184
<Flex gap={rowGap}>
12285
<SnapshotLoadingCard
12386
title="Decompressing"
124-
estimatedRemaining={decompress_remaining}
125-
throughput={decompress_throughput}
126-
completed={decompress_compressed_bytes}
127-
total={total_bytes}
87+
completed={decompressCompressedBytes}
88+
total={totalBytes}
12889
/>
12990
<SnapshotSparklineCard
13091
title="CPU Utilization"
13192
tileType="snapdc"
13293
isComplete={
133-
!!decompress_compressed_bytes &&
134-
decompress_compressed_bytes === total_bytes
94+
!!decompressCompressedBytes &&
95+
decompressCompressedBytes === totalBytes
13596
}
13697
/>
13798
</Flex>
13899

139100
<Flex gap={rowGap}>
140101
<SnapshotLoadingCard
141102
title="Inserting"
142-
estimatedRemaining={insert_remaining}
143-
throughput={insert_throughput}
144103
completed={insertCompletedBytes}
145-
total={total_bytes}
104+
total={totalBytes}
146105
/>
147106
<SnapshotSparklineCard
148107
title="CPU Utilization"
149108
tileType="snapin"
150109
isComplete={
151-
!!insertCompletedBytes && insertCompletedBytes === total_bytes
110+
!!insertCompletedBytes && insertCompletedBytes === totalBytes
152111
}
153112
/>
154113
</Flex>

0 commit comments

Comments
 (0)