Commit e2b86d1d authored by Stan Hu's avatar Stan Hu

Merge branch 'revert-b156ca8b' into 'master'

Revert "Merge branch '37456-track-memory-usage-of-redis-cached-diffs' into 'master'"

Closes #202198

See merge request gitlab-org/gitlab!24560
parents 1a4d072b d7b6221e
...@@ -93,8 +93,6 @@ module Gitlab ...@@ -93,8 +93,6 @@ module Gitlab
# #
redis.expire(key, EXPIRATION) redis.expire(key, EXPIRATION)
end end
record_metrics(redis.memory("USAGE", key))
end end
# Subsequent read_file calls would need the latest cache. # Subsequent read_file calls would need the latest cache.
...@@ -103,10 +101,6 @@ module Gitlab ...@@ -103,10 +101,6 @@ module Gitlab
clear_memoization(:cacheable_files) clear_memoization(:cacheable_files)
end end
def record_metrics(memory_usage)
self.class.gitlab_redis_diff_caching_memory_usage_bytes.observe({}, memory_usage)
end
def file_paths def file_paths
strong_memoize(:file_paths) do strong_memoize(:file_paths) do
diff_files.collect(&:file_path) diff_files.collect(&:file_path)
......
...@@ -101,13 +101,6 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do ...@@ -101,13 +101,6 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
let(:paths) { merge_request.diffs.raw_diff_files.select(&:text?).map(&:file_path) } let(:paths) { merge_request.diffs.raw_diff_files.select(&:text?).map(&:file_path) }
end end
it 'updates memory usage metrics' do
expect(described_class.gitlab_redis_diff_caching_memory_usage_bytes)
.to receive(:observe).and_call_original
cache.send(:write_to_redis_hash, diff_hash)
end
context 'different diff_collections for the same diffable' do context 'different diff_collections for the same diffable' do
before do before do
cache.write_if_empty cache.write_if_empty
......
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