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
Léo-Paul Géneau
gitlab-ce
Commits
cd94500a
Commit
cd94500a
authored
Jun 05, 2019
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address rubocop errors
parent
54dd4403
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb
lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb
+1
-2
spec/lib/gitlab/metrics/dashboard/processor_spec.rb
spec/lib/gitlab/metrics/dashboard/processor_spec.rb
+4
-1
No files found.
lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb
View file @
cd94500a
...
...
@@ -16,8 +16,7 @@ module Gitlab
private
def
endpoint_for_metric
(
metric
)
Gitlab
::
Routing
.
url_helpers
.
prometheus_api_namespace_project_environment_path
(
project
.
namespace
,
Gitlab
::
Routing
.
url_helpers
.
prometheus_api_project_environment_path
(
project
,
environment
,
proxy_path:
query_type
(
metric
),
...
...
spec/lib/gitlab/metrics/dashboard/processor_spec.rb
View file @
cd94500a
...
...
@@ -11,11 +11,14 @@ describe Gitlab::Metrics::Dashboard::Processor do
let
(
:process_params
)
{
[
project
,
environment
,
dashboard_yml
]
}
let
(
:dashboard
)
{
described_class
.
new
(
*
process_params
).
process
(
insert_project_metrics:
true
)
}
# rubocop:disable RSpec/IteratedExpectation
# Cop disabled "all" matcher doesn't offer access to the element
it
'includes a path for the prometheus endpoint with each metric'
do
all_metrics
.
each
do
|
metric
|
expect
(
metric
).
to
include
(
prometheus_endpoint_path:
prometheus_path
(
metric
[
:query_range
]))
end
end
# rubocop:enable RSpec/IteratedExpectation
context
'when dashboard config corresponds to common metrics'
do
let!
(
:common_metric
)
{
create
(
:prometheus_metric
,
:common
,
identifier:
'metric_a1'
)
}
...
...
@@ -114,6 +117,6 @@ describe Gitlab::Metrics::Dashboard::Processor do
"/
#{
project
.
namespace
.
path
}
"
\
"/
#{
project
.
name
}
/environments/"
\
"
#{
environment
.
id
}
/prometheus/api/v1"
\
"/query_range?query=
#{
CGI
::
escape
query
}
"
"/query_range?query=
#{
CGI
.
escape
query
}
"
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