diff options
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | Gemfile.rails5.lock | 2 | ||||
-rw-r--r-- | changelogs/unreleased/remove-allocations-gem.yml | 5 | ||||
-rw-r--r-- | lib/gitlab/metrics/samplers/influx_sampler.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/metrics/samplers/ruby_sampler.rb | 10 | ||||
-rw-r--r-- | spec/lib/gitlab/metrics/samplers/influx_sampler_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb | 4 |
8 files changed, 5 insertions, 29 deletions
@@ -299,7 +299,6 @@ gem 'peek-sidekiq', '~> 1.0.3' # Metrics group :metrics do - gem 'allocations', '~> 1.0', require: false, platform: :mri gem 'method_source', '~> 0.8', require: false gem 'influxdb', '~> 0.2', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 8d508cc0f39..8960d993b0f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,7 +49,6 @@ GEM public_suffix (>= 2.0.2, < 4.0) aes_key_wrap (1.0.1) akismet (2.0.0) - allocations (1.0.5) arel (6.0.4) asana (0.6.0) faraday (~> 0.9) @@ -974,7 +973,6 @@ DEPENDENCIES acts-as-taggable-on (~> 5.0) addressable (~> 2.5.2) akismet (~> 2.0) - allocations (~> 1.0) asana (~> 0.6.0) asciidoctor (~> 1.5.6) asciidoctor-plantuml (= 0.0.8) diff --git a/Gemfile.rails5.lock b/Gemfile.rails5.lock index fd560290d6c..679318b9be5 100644 --- a/Gemfile.rails5.lock +++ b/Gemfile.rails5.lock @@ -52,7 +52,6 @@ GEM public_suffix (>= 2.0.2, < 4.0) aes_key_wrap (1.0.1) akismet (2.0.0) - allocations (1.0.5) arel (7.1.4) asana (0.6.0) faraday (~> 0.9) @@ -984,7 +983,6 @@ DEPENDENCIES acts-as-taggable-on (~> 5.0) addressable (~> 2.5.2) akismet (~> 2.0) - allocations (~> 1.0) asana (~> 0.6.0) asciidoctor (~> 1.5.6) asciidoctor-plantuml (= 0.0.8) diff --git a/changelogs/unreleased/remove-allocations-gem.yml b/changelogs/unreleased/remove-allocations-gem.yml new file mode 100644 index 00000000000..e809fd26701 --- /dev/null +++ b/changelogs/unreleased/remove-allocations-gem.yml @@ -0,0 +1,5 @@ +--- +title: Remove remaining traces of the Allocations Gem +merge_request: +author: +type: changed diff --git a/lib/gitlab/metrics/samplers/influx_sampler.rb b/lib/gitlab/metrics/samplers/influx_sampler.rb index 5a0f7f28fc8..ad97632e4eb 100644 --- a/lib/gitlab/metrics/samplers/influx_sampler.rb +++ b/lib/gitlab/metrics/samplers/influx_sampler.rb @@ -16,12 +16,6 @@ module Gitlab @last_minor_gc = Delta.new(GC.stat[:minor_gc_count]) @last_major_gc = Delta.new(GC.stat[:major_gc_count]) - - if Gitlab::Metrics.mri? - require 'allocations' - - Allocations.start - end end def sample diff --git a/lib/gitlab/metrics/samplers/ruby_sampler.rb b/lib/gitlab/metrics/samplers/ruby_sampler.rb index 4e1ea62351f..a39b3bc158c 100644 --- a/lib/gitlab/metrics/samplers/ruby_sampler.rb +++ b/lib/gitlab/metrics/samplers/ruby_sampler.rb @@ -20,16 +20,6 @@ module Gitlab {} end - def initialize(interval) - super(interval) - - if Metrics.mri? - require 'allocations' - - Allocations.start - end - end - def init_metrics metrics = {} metrics[:sampler_duration] = Metrics.histogram(with_prefix(:sampler_duration, :seconds), 'Sampler time', { worker: nil }) diff --git a/spec/lib/gitlab/metrics/samplers/influx_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/influx_sampler_spec.rb index f66451c5188..81954fcf8c5 100644 --- a/spec/lib/gitlab/metrics/samplers/influx_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/influx_sampler_spec.rb @@ -3,10 +3,6 @@ require 'spec_helper' describe Gitlab::Metrics::Samplers::InfluxSampler do let(:sampler) { described_class.new(5) } - after do - Allocations.stop if Gitlab::Metrics.mri? - end - describe '#start' do it 'runs once and gathers a sample at a given interval' do expect(sampler).to receive(:sleep).with(a_kind_of(Numeric)).twice diff --git a/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb index 54781dd52fc..091645ee86f 100644 --- a/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb @@ -8,10 +8,6 @@ describe Gitlab::Metrics::Samplers::RubySampler do allow(Gitlab::Metrics::NullMetric).to receive(:instance).and_return(null_metric) end - after do - Allocations.stop if Gitlab::Metrics.mri? - end - describe '#sample' do it 'samples various statistics' do expect(Gitlab::Metrics::System).to receive(:memory_usage) |