summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAleksei Lipniagov <alipniagov@gitlab.com>2019-08-02 09:04:32 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-08-02 09:04:32 +0000
commit1f9edb7c4a393a6ebe78e6f98e46515ad655cece (patch)
treea3eb7ca80f5a9d51142a91fc44f4f244f23a301f /config
parentebdd3a233e1e5dd252eef6c4ba5f1da311fe68e2 (diff)
downloadgitlab-ce-1f9edb7c4a393a6ebe78e6f98e46515ad655cece.tar.gz
Call `GC::Profiler.clear` only in one place
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 has the wrong assumption it is the only object who calls `GC::Profiler.clear` and thus could rely on the gathered results between such calls. We should ensure that `GC::Profiler.total_time` is called only in one place making it possible to rely on accumulated data between such wipes. Also, we need to track the amount of profiler reports we lost.
Diffstat (limited to 'config')
-rw-r--r--config/initializers/peek.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb
index 4a2b7931f30..b6c7f1ff4fc 100644
--- a/config/initializers/peek.rb
+++ b/config/initializers/peek.rb
@@ -9,5 +9,10 @@ Peek.into Peek::Views::ActiveRecord
Peek.into Peek::Views::Gitaly
Peek.into Peek::Views::RedisDetailed
Peek.into Peek::Views::Rugged
-Peek.into Peek::Views::GC
+
+# `Peek::Views::GC` is currently disabled in production, as it runs with every request
+# even if PerformanceBar is inactive and clears `GC::Profiler` reports we need for metrics.
+# Check https://gitlab.com/gitlab-org/gitlab-ce/issues/65455
+Peek.into Peek::Views::GC if Rails.env.development?
+
Peek.into Peek::Views::Tracing if Labkit::Tracing.tracing_url_enabled?