Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add process startup time #291

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions backend-go/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"time"

_ "github.com/bcgov/quickstart-openshift-backends/backend-go/docs"
"github.com/bcgov/quickstart-openshift-backends/backend-go/src"
"github.com/bcgov/quickstart-openshift-backends/backend-go/src/v1/structs"
Expand All @@ -10,7 +12,10 @@ import (
"github.com/sirupsen/logrus"
)

var startTime time.Time

func init() {
startTime = time.Now()
_ = mapper.Register(&structs.User{})
_ = mapper.Register(&structs.UserAddress{})
}
Expand All @@ -22,4 +27,6 @@ func main() {
logrus.Fatalf("Error: %v", err)
return
}

logrus.Infof("Process startup took %s", time.Since(startTime))
}
1 change: 1 addition & 0 deletions backend-java/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ quarkus.flyway.enabled=true
quarkus.flyway.baseline-on-migrate=true
quarkus.flyway.baseline-version=1
quarkus.flyway.clean-on-validation-error=true
quarkus.flyway.connect-retries=10
quarkus.swagger-ui.always-include=true
# this should fix the compatibility issue
quarkus.native.additional-build-args=-march=compatibility
4 changes: 3 additions & 1 deletion backend-py/src/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging

import os
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from .v1.routes.user_routes import router as user_router
Expand Down Expand Up @@ -55,3 +55,5 @@ def filter(self, record: logging.LogRecord) -> bool:

# Add filter to the logger
logging.getLogger("uvicorn.access").addFilter(EndpointFilter())
t = os.popen('uptime -p').read()[:-1]
logging.info(f"process start up took {t}")
Loading