Commit 77b8c2c1 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Always load the metrics the last

Because this could potentially load a model and we shouldn't
load models before all the patches we have in places.
parent 24c9e1e2
# This file was prefixed with zz_ because we want to load it the last!
# See: https://gitlab.com/gitlab-org/gitlab-ce/issues/55611
# Autoload all classes that we want to instrument, and instrument the methods we # Autoload all classes that we want to instrument, and instrument the methods we
# need. This takes the Gitlab::Metrics::Instrumentation module as an argument so # need. This takes the Gitlab::Metrics::Instrumentation module as an argument so
# that we can stub it for testing, as it is only called when metrics are # that we can stub it for testing, as it is only called when metrics are
......
...@@ -35,7 +35,7 @@ Using this method is in general preferred over directly calling the various ...@@ -35,7 +35,7 @@ Using this method is in general preferred over directly calling the various
instrumentation methods. instrumentation methods.
Method instrumentation should be added in the initializer Method instrumentation should be added in the initializer
`config/initializers/8_metrics.rb`. `config/initializers/zz_metrics.rb`.
### Examples ### Examples
......
...@@ -16,7 +16,7 @@ describe 'instrument_classes' do ...@@ -16,7 +16,7 @@ describe 'instrument_classes' do
end end
it 'can autoload and instrument all files' do it 'can autoload and instrument all files' do
require_relative '../../config/initializers/8_metrics' require_relative '../../config/initializers/zz_metrics'
expect { instrument_classes(config) }.not_to raise_error expect { instrument_classes(config) }.not_to raise_error
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment