From f597f52f00e330e8fb16ac58d96c45dd0f33354c Mon Sep 17 00:00:00 2001 From: RickyRAV <101335214+RickyRAV@users.noreply.github.com> Date: Wed, 8 Jan 2025 08:02:11 +0100 Subject: [PATCH] comment performance logs [CI Skip] --- .../src/app/api/v1/rooms/[roomCode]/route.ts | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/dashboard/src/app/api/v1/rooms/[roomCode]/route.ts b/apps/dashboard/src/app/api/v1/rooms/[roomCode]/route.ts index 1388463..3ca5807 100644 --- a/apps/dashboard/src/app/api/v1/rooms/[roomCode]/route.ts +++ b/apps/dashboard/src/app/api/v1/rooms/[roomCode]/route.ts @@ -12,36 +12,36 @@ export const GET = async ( request: NextRequest, { params }: { params: { roomCode: string } } ) => { - const startTime = performance.now(); +// const startTime = performance.now(); try { - console.log("Starting validation..."); - const validationStart = performance.now(); + // console.log("Starting validation..."); + // const validationStart = performance.now(); const validatedParams = roomSchema.parse(params); - console.log(`Validation took: ${performance.now() - validationStart}ms`); + // console.log(`Validation took: ${performance.now() - validationStart}ms`); - console.log("Starting DB query..."); - const queryStart = performance.now(); + // console.log("Starting DB query..."); + // const queryStart = performance.now(); const room = await db .select({ max_players: rooms.maxPlayers }) .from(rooms) .where(eq(rooms.code, validatedParams.roomCode)) .limit(1); - console.log(`DB query took: ${performance.now() - queryStart}ms`); + // console.log(`DB query took: ${performance.now() - queryStart}ms`); if (!room[0]) { return NextResponse.json({ error: "Room not found" }, { status: 404 }); } - console.log("Starting response validation..."); - const responseValidationStart = performance.now(); + // console.log("Starting response validation..."); + // const responseValidationStart = performance.now(); const validatedResponse = roomResponseSchema.parse(room[0]); - console.log( - `Response validation took: ${ - performance.now() - responseValidationStart - }ms` - ); + // console.log( + // `Response validation took: ${ + // performance.now() - responseValidationStart + // }ms` + // ); - console.log(`Total time: ${performance.now() - startTime}ms`); + // console.log(`Total time: ${performance.now() - startTime}ms`); return NextResponse.json(validatedResponse); } catch (error) { if (error instanceof z.ZodError) {