Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ae306e5b
Commit
ae306e5b
authored
Feb 17, 2020
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define hit/miss counters for redis diff caching
parent
f378b397
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
lib/gitlab/diff/highlight_cache.rb
lib/gitlab/diff/highlight_cache.rb
+8
-0
spec/lib/gitlab/diff/highlight_cache_spec.rb
spec/lib/gitlab/diff/highlight_cache_spec.rb
+8
-0
No files found.
lib/gitlab/diff/highlight_cache.rb
View file @
ae306e5b
...
...
@@ -17,6 +17,14 @@ module Gitlab
buckets
[
100
,
1000
,
10000
,
100000
,
1000000
,
10000000
]
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
)
@diff_collection
=
diff_collection
end
...
...
spec/lib/gitlab/diff/highlight_cache_spec.rb
View file @
ae306e5b
...
...
@@ -149,5 +149,13 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache 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
)
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment