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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
6b53dd28
Commit
6b53dd28
authored
Sep 06, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache spec check if prometheus metrics are triggered
parent
8dbb228b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
spec/lib/gitlab/metrics/subscribers/rails_cache_spec.rb
spec/lib/gitlab/metrics/subscribers/rails_cache_spec.rb
+15
-3
No files found.
spec/lib/gitlab/metrics/subscribers/rails_cache_spec.rb
View file @
6b53dd28
...
...
@@ -33,6 +33,12 @@ describe Gitlab::Metrics::Subscribers::RailsCache do
subscriber
.
cache_read
(
event
)
end
it
'increments the cache_read_hit total'
do
expect
(
described_class
.
metric_cache_read_hit_total
).
to
receive
(
:increment
)
subscriber
.
cache_read
(
event
)
end
context
'when super operation is fetch'
do
let
(
:event
)
{
double
(
:event
,
duration:
15.2
,
payload:
{
hit:
true
,
super_operation: :fetch
})
}
...
...
@@ -57,6 +63,12 @@ describe Gitlab::Metrics::Subscribers::RailsCache do
subscriber
.
cache_read
(
event
)
end
it
'increments the cache_read_miss total'
do
expect
(
described_class
.
metric_cache_read_miss_total
).
to
receive
(
:increment
)
subscriber
.
cache_read
(
event
)
end
context
'when super operation is fetch'
do
let
(
:event
)
{
double
(
:event
,
duration:
15.2
,
payload:
{
hit:
false
,
super_operation: :fetch
})
}
...
...
@@ -72,7 +84,7 @@ describe Gitlab::Metrics::Subscribers::RailsCache do
end
describe
'#cache_write'
do
it
'
increments the cache_
write duration'
do
it
'
observes
write duration'
do
expect
(
subscriber
).
to
receive
(
:observe
)
.
with
(
:write
,
event
.
duration
)
...
...
@@ -81,7 +93,7 @@ describe Gitlab::Metrics::Subscribers::RailsCache do
end
describe
'#cache_delete'
do
it
'
increments the cache_
delete duration'
do
it
'
observes
delete duration'
do
expect
(
subscriber
).
to
receive
(
:observe
)
.
with
(
:delete
,
event
.
duration
)
...
...
@@ -90,7 +102,7 @@ describe Gitlab::Metrics::Subscribers::RailsCache do
end
describe
'#cache_exist?'
do
it
'
increments the cache_
exists duration'
do
it
'
observes the
exists duration'
do
expect
(
subscriber
).
to
receive
(
:observe
)
.
with
(
:exists
,
event
.
duration
)
...
...
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