Class: Instana::Collectors::Thread
- Inherits:
-
Object
- Object
- Instana::Collectors::Thread
- Defined in:
- lib/instana/collectors/thread.rb
Instance Attribute Summary collapse
-
#payload_key ⇒ Object
Returns the value of attribute payload_key.
Instance Method Summary collapse
-
#collect ⇒ Object
collect.
-
#initialize ⇒ Thread
constructor
A new instance of Thread.
Constructor Details
#initialize ⇒ Thread
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_key ⇒ Object
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
#collect ⇒ Object
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.}" ::Instana.logger.debug { e.backtrace.join("\r\n") } end |