To improve our CI testing we can add a CPU/memory profile capturing for each NSM application via docker target stage. This will allow us to detect memory/cpu regressions or improvements.
Implementation details
Add for each application a new target ci
FROM go as ci
WORKDIR /build
COPY go.mod go.sum ./
COPY ./internal/imports imports
RUN go build ./imports
COPY . .
# TODO: Consider about adding a race flag
RUN go build -tags=ci -o /bin/app .
# TODO: correct this:
ENTRYPOINT ["go", "tool pprof app profile.output"]
Add build tags based main.go for the application that will include import _ "net/http/pprof"
To improve our CI testing we can add a CPU/memory profile capturing for each NSM application via docker target stage. This will allow us to detect memory/cpu regressions or improvements.
Implementation details
ci
import _ "net/http/pprof"
/ci
with --target ciprofile.output
into https://github.com/networkservicemesh/integration-tests/tree/main/extensions/logs on test cleanup as CI artifact.