BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e6c7c11a
Commit
e6c7c11a
authored
Aug 24, 2017
by
Maxim Rydkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace `has_matching_label` with `has_matching_label?`
parent
eb0a17ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
.rubocop_todo.yml
.rubocop_todo.yml
+3
-0
matched_metrics_query.rb
lib/gitlab/prometheus/queries/matched_metrics_query.rb
+2
-2
No files found.
.rubocop_todo.yml
View file @
e6c7c11a
...
...
@@ -244,8 +244,11 @@ Style/PerlBackrefs:
# NameWhitelist: is_a?
Style/PredicateName
:
Enabled
:
true
Exclude
:
-
'
features/*'
# NamePrefix: is_
NamePrefixBlacklist
:
is_
NameWhitelist
:
has_n_stars
# Offense count: 58
# Cop supports --auto-correct.
...
...
lib/gitlab/prometheus/queries/matched_metrics_query.rb
View file @
e6c7c11a
...
...
@@ -42,13 +42,13 @@ module Gitlab
lookup
=
series
.
each_slice
(
MAX_QUERY_ITEMS
).
flat_map
do
|
batched_series
|
client_series
(
*
batched_series
,
start:
timeframe_start
,
stop:
timeframe_end
)
.
select
(
&
method
(
:has_matching_label
))
.
select
(
&
method
(
:has_matching_label
?
))
.
map
{
|
series_info
|
[
series_info
[
'__name__'
],
true
]
}
end
lookup
.
to_h
end
def
has_matching_label
(
series_info
)
def
has_matching_label
?
(
series_info
)
series_info
.
key?
(
'environment'
)
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