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
0072ec3d
Commit
0072ec3d
authored
Apr 27, 2019
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strong_memoize for alert ids
parent
82e4e2a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
ee/lib/ee/gitlab/metrics/dashboard/stages/alerts_inserter.rb
ee/lib/ee/gitlab/metrics/dashboard/stages/alerts_inserter.rb
+8
-6
No files found.
ee/lib/ee/gitlab/metrics/dashboard/stages/alerts_inserter.rb
View file @
0072ec3d
...
...
@@ -8,6 +8,8 @@ module EE
module
Dashboard
module
Stages
class
AlertsInserter
<
::
Gitlab
::
Metrics
::
Dashboard
::
Stages
::
BaseStage
include
::
Gitlab
::
Utils
::
StrongMemoize
def
transform!
return
if
metrics_with_alerts
.
empty?
...
...
@@ -21,13 +23,13 @@ module EE
private
def
metrics_with_alerts
return
@metrics_with_alerts
if
@metrics_with_alerts
alerts
=
::
Projects
::
Prometheus
::
AlertsFinder
.
new
(
project:
project
,
environment:
environment
)
.
execute
strong_memoize
(
:metrics_with_alerts
)
do
alerts
=
::
Projects
::
Prometheus
::
AlertsFinder
.
new
(
project:
project
,
environment:
environment
)
.
execute
@metrics_with_alerts
=
Set
.
new
(
alerts
.
map
(
&
:prometheus_metric_id
))
Set
.
new
(
alerts
.
map
(
&
:prometheus_metric_id
))
end
end
def
alert_path
(
metric_id
,
project
,
environment
)
...
...
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