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
7476bacb
Commit
7476bacb
authored
Jan 20, 2020
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update page limiter prometheus output
Now just stores a boolean of whether it was a bot or not.
parent
81786aa3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
app/controllers/concerns/page_limiter.rb
app/controllers/concerns/page_limiter.rb
+3
-1
spec/controllers/concerns/page_limiter_spec.rb
spec/controllers/concerns/page_limiter_spec.rb
+1
-1
No files found.
app/controllers/concerns/page_limiter.rb
View file @
7476bacb
...
@@ -91,10 +91,12 @@ module PageLimiter
...
@@ -91,10 +91,12 @@ module PageLimiter
# Record the page limit being hit in Prometheus
# Record the page limit being hit in Prometheus
def
record_interception
def
record_interception
dd
=
DeviceDetector
.
new
(
request
.
user_agent
)
Gitlab
::
Metrics
.
counter
(
:gitlab_page_out_of_bounds
,
Gitlab
::
Metrics
.
counter
(
:gitlab_page_out_of_bounds
,
controller:
params
[
:controller
],
controller:
params
[
:controller
],
action:
params
[
:action
],
action:
params
[
:action
],
agent:
request
.
user_agent
bot:
dd
.
bot?
)
)
end
end
end
end
spec/controllers/concerns/page_limiter_spec.rb
View file @
7476bacb
...
@@ -170,7 +170,7 @@ describe PageLimiter do
...
@@ -170,7 +170,7 @@ describe PageLimiter do
:gitlab_page_out_of_bounds
,
:gitlab_page_out_of_bounds
,
controller:
"explore/projects"
,
controller:
"explore/projects"
,
action:
"index"
,
action:
"index"
,
agent:
"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
bot:
true
)
)
subject
subject
...
...
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