Log cpu user time to structured logging
As part of the ongoing effort to discover CPU intensive endpoints #30567 (closed) to aid in PUMA rollout, in this MR we are logging cpu_s
to structured logging.
As discussed in #31887 (closed) we would need getrusage(RUSAGE_THREAD)
and till #31891 (closed) is resolved we can get user_s
alone using
Process.clock_gettime(Process::CLOCK_THREAD_CPUTIME_ID)
Also to note:
We are using Lograge and it logs at the end of the controller and the time spent in the middleware after the controller is not captured. We acknowledge the limitations of Lograge and will fix it in a separate issue as discussed in gitlab-foss!31942 (comment 217619089)
This MR closes #30567 (closed)
Does this MR meet the acceptance criteria?
Conformity
Edited by 🤖 GitLab Bot 🤖