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
9a9cb253
Commit
9a9cb253
authored
Apr 17, 2019
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor line length cleanup
parent
671f6988
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
lib/gitlab/metrics_dashboard/processor.rb
lib/gitlab/metrics_dashboard/processor.rb
+2
-1
lib/gitlab/metrics_dashboard/stages/project_metrics_inserter.rb
...tlab/metrics_dashboard/stages/project_metrics_inserter.rb
+9
-8
No files found.
lib/gitlab/metrics_dashboard/processor.rb
View file @
9a9cb253
...
@@ -18,7 +18,8 @@ module Gitlab
...
@@ -18,7 +18,8 @@ module Gitlab
end
end
def
process
def
process
stages
.
each
{
|
stage
|
stage
.
new
(
@dashboard
,
@project
,
@environment
).
transform!
}
stage_params
=
[
@dashboard
,
@project
,
@environment
]
stages
.
each
{
|
stage
|
stage
.
new
(
*
stage_params
).
transform!
}
@dashboard
@dashboard
end
end
...
...
lib/gitlab/metrics_dashboard/stages/project_metrics_inserter.rb
View file @
9a9cb253
...
@@ -4,8 +4,9 @@ module Gitlab
...
@@ -4,8 +4,9 @@ module Gitlab
module
MetricsDashboard
module
MetricsDashboard
module
Stages
module
Stages
class
ProjectMetricsInserter
<
BaseStage
class
ProjectMetricsInserter
<
BaseStage
# Inserts project-specific metrics into the dashboard config.
# Inserts project-specific metrics into the dashboard
# If there are no project-specific metrics, this will have no effect.
# config. If there are no project-specific metrics,
# this will have no effect.
def
transform!
def
transform!
project
.
prometheus_metrics
.
each
do
|
project_metric
|
project
.
prometheus_metrics
.
each
do
|
project_metric
|
group
=
find_or_create_panel_group
(
dashboard
[
:panel_groups
],
project_metric
)
group
=
find_or_create_panel_group
(
dashboard
[
:panel_groups
],
project_metric
)
...
@@ -16,8 +17,8 @@ module Gitlab
...
@@ -16,8 +17,8 @@ module Gitlab
private
private
# Looks for a panel_group corresponding to the
provided metric object.
# Looks for a panel_group corresponding to the
# If unavailable, inserts one.
#
provided metric object.
If unavailable, inserts one.
# @param panel_groups [Array<Hash>]
# @param panel_groups [Array<Hash>]
# @param metric [PrometheusMetric]
# @param metric [PrometheusMetric]
def
find_or_create_panel_group
(
panel_groups
,
metric
)
def
find_or_create_panel_group
(
panel_groups
,
metric
)
...
@@ -30,8 +31,8 @@ module Gitlab
...
@@ -30,8 +31,8 @@ module Gitlab
panel_group
panel_group
end
end
# Looks for a panel corresponding to the provided
metric object.
# Looks for a panel corresponding to the provided
# If unavailable, inserts one.
#
metric object.
If unavailable, inserts one.
# @param panels [Array<Hash>]
# @param panels [Array<Hash>]
# @param metric [PrometheusMetric]
# @param metric [PrometheusMetric]
def
find_or_create_panel
(
panels
,
metric
)
def
find_or_create_panel
(
panels
,
metric
)
...
@@ -44,8 +45,8 @@ module Gitlab
...
@@ -44,8 +45,8 @@ module Gitlab
panel
panel
end
end
# Looks for a metric corresponding to the provided
metric object.
# Looks for a metric corresponding to the provided
# If unavailable, inserts one.
#
metric object.
If unavailable, inserts one.
# @param metrics [Array<Hash>]
# @param metrics [Array<Hash>]
# @param metric [PrometheusMetric]
# @param metric [PrometheusMetric]
def
find_or_create_metric
(
metrics
,
metric
)
def
find_or_create_metric
(
metrics
,
metric
)
...
...
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