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
a818d7bb
Commit
a818d7bb
authored
May 08, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset Prometheus metrics in ee/spec/services/geo/metrics_update_service_spec.rb
parent
9808412a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
ee/spec/services/geo/metrics_update_service_spec.rb
ee/spec/services/geo/metrics_update_service_spec.rb
+9
-0
No files found.
ee/spec/services/geo/metrics_update_service_spec.rb
View file @
a818d7bb
...
@@ -68,8 +68,17 @@ describe Geo::MetricsUpdateService, :geo do
...
@@ -68,8 +68,17 @@ describe Geo::MetricsUpdateService, :geo do
}
}
end
end
def
reset_prometheus_metrics
matching_files
=
File
.
join
(
::
Prometheus
::
Client
.
configuration
.
multiprocess_files_dir
,
"*.db"
)
Dir
[
matching_files
].
map
{
|
filename
|
File
.
delete
(
filename
)
if
File
.
file?
(
filename
)
}
# Can't use ::Prometheus::Client.reinitialize_on_pid_change because the PID didn't change
::
Prometheus
::
Client
::
MmapedValue
.
reset_and_reinitialize
end
before
do
before
do
allow
(
Gitlab
::
Metrics
).
to
receive
(
:prometheus_metrics_enabled?
).
and_return
(
true
)
allow
(
Gitlab
::
Metrics
).
to
receive
(
:prometheus_metrics_enabled?
).
and_return
(
true
)
reset_prometheus_metrics
end
end
describe
'#execute'
do
describe
'#execute'
do
...
...
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