diff options
author | Paweł Chojnacki <pawel@chojnacki.ws> | 2017-07-04 15:28:34 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-04 15:28:34 +0000 |
commit | 26ac691a688cb569a7345d8f31a406d467240bb2 (patch) | |
tree | f9922c6175116dd1ba0b2b5a2481c173d4a85951 /spec/initializers | |
parent | 53c626bc8daff623ac4528dd964bc823458345e0 (diff) | |
download | gitlab-ce-26ac691a688cb569a7345d8f31a406d467240bb2.tar.gz |
Instrument Unicorn with Ruby exporter
Diffstat (limited to 'spec/initializers')
-rw-r--r-- | spec/initializers/8_metrics_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/initializers/8_metrics_spec.rb b/spec/initializers/8_metrics_spec.rb index a507d7f7f2b..d4189f902fd 100644 --- a/spec/initializers/8_metrics_spec.rb +++ b/spec/initializers/8_metrics_spec.rb @@ -1,17 +1,25 @@ require 'spec_helper' -require_relative '../../config/initializers/8_metrics' describe 'instrument_classes', lib: true do let(:config) { double(:config) } + let(:unicorn_sampler) { double(:unicorn_sampler) } + let(:influx_sampler) { double(:influx_sampler) } + before do allow(config).to receive(:instrument_method) allow(config).to receive(:instrument_methods) allow(config).to receive(:instrument_instance_method) allow(config).to receive(:instrument_instance_methods) + allow(Gitlab::Metrics::UnicornSampler).to receive(:initialize_instance).and_return(unicorn_sampler) + allow(Gitlab::Metrics::InfluxSampler).to receive(:initialize_instance).and_return(influx_sampler) + allow(unicorn_sampler).to receive(:start) + allow(influx_sampler).to receive(:start) + allow(Gitlab::Application).to receive(:configure) end it 'can autoload and instrument all files' do + require_relative '../../config/initializers/8_metrics' expect { instrument_classes(config) }.not_to raise_error end end |