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
87339940
Commit
87339940
authored
May 16, 2018
by
Mayra Cabrera
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10-8-stable-prepare-rc11' into '10-8-stable'
Prepare 10.8 RC11 release See merge request gitlab-org/gitlab-ce!18988
parents
3bd98f0b
1e54d627
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
web_transaction.rb
lib/gitlab/metrics/web_transaction.rb
+5
-1
web_transaction_spec.rb
spec/lib/gitlab/metrics/web_transaction_spec.rb
+3
-3
No files found.
lib/gitlab/metrics/web_transaction.rb
View file @
87339940
...
...
@@ -28,7 +28,11 @@ module Gitlab
controller
=
@env
[
CONTROLLER_KEY
]
action
=
"
#{
controller
.
action_name
}
"
suffix
=
controller
.
request_format
# Devise exposes a method called "request_format" that does the below.
# However, this method is not available to all controllers (e.g. certain
# Doorkeeper controllers). As such we use the underlying code directly.
suffix
=
controller
.
request
.
format
.
try
(
:ref
)
if
suffix
&&
suffix
!=
:html
action
+=
".
#{
suffix
}
"
...
...
spec/lib/gitlab/metrics/web_transaction_spec.rb
View file @
87339940
...
...
@@ -180,11 +180,11 @@ describe Gitlab::Metrics::WebTransaction do
end
context
'when request goes to ActionController'
do
let
(
:request
_format
)
{
:html
}
let
(
:request
)
{
double
(
:request
,
format:
double
(
:format
,
ref: :html
))
}
before
do
klass
=
double
(
:klass
,
name:
'TestController'
)
controller
=
double
(
:controller
,
class:
klass
,
action_name:
'show'
,
request
_format:
request_forma
t
)
controller
=
double
(
:controller
,
class:
klass
,
action_name:
'show'
,
request
:
reques
t
)
env
[
'action_controller.instance'
]
=
controller
end
...
...
@@ -195,7 +195,7 @@ describe Gitlab::Metrics::WebTransaction do
end
context
'when the response content type is not :html'
do
let
(
:request
_format
)
{
:json
}
let
(
:request
)
{
double
(
:request
,
format:
double
(
:format
,
ref: :json
))
}
it
'appends the mime type to the transaction action'
do
expect
(
transaction
.
labels
).
to
eq
({
controller:
'TestController'
,
action:
'show.json'
})
...
...
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