Skip to content

Fix GC::Profiler metrics fetching

Aleksei Lipniagov requested to merge 63571-fix-gc-profiler-data-being-wiped into master

What does this MR do?

Previously, both InfluxSampler and RubySampler were relying on the GC::Profiler.total_time data which is the sum over the list of captured GC events.

Also, both samplers asynchronously called GC::Profiler.clear which led to incorrect metric data because each sampler had the wrong assumption it was the only object who called GC::Profiler.clear and thus could rely on the gathered results between calls.

We should ensure that GC::Profiler.clear is called only in one place making it possible to rely on accumulated data between profiler wipes.

The approach suggested by Kamil: https://gitlab.com/gitlab-org/gitlab-ce/issues/63571#note_197621957

Does this MR meet the acceptance criteria?

Conformity

Related to #63571 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports