Module: DatadogThreadTracer

Defined in:
lib/datadog_thread_tracer.rb,
lib/datadog_thread_tracer/version.rb,
lib/datadog_thread_tracer/thread_tracer.rb

Overview

rubocop:disable Style/Documentation

Defined Under Namespace

Classes: Error, ThreadTracer

Constant Summary collapse

DEFAULT_TRACE_NAME =
"DatadogThreadTracer.trace"
VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.trace(trace_name = DEFAULT_TRACE_NAME) {|t| ... } ⇒ Object

Examples:

DatadogThreadTracer.trace do |t|
  t.trace do
    # do something. (this block is called in thread)
  end
end

Parameters:

  • trace_name (String) (defaults to: DEFAULT_TRACE_NAME)

Yields:

  • Processes you want to execute in a thread

Yield Parameters:



24
25
26
27
28
29
30
31
32
# File 'lib/datadog_thread_tracer.rb', line 24

def self.trace(trace_name = DEFAULT_TRACE_NAME)
  Datadog::Tracing.trace(trace_name) do
    t = DatadogThreadTracer::ThreadTracer.new

    yield t

    t.join_threads
  end
end