Class: Gitlab::Metrics::BackgroundTransaction

Inherits:
Transaction
  • Object
show all
Defined in:
lib/gitlab/metrics/background_transaction.rb

Constant Summary

Constants inherited from Transaction

Transaction::BASE_LABEL_KEYS, Transaction::EVENT_SERIES, Transaction::FILTERED_LABEL_KEYS, Transaction::SMALL_BUCKETS, Transaction::THREAD_KEY

Instance Attribute Summary

Attributes inherited from Transaction

#method

Instance Method Summary collapse

Methods inherited from Transaction

#add_event, current, #duration, #filter_labels, #increment, #method_call_for, #observe, prometheus_metric, #run, #set, #thread_cpu_duration

Constructor Details

#initialize(worker_class) ⇒ BackgroundTransaction

Returns a new instance of BackgroundTransaction.


6
7
8
9
# File 'lib/gitlab/metrics/background_transaction.rb', line 6

def initialize(worker_class)
  super()
  @worker_class = worker_class
end

Instance Method Details

#labelsObject


11
12
13
# File 'lib/gitlab/metrics/background_transaction.rb', line 11

def labels
  { controller: @worker_class.name, action: 'perform', feature_category: @worker_class.try(:get_feature_category).to_s }
end