summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-10-19 12:24:15 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2017-11-02 18:16:58 +0100
commit30a4bb66281d1d83028b3258156957db23077104 (patch)
tree7fd7452c12413913fd318d8f64a928d30d5b4a95 /lib
parent043545de3a15251c69e8a7ccfd9f608e598d4ff2 (diff)
downloadgitlab-ce-30a4bb66281d1d83028b3258156957db23077104.tar.gz
Fix sidekiq middleware tests
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/metrics/sidekiq_transaction.rb5
-rw-r--r--lib/gitlab/metrics/transaction.rb (renamed from lib/gitlab/metrics/base_transaction.rb)4
-rw-r--r--lib/gitlab/metrics/web_transaction.rb2
3 files changed, 5 insertions, 6 deletions
diff --git a/lib/gitlab/metrics/sidekiq_transaction.rb b/lib/gitlab/metrics/sidekiq_transaction.rb
index 4024b892ecc..797594f12e1 100644
--- a/lib/gitlab/metrics/sidekiq_transaction.rb
+++ b/lib/gitlab/metrics/sidekiq_transaction.rb
@@ -1,14 +1,15 @@
module Gitlab
module Metrics
- class SidekiqTransaction
+ class SidekiqTransaction < Transaction
def initialize(worker_class)
+ super()
@worker_class = worker_class
end
protected
def labels
- { controller: worker.class.name, action: 'perform' }
+ { controller: @worker_class.name, action: 'perform' }
end
end
end
diff --git a/lib/gitlab/metrics/base_transaction.rb b/lib/gitlab/metrics/transaction.rb
index cf616cb13a3..372922a986e 100644
--- a/lib/gitlab/metrics/base_transaction.rb
+++ b/lib/gitlab/metrics/transaction.rb
@@ -1,7 +1,7 @@
module Gitlab
module Metrics
# Class for storing metrics information of a single transaction.
- class BaseTransaction
+ class Transaction
# base labels shared among all transactions
BASE_LABELS = { controller: nil, action: nil }.freeze
@@ -131,8 +131,6 @@ module Gitlab
"#{labels[:controller]}##{labels[:action]}" if labels && !labels.empty?
end
- protected
-
def self.metric_transaction_duration_seconds
@metric_transaction_duration_seconds ||= Gitlab::Metrics.histogram(
:gitlab_transaction_duration_seconds,
diff --git a/lib/gitlab/metrics/web_transaction.rb b/lib/gitlab/metrics/web_transaction.rb
index f85929b1c4e..89ff02a96d6 100644
--- a/lib/gitlab/metrics/web_transaction.rb
+++ b/lib/gitlab/metrics/web_transaction.rb
@@ -1,6 +1,6 @@
module Gitlab
module Metrics
- class WebTransaction < BaseTransaction
+ class WebTransaction < Transaction
CONTROLLER_KEY = 'action_controller.instance'.freeze
ENDPOINT_KEY = 'api.endpoint'.freeze