Class: ManageEngine::TransactionUtil

Inherits:
Object
  • Object
show all
Defined in:
lib/agent/util/transaction_util.rb

Instance Method Summary collapse

Constructor Details

#initializeTransactionUtil

Returns a new instance of TransactionUtil.



4
5
6
# File 'lib/agent/util/transaction_util.rb', line 4

def initialize
  @obj = ManageEngine::APMObjectHolder.instance
end

Instance Method Details

#listen?(txnName) ⇒ Boolean

def normalizeName

Returns:

  • (Boolean)


22
23
24
25
26
27
28
29
30
31
32
# File 'lib/agent/util/transaction_util.rb', line 22

def listen?(txnName)
  if (txnName != nil)
    @obj.config.txn_skip_listen.each do |pattern|
      pattern = pattern.start_with?('.*') ? pattern : ('.' + pattern)
      if (txnName.match(pattern) != nil)
        return false
      end
    end # do
  end
  true
end

#normalizeName(txnName) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/agent/util/transaction_util.rb', line 8

def normalizeName(txnName)
  if (txnName != nil)
    txnName.gsub!(/\/\d+/, "/*") # Replace all numbers with *
    # Transaction merge patterns - provided by user
    @obj.config.url_merge_pattern.each do |key, val|
      if (txnName.match(key) != nil)
        txnName=val
        break
      end
    end # do
  end # if (txnName != nil)
  txnName
end