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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
735365a3
Commit
735365a3
authored
Oct 19, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename BackgroundMigration to SidekiqMigration
parent
30a4bb66
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
4 deletions
+17
-4
lib/gitlab/metrics/background_transaction.rb
lib/gitlab/metrics/background_transaction.rb
+1
-1
lib/gitlab/metrics/histogram_buckets.rb
lib/gitlab/metrics/histogram_buckets.rb
+0
-0
lib/gitlab/metrics/sidekiq_middleware.rb
lib/gitlab/metrics/sidekiq_middleware.rb
+1
-1
spec/lib/gitlab/metrics/background_transaction_spec.rb
spec/lib/gitlab/metrics/background_transaction_spec.rb
+13
-0
spec/lib/gitlab/metrics/rack_middleware_spec.rb
spec/lib/gitlab/metrics/rack_middleware_spec.rb
+1
-1
spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb
spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb
+1
-1
No files found.
lib/gitlab/metrics/
sidekiq
_transaction.rb
→
lib/gitlab/metrics/
background
_transaction.rb
View file @
735365a3
module
Gitlab
module
Metrics
class
Sidekiq
Transaction
<
Transaction
class
Background
Transaction
<
Transaction
def
initialize
(
worker_class
)
super
()
@worker_class
=
worker_class
...
...
lib/gitlab/metrics/histogram_buckets.rb
deleted
100644 → 0
View file @
30a4bb66
lib/gitlab/metrics/sidekiq_middleware.rb
View file @
735365a3
...
...
@@ -5,7 +5,7 @@ module Gitlab
# This middleware is intended to be used as a server-side middleware.
class
SidekiqMiddleware
def
call
(
worker
,
message
,
queue
)
trans
=
Sidekiq
Transaction
.
new
(
worker
.
class
)
trans
=
Background
Transaction
.
new
(
worker
.
class
)
begin
# Old gitlad-shell messages don't provide enqueued_at/created_at attributes
...
...
spec/lib/gitlab/metrics/background_transaction_spec.rb
0 → 100644
View file @
735365a3
require
'spec_helper'
describe
Gitlab
::
Metrics
::
BackgroundTransaction
do
let
(
:test_worker_class
)
{
double
(
:class
,
name:
'TestWorker'
)
}
subject
{
described_class
.
new
(
test_worker_class
)
}
describe
'#action'
do
it
'returns transaction action name'
do
expect
(
subject
.
action
).
to
eq
(
'TestWorker#perform'
)
end
end
end
spec/lib/gitlab/metrics/rack_middleware_spec.rb
View file @
735365a3
...
...
@@ -32,7 +32,7 @@ describe Gitlab::Metrics::RackMiddleware do
let
(
:transaction
)
{
middleware
.
transaction_from_env
(
env
)
}
it
'returns a Transaction'
do
expect
(
transaction
).
to
be_an_instance_of
(
Gitlab
::
Metrics
::
Transaction
)
expect
(
transaction
).
to
be_an_instance_of
(
Gitlab
::
Metrics
::
Web
Transaction
)
end
it
'stores the request method and URI in the transaction as values'
do
...
...
spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb
View file @
735365a3
...
...
@@ -5,7 +5,7 @@ describe Gitlab::Metrics::SidekiqMiddleware do
let
(
:message
)
{
{
'args'
=>
[
'test'
],
'enqueued_at'
=>
Time
.
new
(
2016
,
6
,
23
,
6
,
59
).
to_f
}
}
def
run
(
worker
,
message
)
expect
(
Gitlab
::
Metrics
::
Transaction
).
to
receive
(
:new
)
expect
(
Gitlab
::
Metrics
::
Background
Transaction
).
to
receive
(
:new
)
.
with
(
worker
.
class
)
.
and_call_original
...
...
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