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
d26573c6
Commit
d26573c6
authored
Jun 02, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make PrometheusTextFormat return proper output terminated with '\n'
remove file dangling after rebase
parent
6a67148e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
20 deletions
+4
-20
app/services/metrics_service.rb
app/services/metrics_service.rb
+1
-1
lib/gitlab/health_checks/prometheus_text_format.rb
lib/gitlab/health_checks/prometheus_text_format.rb
+1
-1
spec/db/production/settings.rb
spec/db/production/settings.rb
+0
-16
spec/lib/gitlab/health_checks/prometheus_text_format_spec.rb
spec/lib/gitlab/health_checks/prometheus_text_format_spec.rb
+2
-2
No files found.
app/services/metrics_service.rb
View file @
d26573c6
...
...
@@ -18,7 +18,7 @@ class MetricsService
end
def
metrics_text
"
#{
health_metrics_text
}
\n
#{
prometheus_metrics_text
}
"
"
#{
health_metrics_text
}#{
prometheus_metrics_text
}
"
end
private
...
...
lib/gitlab/health_checks/prometheus_text_format.rb
View file @
d26573c6
...
...
@@ -2,7 +2,7 @@ module Gitlab
module
HealthChecks
class
PrometheusTextFormat
def
marshal
(
metrics
)
metrics_with_type_declarations
(
metrics
).
join
(
"
\n
"
)
"
#{
metrics_with_type_declarations
(
metrics
).
join
(
"
\n
"
)
}
\n
"
end
private
...
...
spec/db/production/settings.rb
deleted
100644 → 0
View file @
6a67148e
require
'spec_helper'
describe
'seed production settings'
,
lib:
true
do
include
StubENV
context
'GITLAB_SHARED_RUNNERS_REGISTRATION_TOKEN is set in the environment'
do
before
do
stub_env
(
'GITLAB_SHARED_RUNNERS_REGISTRATION_TOKEN'
,
'013456789'
)
end
it
'writes the token to the database'
do
load
(
File
.
join
(
__dir__
,
'../../../db/fixtures/production/010_settings.rb'
))
expect
(
ApplicationSetting
.
current
.
runners_registration_token
).
to
eq
(
'013456789'
)
end
end
end
spec/lib/gitlab/health_checks/prometheus_text_format_spec.rb
View file @
d26573c6
...
...
@@ -16,7 +16,7 @@ describe Gitlab::HealthChecks::PrometheusTextFormat do
metric2 2
EXPECTED
expect
(
subject
.
marshal
(
sample_metrics
)).
to
eq
(
expected
.
chomp
)
expect
(
subject
.
marshal
(
sample_metrics
)).
to
eq
(
expected
)
end
context
'metrics where name repeats'
do
...
...
@@ -34,7 +34,7 @@ describe Gitlab::HealthChecks::PrometheusTextFormat do
# TYPE metric2 gauge
metric2 3
EXPECTED
expect
(
subject
.
marshal
(
sample_metrics
)).
to
eq
(
expected
.
chomp
)
expect
(
subject
.
marshal
(
sample_metrics
)).
to
eq
(
expected
)
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