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
7be7c444
Commit
7be7c444
authored
Apr 19, 2019
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port Processer api refactor from CE
parent
5d3e42fa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
ee/lib/ee/gitlab/metrics_dashboard/processor.rb
ee/lib/ee/gitlab/metrics_dashboard/processor.rb
+2
-2
ee/lib/ee/gitlab/metrics_dashboard/stages/alerts_inserter.rb
ee/lib/ee/gitlab/metrics_dashboard/stages/alerts_inserter.rb
+2
-2
ee/spec/lib/ee/gitlab/metrics_dashboard/processor_spec.rb
ee/spec/lib/ee/gitlab/metrics_dashboard/processor_spec.rb
+6
-6
No files found.
ee/lib/ee/gitlab/metrics_dashboard/processor.rb
View file @
7be7c444
...
...
@@ -4,8 +4,8 @@ module EE
module
Gitlab
module
MetricsDashboard
module
Processor
def
s
tages
@stages
||=
super
+
[
Stages
::
AlertsInserter
]
def
s
equence
super
+
[
Stages
::
AlertsInserter
]
end
end
end
...
...
ee/lib/ee/gitlab/metrics_dashboard/stages/alerts_inserter.rb
View file @
7be7c444
...
...
@@ -7,10 +7,10 @@ module EE
module
MetricsDashboard
module
Stages
class
AlertsInserter
<
::
Gitlab
::
MetricsDashboard
::
Stages
::
BaseStage
def
transform!
def
transform!
(
dashboard
)
return
if
metrics_with_alerts
.
empty?
for_metrics
do
|
metric
|
for_metrics
(
dashboard
)
do
|
metric
|
next
unless
metrics_with_alerts
.
include?
(
metric
[
:metric_id
])
metric
[
:alert_path
]
=
alert_path
(
metric
[
:metric_id
],
project
,
environment
)
...
...
ee/spec/lib/ee/gitlab/metrics_dashboard/processor_spec.rb
View file @
7be7c444
...
...
@@ -7,19 +7,19 @@ describe Gitlab::MetricsDashboard::Processor do
let
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let
(
:dashboard_yml
)
{
YAML
.
load_file
(
'spec/fixtures/lib/gitlab/metrics_dashboard/sample_dashboard.yml'
)
}
describe
's
tages
'
do
describe
's
equence
'
do
let
(
:environment
)
{
build
(
:environment
)
}
let
(
:process_params
)
{
[
dashboard_yml
,
project
,
environment
]
}
let
(
:s
tages
)
{
described_class
.
new
(
*
process_params
).
stages
}
let
(
:process_params
)
{
[
project
,
environment
]
}
let
(
:s
equence
)
{
described_class
.
new
(
*
process_params
).
sequence
}
it
'includes the alerts processing stage'
do
expect
(
s
tages
.
length
).
to
eq
(
4
)
expect
(
s
equence
.
length
).
to
eq
(
4
)
end
end
describe
'process'
do
let
(
:process_params
)
{
[
dashboard_yml
,
project
,
environment
]
}
let
(
:dashboard
)
{
described_class
.
new
(
*
process_params
).
process
}
let
(
:process_params
)
{
[
project
,
environment
]
}
let
(
:dashboard
)
{
described_class
.
new
(
*
process_params
).
process
(
dashboard_yml
)
}
context
'when the dashboard references persisted metrics with alerts'
do
let!
(
:alert
)
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