diff options
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 |