Class: Instana::Collectors::Thread

Inherits:
Object
  • Object
show all
Defined in:
lib/instana/collectors/thread.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeThread

Returns a new instance of Thread.



6
7
8
9
# File 'lib/instana/collectors/thread.rb', line 6

def initialize
  @payload_key = :thread
  @this_count = {}
end

Instance Attribute Details

#payload_keyObject

Returns the value of attribute payload_key.



4
5
6
# File 'lib/instana/collectors/thread.rb', line 4

def payload_key
  @payload_key
end

Instance Method Details

#collectObject

collect

To collect thread count



16
17
18
19
20
21
22
# File 'lib/instana/collectors/thread.rb', line 16

def collect
  @this_count[:count] = ::Thread.list.count
  @this_count
rescue => e
  ::Instana.logger.info "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
  ::Instana.logger.debug { e.backtrace.join("\r\n") }
end