Skip to content

Commit

Permalink
add index, remove wal_status fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Mar 4, 2024
1 parent 62c4054 commit 63263dd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions nexus/catalog/migrations/V20__slot_updated_at.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_slot_updated_at ON peerdb_stats.peer_slot_size (updated_at);
3 changes: 0 additions & 3 deletions ui/app/api/peers/slots/[name]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ export async function GET(
select: {
updated_at: true,
slot_size: true,
wal_status: true,
},
where: {
slot_name: context.params.name,
updated_at: {
gte: new Date(Date.now() - forThePastThisMuchTime),
},
},
take: 100,
});

// convert slot_size to string
Expand All @@ -54,7 +52,6 @@ export async function GET(
' ' +
lagPoint.updated_at.toLocaleTimeString(),
slotSize: lagPoint.slot_size?.toString(),
walStatus: lagPoint.wal_status,
};
});

Expand Down
1 change: 0 additions & 1 deletion ui/app/dto/PeersDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ export type PeerSetter = React.Dispatch<React.SetStateAction<PeerConfig>>;
export type SlotLagPoint = {
updatedAt: string;
slotSize?: string;
walStatus: string | null;
};

0 comments on commit 63263dd

Please sign in to comment.