summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-06-15 08:27:50 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-06-15 08:27:50 +0000
commit44e5f57b1ea0e43cb27c9ac080839949ab8485d1 (patch)
treecb70f73617be8177256f9f08c8efdf4560f11583
parentd348702b4f3b746565cc2ff1206479e639bae543 (diff)
parent54c0c0cd170f6c4be8242428f409950e16fcea91 (diff)
downloadgitlab-ce-44e5f57b1ea0e43cb27c9ac080839949ab8485d1.tar.gz
Merge branch 'instrument-merge-request-diff-load-commits' into 'master'
Instrument MergeRequestDiff#load_commits See merge request !12162
-rw-r--r--changelogs/unreleased/instrument-merge-request-diff-load-commits.yml4
-rw-r--r--config/initializers/8_metrics.rb3
-rw-r--r--spec/initializers/8_metrics_spec.rb1
3 files changed, 8 insertions, 0 deletions
diff --git a/changelogs/unreleased/instrument-merge-request-diff-load-commits.yml b/changelogs/unreleased/instrument-merge-request-diff-load-commits.yml
new file mode 100644
index 00000000000..916b182a48b
--- /dev/null
+++ b/changelogs/unreleased/instrument-merge-request-diff-load-commits.yml
@@ -0,0 +1,4 @@
+---
+title: Instrument MergeRequestDiff#load_commits
+merge_request:
+author:
diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb
index 5e0eefdb154..508b886d6a0 100644
--- a/config/initializers/8_metrics.rb
+++ b/config/initializers/8_metrics.rb
@@ -113,6 +113,9 @@ def instrument_classes(instrumentation)
# This is a Rails scope so we have to instrument it manually.
instrumentation.instrument_method(Project, :visible_to_user)
+
+ # Needed for https://gitlab.com/gitlab-org/gitlab-ce/issues/30224#note_32306159
+ instrumentation.instrument_instance_method(MergeRequestDiff, :load_commits)
end
# rubocop:enable Metrics/AbcSize
diff --git a/spec/initializers/8_metrics_spec.rb b/spec/initializers/8_metrics_spec.rb
index 570754621f3..a507d7f7f2b 100644
--- a/spec/initializers/8_metrics_spec.rb
+++ b/spec/initializers/8_metrics_spec.rb
@@ -7,6 +7,7 @@ describe 'instrument_classes', lib: true do
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)
end