diff options
author | Sean McGivern <sean@gitlab.com> | 2017-06-14 14:01:38 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-06-14 14:01:38 +0300 |
commit | 54c0c0cd170f6c4be8242428f409950e16fcea91 (patch) | |
tree | b5ee1998d4c81fcdb7eeb9280ad7990dc9331084 | |
parent | fbfddd99d6a4846e807dc8c2dadd64d3d120fb23 (diff) |
Instrument MergeRequestDiff#load_commits
This instrumentation isn't needed strictly for performance measurements, but
just to see which controller actions call this method at all. See
<https://gitlab.com/gitlab-org/gitlab-ce/issues/30224#note_32306159> for more
details.
-rw-r--r-- | changelogs/unreleased/instrument-merge-request-diff-load-commits.yml | 4 | ||||
-rw-r--r-- | config/initializers/8_metrics.rb | 3 | ||||
-rw-r--r-- | spec/initializers/8_metrics_spec.rb | 1 |
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 |