Commit da0e5519 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '204891-define-histogram-for-diff-truncation' into 'master'

Define histogram for tracking blob size

Closes #204891

See merge request gitlab-org/gitlab!25438
parents 8642f0ec 1f9abe3b
...@@ -35,6 +35,11 @@ module Gitlab ...@@ -35,6 +35,11 @@ module Gitlab
docstring 'blob.truncated? == false' docstring 'blob.truncated? == false'
end end
define_histogram :gitlab_blob_size do
docstring 'Gitlab::Git::Blob size'
buckets [1_000, 5_000, 10_000, 50_000, 100_000, 500_000, 1_000_000]
end
class << self class << self
def find(repository, sha, path, limit: MAX_DATA_DISPLAY_SIZE) def find(repository, sha, path, limit: MAX_DATA_DISPLAY_SIZE)
tree_entry(repository, sha, path, limit) tree_entry(repository, sha, path, limit)
......
...@@ -597,5 +597,9 @@ describe Gitlab::Git::Blob, :seed_helper do ...@@ -597,5 +597,9 @@ describe Gitlab::Git::Blob, :seed_helper do
it 'defines :gitlab_blob_truncated_false counter' do it 'defines :gitlab_blob_truncated_false counter' do
expect(described_class).to respond_to(:gitlab_blob_truncated_false) expect(described_class).to respond_to(:gitlab_blob_truncated_false)
end end
it 'defines :gitlab_blob_size histogram' do
expect(described_class).to respond_to(:gitlab_blob_size)
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment