Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-20 15:08:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-20 15:08:51 +0300
commit8c4198cbe631278e87fee04157d23494fbb80cdb (patch)
treed35cf498af480389796fd9e5cb4bcc903aea60f3 /lib/gitlab/git
parent1ac794623a8be5dee111716a44dd04ff708f3541 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/blob.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/gitlab/git/blob.rb b/lib/gitlab/git/blob.rb
index ba1a474c523..caa1314dd7f 100644
--- a/lib/gitlab/git/blob.rb
+++ b/lib/gitlab/git/blob.rb
@@ -124,11 +124,12 @@ module Gitlab
self.__send__("#{key}=", options[key.to_sym]) # rubocop:disable GitlabSecurity/PublicSend
end
- record_metric_blob_size
-
# Retain the actual size before it is encoded
@loaded_size = @data.bytesize if @data
@loaded_all_data = @loaded_size == size
+
+ record_metric_blob_size
+ record_metric_truncated(truncated?)
end
def binary_in_repo?
@@ -210,6 +211,14 @@ module Gitlab
self.class.gitlab_blob_size.observe({}, size)
end
+ def record_metric_truncated(bool)
+ if bool
+ self.class.gitlab_blob_truncated_true.increment
+ else
+ self.class.gitlab_blob_truncated_false.increment
+ end
+ end
+
def has_lfs_version_key?
!empty? && text_in_repo? && data.start_with?("version https://git-lfs.github.com/spec")
end