Method: NewRelic::Agent::Threading::ThreadProfile#initialize

Defined in:
lib/new_relic/agent/threading/thread_profile.rb

#initialize(command_arguments = {}) ⇒ ThreadProfile

Returns a new instance of ThreadProfile.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/new_relic/agent/threading/thread_profile.rb', line 20

def initialize(command_arguments = {})
  @command_arguments = command_arguments
  @profile_id = command_arguments.fetch('profile_id', -1)
  @duration = command_arguments.fetch('duration', 120)
  @sample_period = command_arguments.fetch('sample_period', 0.1)
  @profile_agent_code = command_arguments.fetch('profile_agent_code', false)
  @finished = false

  @traces = {
    :agent => BacktraceRoot.new,
    :background => BacktraceRoot.new,
    :other => BacktraceRoot.new,
    :request => BacktraceRoot.new
  }

  @poll_count = 0
  @backtrace_count = 0
  @failure_count = 0
  @unique_threads = []

  @created_at = Process.clock_gettime(Process::CLOCK_REALTIME)
end