Sha256: 7e347c5f3b54dd6a6a50bfa5bfa1f4fa88439e2a291df866f056079c44a48015

Contents?: true

Size: 692 Bytes

Versions: 13

Compression:

Stored size: 692 Bytes

Contents

# typed: true

module Datadog
  module Profiling
    # 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
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ddtrace-1.6.1 lib/datadog/profiling/profiler.rb
ddtrace-1.6.0 lib/datadog/profiling/profiler.rb
ddtrace-1.5.2 lib/datadog/profiling/profiler.rb
ddtrace-1.5.1 lib/datadog/profiling/profiler.rb
ddtrace-1.5.0 lib/datadog/profiling/profiler.rb
ddtrace-1.4.2 lib/datadog/profiling/profiler.rb
ddtrace-1.4.1 lib/datadog/profiling/profiler.rb
ddtrace-1.4.0 lib/datadog/profiling/profiler.rb
ddtrace-1.3.0 lib/datadog/profiling/profiler.rb
ddtrace-1.2.0 lib/datadog/profiling/profiler.rb
ddtrace-1.1.0 lib/datadog/profiling/profiler.rb
ddtrace-1.0.0 lib/datadog/profiling/profiler.rb
ddtrace-1.0.0.beta2 lib/datadog/profiling/profiler.rb