diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-19 12:09:13 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-19 12:09:13 +0000 |
commit | cd3e2c7b9355f8990ab294b34b5e4add4f3985fa (patch) | |
tree | 77264b3e569ec95da8476f604d3d5cf4b03e85dc /lib/gitlab/git/blob.rb | |
parent | c1fc5da123a1fe670e32740669a9d5e59eff38f5 (diff) | |
download | gitlab-ce-cd3e2c7b9355f8990ab294b34b5e4add4f3985fa.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/git/blob.rb')
-rw-r--r-- | lib/gitlab/git/blob.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/git/blob.rb b/lib/gitlab/git/blob.rb index cbde713e3b9..ba1a474c523 100644 --- a/lib/gitlab/git/blob.rb +++ b/lib/gitlab/git/blob.rb @@ -124,6 +124,8 @@ 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 @@ -202,6 +204,12 @@ module Gitlab private + def record_metric_blob_size + return unless size + + self.class.gitlab_blob_size.observe({}, size) + end + def has_lfs_version_key? !empty? && text_in_repo? && data.start_with?("version https://git-lfs.github.com/spec") end |