diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 18:08:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 18:08:50 +0000 |
commit | ca05512007cea51e05d3431b2c8bd7228c754370 (patch) | |
tree | 5202d429acd68c071445aff9e352379173ec9c0b /lib/gitlab/diff | |
parent | 6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (diff) | |
download | gitlab-ce-ca05512007cea51e05d3431b2c8bd7228c754370.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/highlight_cache.rb | 6 |
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) |