Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 21:08:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 21:08:50 +0300
commitca05512007cea51e05d3431b2c8bd7228c754370 (patch)
tree5202d429acd68c071445aff9e352379173ec9c0b /lib/gitlab/diff
parent6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/highlight_cache.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/diff/highlight_cache.rb b/lib/gitlab/diff/highlight_cache.rb
index 0a8fbb9a673..0cb8020bacb 100644
--- a/lib/gitlab/diff/highlight_cache.rb
+++ b/lib/gitlab/diff/highlight_cache.rb
@@ -93,6 +93,8 @@ module Gitlab
#
redis.expire(key, EXPIRATION)
end
+
+ record_metrics(redis.memory("USAGE", key))
end
# Subsequent read_file calls would need the latest cache.
@@ -101,6 +103,10 @@ module Gitlab
clear_memoization(:cacheable_files)
end
+ def record_metrics(memory_usage)
+ self.class.gitlab_redis_diff_caching_memory_usage_bytes.observe({}, memory_usage)
+ end
+
def file_paths
strong_memoize(:file_paths) do
diff_files.collect(&:file_path)