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
c9253c3e
Commit
c9253c3e
authored
Apr 16, 2019
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rubocop cleanup
parent
3d302879
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+1
-1
spec/services/metrics_dashboard_processing_service_spec.rb
spec/services/metrics_dashboard_processing_service_spec.rb
+3
-4
spec/services/metrics_dashboard_service_spec.rb
spec/services/metrics_dashboard_service_spec.rb
+1
-1
No files found.
app/controllers/projects/environments_controller.rb
View file @
c9253c3e
...
...
@@ -158,7 +158,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
def
metrics_dashboard
render_403
and
return
unless
Feature
.
enabled?
(
:environment_metrics_use_prometheus_endpoint
,
project
)
render_403
&&
return
unless
Feature
.
enabled?
(
:environment_metrics_use_prometheus_endpoint
,
project
)
respond_to
do
|
format
|
format
.
json
do
...
...
spec/services/metrics_dashboard_processing_service_spec.rb
View file @
c9253c3e
require
'spec_helper'
describe
MetricsDashboardProcessingService
do
let
(
:project
)
{
build
(
:project
)
}
let
(
:project
)
{
build
(
:project
)
}
let
(
:dashboard_yml
)
{
YAML
.
load_file
(
'spec/fixtures/services/metrics_dashboard_processing_service.yml'
)
}
describe
'process'
do
...
...
@@ -21,12 +21,11 @@ describe MetricsDashboardProcessingService do
let!
(
:project_metric
)
{
create
(
:prometheus_metric
,
project:
project
)
}
it
'includes project-specific metrics'
do
project_metric_details
=
{
query_range:
project_metric
.
query
,
unit:
project_metric
.
unit
,
label:
project_metric
.
legend
,
metric_id:
project_metric
.
id
,
metric_id:
project_metric
.
id
}
expect
(
all_metrics
).
to
include
project_metric_details
...
...
@@ -41,7 +40,7 @@ describe MetricsDashboardProcessingService do
end
it
'orders groups by priority and panels by weight'
do
expected_metrics_order
=
[
'metric_b'
,
'metric_a2'
,
'metric_a1'
]
expected_metrics_order
=
%w('metric_b metric_a2 metric_a1')
actual_metrics_order
=
all_metrics
.
map
{
|
m
|
m
[
:id
]
}
expect
(
actual_metrics_order
).
to
eq
expected_metrics_order
...
...
spec/services/metrics_dashboard_service_spec.rb
View file @
c9253c3e
require
'spec_helper'
describe
MetricsDashboardService
,
:use_clean_rails_memory_store_caching
do
let
(
:project
)
{
build
(
:project
)
}
let
(
:project
)
{
build
(
:project
)
}
describe
'get_dashboard'
do
it
'returns a json representation of the environment dashboard'
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