Fix GC::Profiler metrics fetching
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
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Related to #63571 (closed)
Edited by 🤖 GitLab Bot 🤖