Skip to content

Trace method calls

What does this MR do and why?

Some workers are doing a lot and it would be great to split these up or to increase the performance of them, an example is UpdateMergeRequestsWorker.

The problem is, it's difficult to know where they are spending their execution time given the large number of different setups of projects that exist. We have the flamegraph but this is good for more specific examples rather than giving us a good representation of how the average worker spends their time.

It would be good to trace an X percentage of the worker's selected method calls, and log these in order to help with the debugging process.

I would like to add a lib in order to time certain method calls that we choose.

Questions:

  • Is there existing tooling that we have for this?
  • Is there a better way to implement this?
  • How would this impact performance?
    • Give we would only be tracing a small number of the workers, it shouldn't be too bad.
  • Can we send our data to grafana? Will there be too many metric's?
    • Can we send to kibana?

Related to: https://gitlab.com/gitlab-org/gitlab/-/issues/548046

Edited by Marc Shaw

Merge request reports

Loading