Commit 1f9abe3b authored by Kerri Miller's avatar Kerri Miller

Define histogram for tracking blob size

parent 9afd7128
...@@ -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