summaryrefslogtreecommitdiff
path: root/lib/gitlab/metrics/sampler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/metrics/sampler.rb')
-rw-r--r--lib/gitlab/metrics/sampler.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/metrics/sampler.rb b/lib/gitlab/metrics/sampler.rb
index fc709222a9b..0000450d9bb 100644
--- a/lib/gitlab/metrics/sampler.rb
+++ b/lib/gitlab/metrics/sampler.rb
@@ -66,7 +66,11 @@ module Gitlab
def sample_objects
sample = Allocations.to_hash
counts = sample.each_with_object({}) do |(klass, count), hash|
- hash[klass.name] = count
+ name = klass.name
+
+ next unless name
+
+ hash[name] = count
end
# Symbols aren't allocated so we'll need to add those manually.