summaryrefslogtreecommitdiff
path: root/app/helpers/diff_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r--app/helpers/diff_helper.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index e430b0f402b..3aa54e3afe9 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -190,10 +190,8 @@ module DiffHelper
end
def render_overflow_warning?(diffs_collection)
- diff_files = diffs_collection.raw_diff_files
-
- diff_files.overflow?.tap do |overflown|
- log_overflow_limits(diff_files)
+ diffs_collection.overflow?.tap do |overflown|
+ log_overflow_limits(diff_files: diffs_collection.raw_diff_files, collection_overflow: overflown)
end
end
@@ -285,12 +283,12 @@ module DiffHelper
conflicts_service.conflicts.files.index_by(&:our_path)
end
- def log_overflow_limits(diff_files)
+ def log_overflow_limits(diff_files:, collection_overflow:)
if diff_files.any?(&:too_large?)
Gitlab::Metrics.add_event(:diffs_overflow_single_file_limits)
end
- Gitlab::Metrics.add_event(:diffs_overflow_collection_limits) if diff_files.overflow?
+ Gitlab::Metrics.add_event(:diffs_overflow_collection_limits) if collection_overflow
Gitlab::Metrics.add_event(:diffs_overflow_max_bytes_limits) if diff_files.overflow_max_bytes?
Gitlab::Metrics.add_event(:diffs_overflow_max_files_limits) if diff_files.overflow_max_files?
Gitlab::Metrics.add_event(:diffs_overflow_max_lines_limits) if diff_files.overflow_max_lines?