From 62c4054c77d24976248246b8123b3662a5c181c7 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Tue, 5 Mar 2024 01:50:32 +0530 Subject: [PATCH 1/2] add limit of 100 --- ui/app/api/peers/slots/[name]/route.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/app/api/peers/slots/[name]/route.ts b/ui/app/api/peers/slots/[name]/route.ts index 13f6ac97de..818124b1d6 100644 --- a/ui/app/api/peers/slots/[name]/route.ts +++ b/ui/app/api/peers/slots/[name]/route.ts @@ -42,6 +42,7 @@ export async function GET( gte: new Date(Date.now() - forThePastThisMuchTime), }, }, + take: 100, }); // convert slot_size to string From 63263dd4130b98eda2d9e12cdac1049e2ed7c4c1 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Tue, 5 Mar 2024 02:03:42 +0530 Subject: [PATCH 2/2] add index, remove wal_status fetch --- nexus/catalog/migrations/V20__slot_updated_at.sql | 1 + ui/app/api/peers/slots/[name]/route.ts | 3 --- ui/app/dto/PeersDTO.ts | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) create mode 100644 nexus/catalog/migrations/V20__slot_updated_at.sql diff --git a/nexus/catalog/migrations/V20__slot_updated_at.sql b/nexus/catalog/migrations/V20__slot_updated_at.sql new file mode 100644 index 0000000000..6ef9a50840 --- /dev/null +++ b/nexus/catalog/migrations/V20__slot_updated_at.sql @@ -0,0 +1 @@ +CREATE INDEX index_slot_updated_at ON peerdb_stats.peer_slot_size (updated_at); \ No newline at end of file diff --git a/ui/app/api/peers/slots/[name]/route.ts b/ui/app/api/peers/slots/[name]/route.ts index 818124b1d6..7ba1d943f0 100644 --- a/ui/app/api/peers/slots/[name]/route.ts +++ b/ui/app/api/peers/slots/[name]/route.ts @@ -34,7 +34,6 @@ export async function GET( select: { updated_at: true, slot_size: true, - wal_status: true, }, where: { slot_name: context.params.name, @@ -42,7 +41,6 @@ export async function GET( gte: new Date(Date.now() - forThePastThisMuchTime), }, }, - take: 100, }); // convert slot_size to string @@ -54,7 +52,6 @@ export async function GET( ' ' + lagPoint.updated_at.toLocaleTimeString(), slotSize: lagPoint.slot_size?.toString(), - walStatus: lagPoint.wal_status, }; }); diff --git a/ui/app/dto/PeersDTO.ts b/ui/app/dto/PeersDTO.ts index d1b9720ea5..a015439d83 100644 --- a/ui/app/dto/PeersDTO.ts +++ b/ui/app/dto/PeersDTO.ts @@ -55,5 +55,4 @@ export type PeerSetter = React.Dispatch>; export type SlotLagPoint = { updatedAt: string; slotSize?: string; - walStatus: string | null; };