Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-12-11 08:48:13 +0300
committerStan Hu <stanhu@gmail.com>2017-12-11 08:53:28 +0300
commite1a8e5a509fc11c1373367f7399da6c12b51db39 (patch)
treea2955fb7917a14a54fc0cf2cabbbb81a0985268c /lib/gitlab/metrics/samplers
parent806a68a81f1baeed07c146b1b5d9eb77796c46ba (diff)
Remove allocation tracking code from InfluxDB sampler for performance
On GitLab.com, InfluxSampler#sample_objects appears to take 1.2 s or so to iterate through 1059 objects. This had led to delays of a couple hundred milliseconds in processing in the main thread. Remove this code since it's not really being used. Closes gitlab-com/infrastructure#3250
Diffstat (limited to 'lib/gitlab/metrics/samplers')
-rw-r--r--lib/gitlab/metrics/samplers/influx_sampler.rb24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/gitlab/metrics/samplers/influx_sampler.rb b/lib/gitlab/metrics/samplers/influx_sampler.rb
index f4f9b5ca792..5a0f7f28fc8 100644
--- a/lib/gitlab/metrics/samplers/influx_sampler.rb
+++ b/lib/gitlab/metrics/samplers/influx_sampler.rb
@@ -27,7 +27,6 @@ module Gitlab
def sample
sample_memory_usage
sample_file_descriptors
- sample_objects
sample_gc
flush
@@ -48,29 +47,6 @@ module Gitlab
add_metric('file_descriptors', value: System.file_descriptor_count)
end
- if Metrics.mri?
- def sample_objects
- sample = Allocations.to_hash
- counts = sample.each_with_object({}) do |(klass, count), hash|
- name = klass.name
-
- next unless name
-
- hash[name] = count
- end
-
- # Symbols aren't allocated so we'll need to add those manually.
- counts['Symbol'] = Symbol.all_symbols.length
-
- counts.each do |name, count|
- add_metric('object_counts', { count: count }, type: name)
- end
- end
- else
- def sample_objects
- end
- end
-
def sample_gc
time = GC::Profiler.total_time * 1000.0
stats = GC.stat.merge(total_time: time)