Skip to content

Commit 735365a

Browse files
committed
rename BackgroundMigration to SidekiqMigration
1 parent 30a4bb6 commit 735365a

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

lib/gitlab/metrics/sidekiq_transaction.rb renamed to lib/gitlab/metrics/background_transaction.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Gitlab
22
module Metrics
3-
class SidekiqTransaction < Transaction
3+
class BackgroundTransaction < Transaction
44
def initialize(worker_class)
55
super()
66
@worker_class = worker_class

lib/gitlab/metrics/histogram_buckets.rb

Whitespace-only changes.

lib/gitlab/metrics/sidekiq_middleware.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Metrics
55
# This middleware is intended to be used as a server-side middleware.
66
class SidekiqMiddleware
77
def call(worker, message, queue)
8-
trans = SidekiqTransaction.new(worker.class)
8+
trans = BackgroundTransaction.new(worker.class)
99

1010
begin
1111
# Old gitlad-shell messages don't provide enqueued_at/created_at attributes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'spec_helper'
2+
3+
describe Gitlab::Metrics::BackgroundTransaction do
4+
let(:test_worker_class) { double(:class, name: 'TestWorker') }
5+
6+
subject { described_class.new(test_worker_class) }
7+
8+
describe '#action' do
9+
it 'returns transaction action name' do
10+
expect(subject.action).to eq('TestWorker#perform')
11+
end
12+
end
13+
end

spec/lib/gitlab/metrics/rack_middleware_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
let(:transaction) { middleware.transaction_from_env(env) }
3333

3434
it 'returns a Transaction' do
35-
expect(transaction).to be_an_instance_of(Gitlab::Metrics::Transaction)
35+
expect(transaction).to be_an_instance_of(Gitlab::Metrics::WebTransaction)
3636
end
3737

3838
it 'stores the request method and URI in the transaction as values' do

spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let(:message) { { 'args' => ['test'], 'enqueued_at' => Time.new(2016, 6, 23, 6, 59).to_f } }
66

77
def run(worker, message)
8-
expect(Gitlab::Metrics::Transaction).to receive(:new)
8+
expect(Gitlab::Metrics::BackgroundTransaction).to receive(:new)
99
.with(worker.class)
1010
.and_call_original
1111

0 commit comments

Comments
 (0)