Commit ae306e5b authored by Kerri Miller's avatar Kerri Miller

Define hit/miss counters for redis diff caching

parent f378b397
...@@ -17,6 +17,14 @@ module Gitlab ...@@ -17,6 +17,14 @@ module Gitlab
buckets [100, 1000, 10000, 100000, 1000000, 10000000] buckets [100, 1000, 10000, 100000, 1000000, 10000000]
end end
define_counter :gitlab_redis_diff_caching_hit do
docstring 'Redis diff caching hits'
end
define_counter :gitlab_redis_diff_caching_miss do
docstring 'Redis diff caching misses'
end
def initialize(diff_collection) def initialize(diff_collection)
@diff_collection = diff_collection @diff_collection = diff_collection
end end
......
...@@ -149,5 +149,13 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do ...@@ -149,5 +149,13 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
it 'defines :gitlab_redis_diff_caching_memory_usage_bytes histogram' do it 'defines :gitlab_redis_diff_caching_memory_usage_bytes histogram' do
expect(described_class).to respond_to(:gitlab_redis_diff_caching_memory_usage_bytes) expect(described_class).to respond_to(:gitlab_redis_diff_caching_memory_usage_bytes)
end end
it 'defines :gitlab_redis_diff_caching_hit' do
expect(described_class).to respond_to(:gitlab_redis_diff_caching_hit)
end
it 'defines :gitlab_redis_diff_caching_miss' do
expect(described_class).to respond_to(:gitlab_redis_diff_caching_miss)
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