From 2e6af398d6c6f0498a3cecfb79a210bd21f794d5 Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Wed, 4 Sep 2024 15:56:34 -0700 Subject: [PATCH 1/3] add timing to response logs --- backend/src/middleware/req.res.logger.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/middleware/req.res.logger.ts b/backend/src/middleware/req.res.logger.ts index 7ce4d43..383a10b 100644 --- a/backend/src/middleware/req.res.logger.ts +++ b/backend/src/middleware/req.res.logger.ts @@ -7,13 +7,16 @@ export class HTTPLoggerMiddleware implements NestMiddleware { use(request: Request, response: Response, next: NextFunction): void { const { method, originalUrl } = request; + const start = Date.now(); + response.on("finish", () => { const { statusCode } = response; const contentLength = response.get("content-length") || '-'; - const hostedHttpLogFormat = `${method} ${originalUrl} ${statusCode} ${contentLength} - ${request.get( - "user-agent" - )}`; + const timeTaken = Date.now() - start; + const hostedHttpLogFormat = `${method} | ${originalUrl} | ${statusCode} | ${contentLength} | ${request.get( + "user-agent")} | ${timeTaken}ms`; + this.logger.log(hostedHttpLogFormat); }); next(); From 6ddbb0bf6f96bb5973bbba182cd45e9bed9c3198 Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Wed, 4 Sep 2024 15:57:47 -0700 Subject: [PATCH 2/3] fix markdown --- .github/workflows/pr-validate.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml index 4736339..f7a5244 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/pr-validate.yml @@ -15,8 +15,7 @@ jobs: uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-validate.yml@v0.6.1 with: markdown_links: | - - [Frontend](https://${{ github.event.repository.name }}-${{ github.event.number }}-frontend.apps.silver.devops.gov.bc.ca) - - [Backend](https://${{ github.event.repository.name }}-${{ github.event.number }}-frontend.apps.silver.devops.gov.bc.ca/api) + - [Backend](https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.apps.silver.devops.gov.bc.ca/api/docs) results: name: Validate Results From 01b91a62e6c9081281a4633b20b623ced65ede0c Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Wed, 4 Sep 2024 18:05:08 -0700 Subject: [PATCH 3/3] pr close --- .github/workflows/pr-close.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-close.yml b/.github/workflows/pr-close.yml index 36a3bbb..3ab0ff2 100644 --- a/.github/workflows/pr-close.yml +++ b/.github/workflows/pr-close.yml @@ -12,10 +12,17 @@ concurrency: jobs: cleanup: name: Cleanup and Images - uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-close.yml@v0.6.1 + uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-close.yml@main secrets: oc_namespace: ${{ secrets.OC_NAMESPACE }} oc_token: ${{ secrets.OC_TOKEN }} with: cleanup: helm packages: backend + remove_pvc: | + redis-data-${{ github.event.repository.name }}-${{ github.event.number }}-redis-node-0, + redis-data-${{ github.event.repository.name }}-${{ github.event.number }}-redis-node-1, + redis-data-${{ github.event.repository.name }}-${{ github.event.number }}-redis-node-2, + sentinel-data-${{ github.event.repository.name }}-${{ github.event.number }}-redis-node-0, + sentinel-data-${{ github.event.repository.name }}-${{ github.event.number }}-redis-node-1, + sentinel-data-${{ github.event.repository.name }}-${{ github.event.number }}-redis-node-2