Commit cb606c5a authored by Stan Hu's avatar Stan Hu

Merge branch 'pawel/fix_backend_transaction_protected_labels_method' into 'master'

Make BackgroundTransaction#labels public

See merge request gitlab-org/gitlab-ce!15257
parents a979153b 90edcb45
...@@ -6,8 +6,6 @@ module Gitlab ...@@ -6,8 +6,6 @@ module Gitlab
@worker_class = worker_class @worker_class = worker_class
end end
protected
def labels def labels
{ controller: @worker_class.name, action: 'perform' } { controller: @worker_class.name, action: 'perform' }
end end
......
...@@ -10,4 +10,10 @@ describe Gitlab::Metrics::BackgroundTransaction do ...@@ -10,4 +10,10 @@ describe Gitlab::Metrics::BackgroundTransaction do
expect(subject.action).to eq('TestWorker#perform') expect(subject.action).to eq('TestWorker#perform')
end end
end end
describe '#label' do
it 'returns labels based on class name' do
expect(subject.labels).to eq(controller: 'TestWorker', action: 'perform')
end
end
end end
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