Commit b49af7f7 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 6601de8d 145c3476
...@@ -33,7 +33,7 @@ module Routable ...@@ -33,7 +33,7 @@ module Routable
# #
# Returns a single object, or nil. # Returns a single object, or nil.
def find_by_full_path(path, follow_redirects: false) def find_by_full_path(path, follow_redirects: false)
increment_counter(:routable_find_by_full_path, 'Number of calls to Routable.find_by_full_path') routable_calls_counter.increment(method: 'find_by_full_path')
if Feature.enabled?(:routable_two_step_lookup) if Feature.enabled?(:routable_two_step_lookup)
# Case sensitive match first (it's cheaper and the usual case) # Case sensitive match first (it's cheaper and the usual case)
...@@ -61,7 +61,7 @@ module Routable ...@@ -61,7 +61,7 @@ module Routable
def where_full_path_in(paths) def where_full_path_in(paths)
return none if paths.empty? return none if paths.empty?
increment_counter(:routable_where_full_path_in, 'Number of calls to Routable.where_full_path_in') routable_calls_counter.increment(method: 'where_full_path_in')
wheres = paths.map do |path| wheres = paths.map do |path|
"(LOWER(routes.path) = LOWER(#{connection.quote(path)}))" "(LOWER(routes.path) = LOWER(#{connection.quote(path)}))"
...@@ -71,12 +71,8 @@ module Routable ...@@ -71,12 +71,8 @@ module Routable
end end
# Temporary instrumentation of method calls # Temporary instrumentation of method calls
def increment_counter(counter, description) def routable_calls_counter
@counters[counter] ||= Gitlab::Metrics.counter(counter, description) @routable_calls_counter ||= Gitlab::Metrics.counter(:gitlab_routable_calls_total, 'Number of calls to Routable by method')
@counters[counter].increment
rescue
# ignore the error
end end
end end
......
...@@ -110,7 +110,8 @@ module Gitlab ...@@ -110,7 +110,8 @@ module Gitlab
karma\.config\.js | karma\.config\.js |
webpack\.config\.js | webpack\.config\.js |
package\.json | package\.json |
yarn\.lock yarn\.lock |
\.gitlab/ci/frontend\.gitlab-ci\.yml
)\z}x => :frontend, )\z}x => :frontend,
%r{\A(ee/)?db/(?!fixtures)[^/]+} => :database, %r{\A(ee/)?db/(?!fixtures)[^/]+} => :database,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment