Sha256: ac2a293494fdd1d06537959d28a813f3df41316d1409d7cbd5e6b423b162e343
Contents?: true
Size: 919 Bytes
Versions: 15
Compression:
Stored size: 919 Bytes
Contents
module Instana module Collector class Thread attr_accessor :payload_key def initialize @payload_key = :thread @last_report = {} @this_count = {} end ## # collect # # To collect thread count # def collect @this_count[:count] = ::Thread.list.count @this_count = ::Instana::Util.enforce_deltas(@this_count, @last_report) unless @this_count.empty? @last_report.merge!(@this_count) @this_count else nil end rescue => e ::Instana.logger.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" ::Instana.logger.debug e.backtrace.join("\r\n") end end end end # Register the metrics collector if enabled if ::Instana.config[:metrics][:thread][:enabled] ::Instana.collectors << ::Instana::Collector::Thread.new end
Version data entries
15 entries across 15 versions & 1 rubygems