Sha256: 94f663d162c93345de20055bbdc0ff4fc2f447887083da2115d8e1d5ec5b0b57

Contents?: true

Size: 620 Bytes

Versions: 5

Compression:

Stored size: 620 Bytes

Contents

# typed: true
module Datadog
  # Profiling entry point, which coordinates collectors and a scheduler
  class Profiler
    attr_reader \
      :collectors,
      :scheduler

    def initialize(collectors, scheduler)
      @collectors = collectors
      @scheduler = scheduler
    end

    def start
      collectors.each(&:start)
      scheduler.start
    end

    def shutdown!
      Datadog.logger.debug('Shutting down profiler')

      collectors.each do |collector|
        collector.enabled = false
        collector.stop(true)
      end

      scheduler.enabled = false
      scheduler.stop(true)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.54.2 lib/ddtrace/profiling/profiler.rb
ddtrace-0.54.1 lib/ddtrace/profiling/profiler.rb
ddtrace-0.54.0 lib/ddtrace/profiling/profiler.rb
ddtrace-0.53.0 lib/ddtrace/profiling/profiler.rb
ddtrace-0.52.0 lib/ddtrace/profiling/profiler.rb